* Starting learning ADA
@ 2019-06-08 15:26 Ricardo Brandão
2019-06-08 15:53 ` Simon Wright
2019-06-08 15:55 ` joakimds
0 siblings, 2 replies; 18+ messages in thread
From: Ricardo Brandão @ 2019-06-08 15:26 UTC (permalink / raw)
Hi,
This is my first contact with Ada language.
I'm following the tutorial in Learn Adacore site [1], and so far it's ok. I'm compiling the codes in Windows (using gprbuild.exe) and Linux Ubuntu (using gnatmake).
But my idea is create more complex programs, running in IoT, desktop, and servers. And as I'm doing my doctorate and need to do a prototype of a secure protocol to an IoT network, my idea is use Ada to force me learn Ada in an "almost" real application.
But, I'm a bit confused on how to search, install, get some examples of libraries that I'll use to achieve my goal.
For instance, googling some library to deal with Json files, I found out the GNATCOOL.JSON package [2].
Trying to find where to download and install, I reached the Github repo [3]. I cloned it in Windows and Linux, but I didn't get to install it.
In Windows:
- I got to repository directory and:
- make setup
- make install
The output:
> make setup
> make install
gprinstall -p -f --target=executable:gcc.exe -XGNATCOLL_MMAP=yes -XGNATCOLL_MADVISE=yes -XGNATCOLL_VERSION=0.0 -XGNATCOLL_OS=unix -XBUILD=PROD --sources-subdir=include/gnatcoll --prefix=/d/GNAT/2019/bin/.. -XLIBRARY_TYPE=static -XXMLADA_BUILD=static -XGPR_BUILD=static \
--build-name=static -XGNATCOLL_MMAP=yes -XGNATCOLL_MADVISE=yes -XGNATCOLL_VERSION=0.0 -XGNATCOLL_OS=unix -XBUILD=PROD \
--build-var=LIBRARY_TYPE --build-var=GNATCOLL_BUILD \
--build-var=GNATCOLL_CORE_BUILD gnatcoll.gpr
gprconfig: can't find a toolchain for the following configuration:
gprconfig: language 'c', target 'executable:gcc.exe', default runtime
gprconfig: can't find a toolchain for the following configuration:
gprconfig: language 'ada', target 'executable:gcc.exe', default runtime
gnatcoll.gpr:24:06: unknown project file: "gpr"
gprinstall: "gnatcoll.gpr" processing failed
make: *** [install-static] Error 4:
In Linux:
$ make setup
make: gprconfig: Command not found
Makefile:71: *** No toolchain found for target "x86_64-linux-gnu". Stop.
# So, I tried to install gprconfig (Ubuntu gprbuild package)
$ sudo apt-get install gprbuild
# Tried make setup again
$ make setup
raised STORAGE_ERROR : stack overflow or erroneous memory access
Makefile:71: *** No toolchain found for target "x86_64-linux-gnu". Stop.
So, what are the "correct" paths to search, install, and test libraries?
Thanks
[1] https://learn.adacore.com/index.html
[2] http://docs.adacore.com/live/wave/gnatcoll/html/gnatcoll_ug/json.html?highlight=json
[3] https://github.com/AdaCore/gnatcoll-core
--
Ricardo Brandão
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Starting learning ADA 2019-06-08 15:26 Starting learning ADA Ricardo Brandão @ 2019-06-08 15:53 ` Simon Wright 2019-06-08 17:07 ` Ricardo Brandão 2019-06-08 15:55 ` joakimds 1 sibling, 1 reply; 18+ messages in thread From: Simon Wright @ 2019-06-08 15:53 UTC (permalink / raw) Ricardo Brandão <rbrandao.br@gmail.com> writes: > For instance, googling some library to deal with Json files, I found > out the GNATCOOL.JSON package [2]. Earlier, you said you'd installed CE 2019, the Mac (Darwin) version of this already includes GNATCOLL.Core (& therefore GNATCOLL.JSON). > Trying to find where to download and install, I reached the Github > repo [3]. I cloned it in Windows and Linux, but I didn't get to > install it. > > In Windows: > - I got to repository directory and: > - make setup > - make install > > The output: > >> make setup Looks as though you need 'make build' in between these two. >> make install > gprinstall -p -f --target=executable:gcc.exe -XGNATCOLL_MMAP=yes > -XGNATCOLL_MADVISE=yes -XGNATCOLL_VERSION=0.0 -XGNATCOLL_OS=unix Something seriously wrong here. The target should be something like x86_64-pc-mingw32 (here, it's x86_64-apple-darwin15). The OS should of course be Windows. You said that the Linux attempt couldn't find gprconfig. Were you using the CE 2019 suite? What was the PATH? ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Starting learning ADA 2019-06-08 15:53 ` Simon Wright @ 2019-06-08 17:07 ` Ricardo Brandão 2019-06-09 1:42 ` Dennis Lee Bieber 0 siblings, 1 reply; 18+ messages in thread From: Ricardo Brandão @ 2019-06-08 17:07 UTC (permalink / raw) Hi Simon > > Earlier, you said you'd installed CE 2019, the Mac (Darwin) version of > this already includes GNATCOLL.Core (& therefore GNATCOLL.JSON). > I'm using Windows 10, and I found out, following the message from Joakim, it's really have the gnatcool package on GNAT CE installation on directory \GNAT\2019\share\gpr. The files are: gnacool.gpr gnacool_gmp.gpr gnacool_iconv.gpr > > In Windows: > > - I got to repository directory and: > > - make setup > > - make install > > > > The output: > > > >> make setup > > Looks as though you need 'make build' in between these two. > > >> make install > > gprinstall -p -f --target=executable:gcc.exe -XGNATCOLL_MMAP=yes > > -XGNATCOLL_MADVISE=yes -XGNATCOLL_VERSION=0.0 -XGNATCOLL_OS=unix > > Something seriously wrong here. The target should be something like > x86_64-pc-mingw32 (here, it's x86_64-apple-darwin15). The OS should of > course be Windows. > Even if I change unix for x86_64-pc-mingw32 the problem continue. I imagine it's some PATH, or installation problem. The last line says that could not find gnatcool.gpr file, so I copied it from \GNAT\2019\share\gpr and tried to run again, and I got a lot of errors saying that don't find toolchains, project file, etc. gprbuild -p -m --target=executable:gcc.exe -j0 -XGNATCOLL_MMAP=yes -XGNATCOLL_MADVISE=yes -XGNATCOLL_VERSION=0.0 -XGNATCOLL_OS=unix -XBUILD=PROD -XLIBRARY_TYPE=static -XXMLADA_BUILD=static -XGPR_BUILD=static \ -XGNATCOLL_MMAP=yes -XGNATCOLL_MADVISE=yes -XGNATCOLL_VERSION=0.0 -XGNATCOLL_OS=unix -XBUILD=PROD gnatcoll.gpr gprconfig: can't find a toolchain for the following configuration: gprconfig: language 'c', target 'executable:gcc.exe', default runtime gprconfig: can't find a toolchain for the following configuration: gprconfig: language 'ada', target 'executable:gcc.exe', default runtime gnatcoll.gpr:3:06: unknown project file: "xmlada_dom" gnatcoll.gpr:4:06: unknown project file: "xmlada_input" gnatcoll.gpr:5:06: unknown project file: "xmlada_unicode" gnatcoll.gpr:6:06: unknown project file: "xmlada_sax" gnatcoll.gpr:7:06: unknown project file: "xmlada_schema" gnatcoll.gpr:8:06: unknown project file: "gpr" gprbuild: "gnatcoll.gpr" processing failed make: *** [build-static] Error 4 > You said that the Linux attempt couldn't find gprconfig. Were you using > the CE 2019 suite? What was the PATH? Actually I'm using Ubuntu Subsystem for Windows 10. It's a command line system. So, to compile Ada programs, I installed gnat using: sudo apt-get install gnat And when it doesn't find gprconfig, I installed gprbuild as I mentioned in the first message of this thread. So, my question is: to run Ada from a command line Linux OS, install gnat from apt-get is the best way? And if yes, how to download and install libraries? Thanks Ricardo Brandão ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Starting learning ADA 2019-06-08 17:07 ` Ricardo Brandão @ 2019-06-09 1:42 ` Dennis Lee Bieber 2019-06-09 7:25 ` Niklas Holsti 0 siblings, 1 reply; 18+ messages in thread From: Dennis Lee Bieber @ 2019-06-09 1:42 UTC (permalink / raw) On Sat, 8 Jun 2019 10:07:13 -0700 (PDT), Ricardo Brandão <rbrandao.br@gmail.com> declaimed the following: >Even if I change unix for x86_64-pc-mingw32 the problem continue. > No surprise -- mingw32 is an environment on Windows to support UNIX/Linux run-time calls (and maybe even some command line tools). Debian Stretch running in VirtualBox: wulfraed@stretch:~$ sudo find / -iname "gnat*" /usr/share/lintian/overrides/gnat-gps-common /usr/share/doc/gnat-gps /usr/share/doc/gnat-6 /usr/share/doc/gnat <SNIP> /usr/share/applications/gnat-programming-studio.desktop /usr/lib/gcc/x86_64-linux-gnu/6/gnat1 /usr/lib/gcc/x86_64-linux-gnu/6/adainclude/gnat.ads /usr/lib/gcc/x86_64-linux-gnu/6/adalib/gnat.ali /usr/bin/gnatcoll_db2ada wulfraed@stretch:~$ sudo find / -iname "*gnat*coll*" <SNIP> /usr/lib/x86_64-linux-gnu/libgnatcoll_iconv.so.1.7 /usr/lib/x86_64-linux-gnu/libgnatcoll.so.1.7 /usr/lib/x86_64-linux-gnu/libgnatcoll_sqlite.so.1.7 /usr/lib/x86_64-linux-gnu/libgnatcoll_readline.so.1.7 /usr/lib/x86_64-linux-gnu/libgnatcoll_python.so.1.7 /usr/lib/x86_64-linux-gnu/libgnatcoll_gtk.so.1.7 /usr/bin/gnatcoll_db2ada <SNIP> >I imagine it's some PATH, or installation problem. The last line says that could not find gnatcool.gpr file, so I copied it from \GNAT\2019\share\gpr and tried to run again, and I got a lot of errors saying that don't find toolchains, project file, etc. I don't find a gnatcoll.gpr (presume you typo'd above) on this install -- appears Debian only makes pre-built libraries available; I can't even find source options in the package manager... wulfraed@stretch:~$ gprconfig -------------------------------------------------- gprconfig has found the following compilers on your PATH. Only those matching the target and the selected compilers are displayed. 1. GNAT for Ada in /usr/bin/ version 6 (default runtime) 2. GCC-ASM for Asm in /usr/bin/ version 6.3.0 3. GCC-ASM for Asm2 in /usr/bin/ version 6.3.0 4. GCC-ASM for Asm_Cpp in /usr/bin/ version 6.3.0 5. LLVM for C in /usr/bin/ version 3.8.1 6. GNATGCC for C in /usr/bin/ version 6.3.0 7. GCC for C in /usr/bin/ version 6.3.0 8. G++ for C++ in /usr/bin/ version 6.3.0 9. GFORTRAN for Fortran in /usr/bin/ version 6.3.0 Select or unselect the following compiler (or "s" to save): > >Actually I'm using Ubuntu Subsystem for Windows 10. It's a command line system. So, to compile Ada programs, I installed gnat using: > >sudo apt-get install gnat > >And when it doesn't find gprconfig, I installed gprbuild as I mentioned in the first message of this thread. > >So, my question is: to run Ada from a command line Linux OS, install gnat from apt-get is the best way? And if yes, how to download and install libraries? Usually -- using apt-get for pre-built binaries. Note that the Ubuntu on Windows is rather ancient ("Trusty", so source packages may be asking for things that weren't in that release). FYI: the M$ "app store" has a download for Debian on the Windows Linux subsystem (and as I recall, a few other distributions too; you might find one you prefer over Ubuntu... And they can exist in parallel -- each gets its own start-up shortcut). gprconfig appears to be unusable in the Ubuntu on Windows config. I just did the apt-get install for gnat and gprbuild... root@ElusiveUnicorn:~# gprconfig Execution terminated by unhandled exception Exception name: STORAGE_ERROR Message: stack overflow (or erroneous memory access) Call stack traceback locations: 0x7f5caf0c6cae 0x7fffd3d257cf root@ElusiveUnicorn:~# sudo gprconfig Execution terminated by unhandled exception Exception name: STORAGE_ERROR Message: stack overflow (or erroneous memory access) Call stack traceback locations: 0x7f9bebac6cae 0x7fffe5988daf root@ElusiveUnicorn:~# gprconfig is also unusable on the Debian on Windows system. wulfraed@ElusiveUnicorn:~$ gprconfig raised STORAGE_ERROR : stack overflow or erroneous memory access wulfraed@ElusiveUnicorn:~$ sudo gprconfig [sudo] password for wulfraed: raised STORAGE_ERROR : stack overflow or erroneous memory access wulfraed@ElusiveUnicorn:~$ gprbuild is also problematic in the Debian system (on Ubuntu it gave me the "usage" help. wulfraed@ElusiveUnicorn:~$ gprbuild using project file /usr/share/gpr/_default.gpr raised STORAGE_ERROR : stack overflow or erroneous memory access gprbuild: could not create /home/wulfraed/auto.cgpr wulfraed@ElusiveUnicorn:~$ gnatmake does give the usage help, so projects usable with gnatmake might be viable -- but the Linux subsystem may not be the best choice for program development (I believe the intent had been to allow administrators to use BASH and related tools for performing tasks on Windows). Next experiment will take a while -- I'm bogging down my poor overworked R-Pi3B web server installing gnat/gprbuild... (Hmmm, that ran faster than I expected) md_admin@microdiversity:~$ gprconfig -------------------------------------------------- gprconfig has found the following compilers on your PATH. Only those matching the target and the selected compilers are displayed. 1. GNAT for Ada in /usr/bin/ version 6 (default runtime) 2. GNAT for Ada in /usr/bin/ version 6 (default runtime) 3. GCC-ASM for Asm in /usr/bin/ version 6.3.0 4. GCC-ASM for Asm in /usr/bin/ version 6.3.0 5. GCC-ASM for Asm2 in /usr/bin/ version 6.3.0 6. GCC-ASM for Asm2 in /usr/bin/ version 6.3.0 7. GCC-ASM for Asm_Cpp in /usr/bin/ version 6.3.0 8. GCC-ASM for Asm_Cpp in /usr/bin/ version 6.3.0 9. GCC for C in /usr/bin/ version 6.3.0 10. GCC for C in /usr/bin/ version 6.3.0 11. GNATGCC for C in /usr/bin/ version 6.3.0 12. G++ for C++ in /usr/bin/ version 6.3.0 Select or unselect the following compiler (or "s" to save): ^C md_admin@microdiversity:~$ gprbuild using project file /usr/share/gpr/_default.gpr _default.gpr:1:18: warning: there are no Ada sources in this project gprbuild: no sources to compile md_admin@microdiversity:~$ Interesting -- seems to find everything twice (maybe my PATH has a duplication)... And "find" shows the gnatcoll libraries seem to have been installed with gnat. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/ ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Starting learning ADA 2019-06-09 1:42 ` Dennis Lee Bieber @ 2019-06-09 7:25 ` Niklas Holsti 0 siblings, 0 replies; 18+ messages in thread From: Niklas Holsti @ 2019-06-09 7:25 UTC (permalink / raw) On 19-06-09 04:42 , Dennis Lee Bieber wrote: > No surprise -- mingw32 is an environment on Windows to support > UNIX/Linux run-time calls No, mingw32 provides ports to Windows of GNU compilers and many GNU tools. These ports run on Windows, using Windows run-time calls. Most UNIX/Linux calls are _not_ supported, for example there is no fork(). > (and maybe even some command line tools). Yes, but they are ported to use the Windows run-time calls. Perhaps you are thinking of Cygwin, which does implement a UNIX/Linux (POSIX) emulation on Windows. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ . ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Starting learning ADA 2019-06-08 15:26 Starting learning ADA Ricardo Brandão 2019-06-08 15:53 ` Simon Wright @ 2019-06-08 15:55 ` joakimds 2019-06-08 17:10 ` Ricardo Brandão 1 sibling, 1 reply; 18+ messages in thread From: joakimds @ 2019-06-08 15:55 UTC (permalink / raw) Den lördag 8 juni 2019 kl. 17:26:15 UTC+2 skrev Ricardo Brandão: > Hi, > > This is my first contact with Ada language. > > I'm following the tutorial in Learn Adacore site [1], and so far it's ok. I'm compiling the codes in Windows (using gprbuild.exe) and Linux Ubuntu (using gnatmake). > > But my idea is create more complex programs, running in IoT, desktop, and servers. And as I'm doing my doctorate and need to do a prototype of a secure protocol to an IoT network, my idea is use Ada to force me learn Ada in an "almost" real application. > > But, I'm a bit confused on how to search, install, get some examples of libraries that I'll use to achieve my goal. > > For instance, googling some library to deal with Json files, I found out the GNATCOOL.JSON package [2]. > > Trying to find where to download and install, I reached the Github repo [3]. I cloned it in Windows and Linux, but I didn't get to install it. > > In Windows: > - I got to repository directory and: > - make setup > - make install > > The output: > > > make setup > > make install > gprinstall -p -f --target=executable:gcc.exe -XGNATCOLL_MMAP=yes -XGNATCOLL_MADVISE=yes -XGNATCOLL_VERSION=0.0 -XGNATCOLL_OS=unix -XBUILD=PROD --sources-subdir=include/gnatcoll --prefix=/d/GNAT/2019/bin/.. -XLIBRARY_TYPE=static -XXMLADA_BUILD=static -XGPR_BUILD=static \ > --build-name=static -XGNATCOLL_MMAP=yes -XGNATCOLL_MADVISE=yes -XGNATCOLL_VERSION=0.0 -XGNATCOLL_OS=unix -XBUILD=PROD \ > --build-var=LIBRARY_TYPE --build-var=GNATCOLL_BUILD \ > --build-var=GNATCOLL_CORE_BUILD gnatcoll.gpr > gprconfig: can't find a toolchain for the following configuration: > gprconfig: language 'c', target 'executable:gcc.exe', default runtime > gprconfig: can't find a toolchain for the following configuration: > gprconfig: language 'ada', target 'executable:gcc.exe', default runtime > gnatcoll.gpr:24:06: unknown project file: "gpr" > gprinstall: "gnatcoll.gpr" processing failed > make: *** [install-static] Error 4: > > In Linux: > > $ make setup > make: gprconfig: Command not found > Makefile:71: *** No toolchain found for target "x86_64-linux-gnu". Stop. > > # So, I tried to install gprconfig (Ubuntu gprbuild package) > $ sudo apt-get install gprbuild > > # Tried make setup again > $ make setup > > raised STORAGE_ERROR : stack overflow or erroneous memory access > Makefile:71: *** No toolchain found for target "x86_64-linux-gnu". Stop. > > So, what are the "correct" paths to search, install, and test libraries? > > Thanks > > > [1] https://learn.adacore.com/index.html > [2] http://docs.adacore.com/live/wave/gnatcoll/html/gnatcoll_ug/json.html?highlight=json > [3] https://github.com/AdaCore/gnatcoll-core > > -- > Ricardo Brandão Hi Ricardo, I wouldn't recommend cloning the github repository of gnatcoll directly because it's probably "the latest development version" and may use features of the latest development version of the GNAT compiler. I therefore wouldn't expect to be able to build that code with an older compiler. However, a version of gnatcoll is installed with the GNAT Community Edition. In the 2019 version of GNAT CE the gnatcoll.gpr file can be found in C:\GNAT\2019\share\gpr It should be possible to with "gnatcoll.gpr"; in your gpr-file to be good to go. Best regards, Joakim ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Starting learning ADA 2019-06-08 15:55 ` joakimds @ 2019-06-08 17:10 ` Ricardo Brandão 2019-06-08 17:46 ` joakimds 0 siblings, 1 reply; 18+ messages in thread From: Ricardo Brandão @ 2019-06-08 17:10 UTC (permalink / raw) Hi Joakim, > I wouldn't recommend cloning the github repository of gnatcoll directly because it's probably "the latest development version" and may use features of the latest development version of the GNAT compiler. I therefore wouldn't expect to be able to build that code with an older compiler. However, a version of gnatcoll is installed with the GNAT Community Edition. In the 2019 version of GNAT CE the gnatcoll.gpr file can be found in C:\GNAT\2019\share\gpr > It should be possible to with "gnatcoll.gpr"; in your gpr-file to be good to go. > To run it from command line, how to inform the gprbuild to look a package in a specif directory? Thanks -- Ricardo Brandão ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Starting learning ADA 2019-06-08 17:10 ` Ricardo Brandão @ 2019-06-08 17:46 ` joakimds 2019-06-08 20:10 ` Simon Wright 2019-06-09 14:31 ` Ricardo Brandão 0 siblings, 2 replies; 18+ messages in thread From: joakimds @ 2019-06-08 17:46 UTC (permalink / raw) Den lördag 8 juni 2019 kl. 19:10:20 UTC+2 skrev Ricardo Brandão: > Hi Joakim, > > > I wouldn't recommend cloning the github repository of gnatcoll directly because it's probably "the latest development version" and may use features of the latest development version of the GNAT compiler. I therefore wouldn't expect to be able to build that code with an older compiler. However, a version of gnatcoll is installed with the GNAT Community Edition. In the 2019 version of GNAT CE the gnatcoll.gpr file can be found in C:\GNAT\2019\share\gpr > > It should be possible to with "gnatcoll.gpr"; in your gpr-file to be good to go. > > > > To run it from command line, how to inform the gprbuild to look a package in a specif directory? > > Thanks > > -- > Ricardo Brandão Hi Ricardo, In the past I've used an environment variable ADA_PROJECT_PATH to specify this, but I don't think it's necessary anymore. It is nowadays sufficient to specify the PATH variable to find the GNAT compiler and from that gprbuild can figure out where the gpr-files should be. From what I understand you have installed two different GNAT compilers on your computer and that's what causes the issues you see. First GNAT CE 2019 has been installed and then the FSF GNAT compiler by "sudo apt install gnat" and the FSF version of gprbuild by "sudo apt install gprbuild". The GNAT CE and FSF GNAT compilers are two different compilers and the binaries they produce are not compatible with each other (others in this forum can explain why much better than I can). In the GNAT CE installation, the gnatcoll library is pre-compiled by the GNAT CE compiler. Those binaries cannot be used by the FSF GNAT compiler. To get the computer in working order I suggest de-installing the FSF version of GNAT and gprbuild and then use the normal command prompt for using gprbuild (GNAT CE 2019 version). When opening the normal command prompt in Windows 10 and one executes "gcc --version" it should say it is the GNAT Community 2019 version of the compiler. You could try that in the Ubuntu Subsystem and I predict is will say gcc is the FSF version. Best regards, Joakim ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Starting learning ADA 2019-06-08 17:46 ` joakimds @ 2019-06-08 20:10 ` Simon Wright 2019-06-09 14:39 ` Ricardo Brandão 2019-06-09 14:31 ` Ricardo Brandão 1 sibling, 1 reply; 18+ messages in thread From: Simon Wright @ 2019-06-08 20:10 UTC (permalink / raw) joakimds@kth.se writes: > When opening the normal command prompt in Windows 10 and one executes > "gcc --version" it should say it is the GNAT Community 2019 version of > the compiler. You could try that in the Ubuntu Subsystem and I predict > is will say gcc is the FSF version. The other check is "gnatls -v". On this macbook I get ==================== $ gnatls -v GNATLS Community 2019 (20190517-83) Copyright (C) 1997-2019, Free Software Foundation, Inc. Source Search Path: <Current_Directory> /opt/gnat-ce-2019/lib/gcc/x86_64-apple-darwin17.7.0/8.3.1/rts-native/adainclude Object Search Path: <Current_Directory> /opt/gnat-ce-2019/lib/gcc/x86_64-apple-darwin17.7.0/8.3.1/rts-native/adalib Project Search Path: <Current_Directory> /opt/gnat-ce-2019/x86_64-apple-darwin17.7.0/lib/gnat /opt/gnat-ce-2019/x86_64-apple-darwin17.7.0/share/gpr /opt/gnat-ce-2019/share/gpr /opt/gnat-ce-2019/lib/gnat ==================== and I'd expect your Linux version to look very similar, except that the prefix (/opt/gnat-ce-2019) and the machine triplet (x86_64-apple-darwin17.7.0) will of course change for your environment. Note that the last set (Project Search Path) includes $prefix/share/gpr and $prefix/lib/gnat; gnatcoll.gpr is in the first. So you should *not* need to mess with ADA_PROJECT_PATH. I can speak to the Mac environment, make an educated guess about the Linux environment, but not so much about Windows. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Starting learning ADA 2019-06-08 20:10 ` Simon Wright @ 2019-06-09 14:39 ` Ricardo Brandão 2019-06-09 17:44 ` Simon Wright 0 siblings, 1 reply; 18+ messages in thread From: Ricardo Brandão @ 2019-06-09 14:39 UTC (permalink / raw) Hi Simon, > > The other check is "gnatls -v". On this macbook I get > The output on Windows 10: GNATLS Community 2019 (20190517-83) Copyright (C) 1997-2019, Free Software Foundation, Inc. Source Search Path: <Current_Directory> D:\GNAT\2019\lib\gcc\x86_64-pc-mingw32\8.3.1\adainclude Object Search Path: <Current_Directory> D:\GNAT\2019\lib\gcc\x86_64-pc-mingw32\8.3.1\adalib Project Search Path: <Current_Directory> D:\GNAT\2019\x86_64-pc-mingw32\lib\gnat D:\GNAT\2019\x86_64-pc-mingw32\share\gpr D:\GNAT\2019\share\gpr D:\GNAT\2019\lib\gnat And Ubuntu Subsystem $ gnatls -v GNATLS 4.9.3 Copyright (C) 1997-2014, Free Software Foundation, Inc. Source Search Path: <Current_Directory> /usr/lib/gcc/x86_64-linux-gnu/4.9/adainclude/ Object Search Path: <Current_Directory> /usr/lib/gcc/x86_64-linux-gnu/4.9/adalib/ Project Search Path: <Current_Directory> /usr/share/ada/adainclude ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Starting learning ADA 2019-06-09 14:39 ` Ricardo Brandão @ 2019-06-09 17:44 ` Simon Wright 2019-06-09 18:12 ` Ricardo Brandão 2019-06-09 18:23 ` Dennis Lee Bieber 0 siblings, 2 replies; 18+ messages in thread From: Simon Wright @ 2019-06-09 17:44 UTC (permalink / raw) Ricardo Brandão <rbrandao.br@gmail.com> writes: > And Ubuntu Subsystem > > $ gnatls -v > > GNATLS 4.9.3 > Copyright (C) 1997-2014, Free Software Foundation, Inc. This is really quite old. Ada 2012 features won't be as well implemented as newer releases. > Project Search Path: > <Current_Directory> > /usr/share/ada/adainclude This is fine so long as you use Ubuntu-provided packages. Debian maintainers created what they hoped would be a standard filesystem layout for Ada. Unfortunately, AdaCore didn't follow it, so there's perennial difficulty mixing Debian and AdaCore packages. Building an AdaCore-provided package in this environment will result in its components (e.g. GPRs) being installed in a place that the compiler won't be looking for. If you can install GNAT CE 2019 in this environment, that would probably work much better. And include GPS. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Starting learning ADA 2019-06-09 17:44 ` Simon Wright @ 2019-06-09 18:12 ` Ricardo Brandão 2019-06-09 19:29 ` Dmitry A. Kazakov 2019-06-10 17:40 ` Dennis Lee Bieber 2019-06-09 18:23 ` Dennis Lee Bieber 1 sibling, 2 replies; 18+ messages in thread From: Ricardo Brandão @ 2019-06-09 18:12 UTC (permalink / raw) Thanks for information Simon > If you can install GNAT CE 2019 in this environment, that would probably > work much better. And include GPS. My question is: I'm in process of learning Ada. So, in some time in the near future (as soon as I got some good knowledge), I'll need to deploy in different devices: at least, Linux servers, embedded devices, and Windows. Will be possible compile the libraries in all these platforms? Thanks -- Ricardo Brandão ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Starting learning ADA 2019-06-09 18:12 ` Ricardo Brandão @ 2019-06-09 19:29 ` Dmitry A. Kazakov 2019-06-10 17:40 ` Dennis Lee Bieber 1 sibling, 0 replies; 18+ messages in thread From: Dmitry A. Kazakov @ 2019-06-09 19:29 UTC (permalink / raw) On 2019-06-09 20:12, Ricardo Brandão wrote: > Thanks for information Simon > >> If you can install GNAT CE 2019 in this environment, that would probably >> work much better. And include GPS. > > My question is: I'm in process of learning Ada. So, in some time in the near future (as soon as I got some good knowledge), I'll need to deploy in different devices: at least, Linux servers, embedded devices, and Windows. Will be possible compile the libraries in all these platforms? Yes, it is easy. Especially with Ada libraries that do not use autoconf, make, cmake. Comparing to building any GNU library under, say, VxWorks Ada libraries work almost out of the box. Regarding gprconfig. It frequently gets broken under Debian and Ubuntu. You can simply use a configuration file with gprbuild: gprbuild --config=config.cgpr -P<project>.gpr config.cgpr is just a text file with 1-2 lines actually relevant to make it work. E.g. this is for Debian GNAT 8: ---------------------------------> -- This gpr configuration file was generated by gprconfig configuration project Default is for Target use "x86_64-linux-gnu"; for Inherit_Source_Path ("C++") use ("C"); for Toolchain_Version ("Ada") use "GNAT 8"; for Runtime_Dir ("Ada") use "/usr/lib/gcc/x86_64-linux-gnu/8/"; for Library_Encapsulated_Supported use "true"; for Object_Lister use ("nm", "-g"); for Object_Lister_Matcher use " [TDRB] (.*)"; for Archive_Builder use ("ar", "cr"); for Archive_Builder_Append_Option use ("q"); for Archive_Indexer use ("ranlib"); for Archive_Suffix use ".a"; for Library_Builder use "/usr/lib/gprbuild/gprlib"; for Library_Support use "full"; for Shared_Library_Prefix use "lib"; for Symbolic_Link_Supported use "true"; for Library_Major_Minor_Id_Supported use "true"; for Shared_Library_Minimum_Switches use ("-shared"); for Library_Version_Switches use ("-Wl,-soname,"); for Shared_Library_Suffix use ".so"; for Library_Auto_Init_Supported use "true"; for Run_Path_Option use ("-Wl,-z,origin,-rpath,"); for Run_Path_Origin use "$ORIGIN"; for Library_Encapsulated_Options use ("-shared", "-static-libgcc"); Target_Name := project'Target; case Target_Name is when "arm-android" | "arm-linux-androideabi" => null; when others => for Library_Partial_Linker use ("/usr/bin/gnatgcc", "-nostdlib", "-Wl,-r", "-o"); end case; for Default_Language use "Ada"; package Compiler is for Driver ("C") use "/usr/bin/gnatgcc"; for Leading_Required_Switches ("C") use ("-c", "-x", "c") & Compiler'Leading_Required_Switches ("C"); for Include_Switches ("C") use ("-I"); for Max_Command_Line_Length use "8192"; for Response_File_Format ("C") use "GCC_GNU"; for Dependency_Switches ("C") use ("-MMD", "-MF", ""); for PIC_Option ("C") use ("-fPIC"); for Driver ("Ada") use "/usr/bin/gnatgcc"; for Language_Kind ("Ada") use "unit_based"; for Dependency_Kind ("Ada") use "ALI_File"; for Leading_Required_Switches ("Ada") use ("-c", "-x", "ada", "-gnatA") & Compiler'Leading_Required_Switches ("Ada"); for Mapping_File_Switches ("Ada") use ("-gnatem="); for Mapping_Spec_Suffix ("Ada") use "%s"; for Mapping_Body_Suffix ("Ada") use "%b"; for Config_File_Switches ("Ada") use ("-gnatec="); for Include_Path_File ("Ada") use "ADA_PRJ_INCLUDE_FILE"; for Multi_Unit_Switches ("Ada") use ("-gnateI"); for Multi_Unit_Object_Separator ("Ada") use "~"; for Config_Body_File_Name ("Ada") use "pragma Source_File_Name_Project (%u, Body_File_Name => ""%f"");"; for Config_Spec_File_Name ("Ada") use "pragma Source_File_Name_Project (%u, Spec_File_Name => ""%f"");"; for Config_Body_File_Name_Index ("Ada") use "pragma Source_File_Name_Project (%u, Body_File_Name => ""%f"", Index => %i);"; for Config_Spec_File_Name_Index ("Ada") use "pragma Source_File_Name_Project (%u, Spec_File_Name => ""%f"", Index => %i);"; for Config_Body_File_Name_Pattern ("Ada") use "pragma Source_File_Name_Project " & " (Body_File_Name => ""*%b""," & " Casing => %c," & " Dot_Replacement => ""%d"");"; for Config_Spec_File_Name_Pattern ("Ada") use "pragma Source_File_Name_Project " & " (Spec_File_Name => ""*%s""," & " Casing => %c," & " Dot_Replacement => ""%d"");"; for Config_File_Unique ("Ada") use "False"; for PIC_Option ("Ada") use ("-fPIC"); end Compiler; package Naming is for Spec_Suffix ("Ada") use ".ads"; for Body_Suffix ("Ada") use ".adb"; for Body_Suffix ("Asm") use ".s"; for Body_Suffix ("Asm2") use ".asm"; for Body_Suffix ("Asm_Cpp") use ".S"; for Body_Suffix ("C") use ".c"; for Spec_Suffix ("C") use ".h"; for Spec_Suffix ("C++") use ".hh"; for Body_Suffix ("C++") use ".cpp"; for Body_Suffix ("Fortran") use ".f"; for Casing use "lowercase"; for Dot_Replacement use "-"; end Naming; package Binder is for Required_Switches ("Ada") use Binder'Required_Switches ("Ada") & ("gnatbind_prefix="); for Objects_Path_File ("Ada") use "ADA_PRJ_OBJECTS_FILE"; for Driver ("Ada") use "/usr/lib/gprbuild/gprbind"; end Binder; package Linker is for Export_File_Format use "GNU"; for Export_File_Switch use "-Wl,--version-script="; for Map_File_Option use "-Wl,-Map,"; for Driver use Compiler'Driver ("Ada"); for Response_File_Format use "GCC_GNU"; for Max_Command_Line_Length use "8192"; end Linker; package Clean is for Source_Artifact_Extensions ("Ada") use (".dg", ".rep"); for Object_Artifact_Extensions ("Ada") use (".s", ".ci", ".gcno", ".su"); for Source_Artifact_Extensions ("C") use (".gli"); for Object_Artifact_Extensions ("C") use (".s", "ci", ".gcno", ".su"); for Source_Artifact_Extensions ("C++") use (".gli"); for Object_Artifact_Extensions ("C++") use (".s", "ci", ".gcno", ".su"); -- Remove the files generated by gnatinspect (in the context of GPS) for Artifacts_In_Object_Dir use Clean'Artifacts_In_Object_Dir & ("gnatinspect.*"); end Clean; end Default; <------------------------------------------ Check and modify paths in it. Make sure hello-world project compiles and then use it with all projects. You can even make gprbuild.sh that calls the original gprbuild with the --config switch. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Starting learning ADA 2019-06-09 18:12 ` Ricardo Brandão 2019-06-09 19:29 ` Dmitry A. Kazakov @ 2019-06-10 17:40 ` Dennis Lee Bieber 1 sibling, 0 replies; 18+ messages in thread From: Dennis Lee Bieber @ 2019-06-10 17:40 UTC (permalink / raw) On Sun, 9 Jun 2019 11:12:37 -0700 (PDT), Ricardo Brandão <rbrandao.br@gmail.com> declaimed the following: >My question is: I'm in process of learning Ada. So, in some time in the near future (as soon as I got some good knowledge), I'll need to deploy in different devices: at least, Linux servers, embedded devices, and Windows. Will be possible compile the libraries in all these platforms? > Well, AdaCore does provide an ARM cross-compiler that runs under windows, for embedded targets. GPS, under project properties allows one to specify the toolchain to be used for building. My Windows install of CE2109 shows choices of Native arm-eabi Though as I recall, the arm toolchain currently has runtime support for only a few boards without OS (apologies -- wraps poorly) C:\GNAT\2019\2019-arm-elf\arm-eabi>dir /-w Volume in drive C is OS Volume Serial Number is 4ACC-3CB4 Directory of C:\GNAT\2019\2019-arm-elf\arm-eabi [.] [..] [bin] [BSPs] [include] [lib] [ravenscar-full-microbit] [ravenscar-full-rpi2] [ravenscar-full-stm32f4] [ravenscar-full-stm32f429disco] [ravenscar-full-stm32f469disco] [ravenscar-full-stm32f746disco] [ravenscar-full-stm32f769disco] [ravenscar-full-tms570] [ravenscar-full-tms570lc] [ravenscar-full-zynq7000] [ravenscar-sfp-microbit] [ravenscar-sfp-rpi2] [ravenscar-sfp-stm32f4] [ravenscar-sfp-stm32f429disco] [ravenscar-sfp-stm32f469disco] [ravenscar-sfp-stm32f746disco] [ravenscar-sfp-stm32f769disco] [ravenscar-sfp-tms570] [ravenscar-sfp-tms570lc] [ravenscar-sfp-zynq7000] [zfp-cortex-m0] [zfp-cortex-m0p] [zfp-cortex-m1] [zfp-cortex-m3] [zfp-cortex-m4] [zfp-cortex-m4f] [zfp-cortex-m7df] [zfp-cortex-m7f] [zfp-microbit] [zfp-rpi2] [zfp-stm32f4] [zfp-stm32f429disco] [zfp-stm32f469disco] [zfp-stm32f746disco] [zfp-stm32f769disco] [zfp-tms570] [zfp-tms570lc] [zfp-zynq7000] 0 File(s) 0 bytes 44 Dir(s) 1,331,771,797,504 bytes free Note that the above runtimes have minimal support for tasking (ravenscar profiles), or no tasking and other restrictions (exception handling?) -- zfp => zero footprint (really bare board). Maciej Sobczak has a publication for using Ada on Arduino/Nucleo ARM Cortex boards. For non-embedded, if you can stick to just the standard library (ie: no mapping to hardware, no linking with OS specific libraries), it should just be a case of compiling under the target OS (I don't know how easy it is to create a cross-compiler environment). -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/ ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Starting learning ADA 2019-06-09 17:44 ` Simon Wright 2019-06-09 18:12 ` Ricardo Brandão @ 2019-06-09 18:23 ` Dennis Lee Bieber 1 sibling, 0 replies; 18+ messages in thread From: Dennis Lee Bieber @ 2019-06-09 18:23 UTC (permalink / raw) On Sun, 09 Jun 2019 18:44:12 +0100, Simon Wright <simon@pushface.org> declaimed the following: >If you can install GNAT CE 2019 in this environment, that would probably >work much better. And include GPS. Which wouldn't be of much use unless one is running an X-Window server on the Windows side (Xming or similar). The Linux SubSystem for Windows is essentially just a BASH shell console. (Doing apt-get install gnat-gps in the Debian SubSystem console -- installs GNAT 6.3 (or is it 6.1 -- that's what apt-get shows) and a slew of other stuff) wulfraed@ElusiveUnicorn:~$ gnatls -v GNATLS 6.3.0 Copyright (C) 1997-2016, Free Software Foundation, Inc. Source Search Path: <Current_Directory> /usr/lib/gcc/x86_64-linux-gnu/6/adainclude Object Search Path: <Current_Directory> /usr/lib/gcc/x86_64-linux-gnu/6/adalib Project Search Path: <Current_Directory> /usr/share/ada/adainclude wulfraed@ElusiveUnicorn:~$ As expected -- no X-server wulfraed@ElusiveUnicorn:~$ gnat-gps Unable to init server: Could not connect: Connection refused (gnat-gps:1985): Gtk-WARNING **: cannot open display: wulfraed@ElusiveUnicorn:~$ If one is willing to figure out Xming, and specify the correct display environment in the Linux SubSystem, it might work (but again -- gprbuild seems to crash, so if GPS is expecting gpr projects rather than gnatmake, it still won't be usable). -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/ ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Starting learning ADA 2019-06-08 17:46 ` joakimds 2019-06-08 20:10 ` Simon Wright @ 2019-06-09 14:31 ` Ricardo Brandão 2019-06-09 19:35 ` Dmitry A. Kazakov 1 sibling, 1 reply; 18+ messages in thread From: Ricardo Brandão @ 2019-06-09 14:31 UTC (permalink / raw) Hi Joakim, > From what I understand you have installed two different GNAT compilers on your computer and that's what causes the issues you see. First GNAT CE 2019 has been installed and then the FSF GNAT compiler by "sudo apt install gnat" and the FSF version of gprbuild by "sudo apt install gprbuild". The GNAT CE and FSF GNAT compilers are two different compilers and the binaries they produce are not compatible with each other (others in this forum can explain why much better than I can). In the GNAT CE installation, the gnatcoll library is pre-compiled by the GNAT CE compiler. Those binaries cannot be used by the FSF GNAT compiler. To get the computer in working order I suggest de-installing the FSF version of GNAT and gprbuild and then use the normal command prompt for using gprbuild (GNAT CE 2019 version). > Yes, I previously had installed a GCC program, so when I got the output below when I ran: c:\>where gcc c:\MinGW\bin\gcc.exe D:\GNAT\2019\bin\gcc.exe So, removing c:\MinGW\bin\gcc.exe from PATH environment variable, I got remove the original problem, but I got new ones :). But probably, with Windows, as a newbie in Ada, I imagine the best is run through GPS. BTW, I solved a problem I was stuck in GPS [1], I didn't get debug in GPS, with "new" PATH variable, debug worked fine. > When opening the normal command prompt in Windows 10 and one executes "gcc --version" it should say it is the GNAT Community 2019 version of the compiler. You could try that in the Ubuntu Subsystem and I predict is will say gcc is the FSF version. Exactly: $ gcc --version gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Well, my idea is be able to run Ada programs in many OSs and embedded devices. But probably for this moment, I imagine the better thing to do is start with GPS until I become familiar with Ada and after, move to others OSs and devices. I noticed, as well, using the Ubuntu Subsystem for Windows 10 probably is not a good idea to understand how the stuffs run in a actual Linux distro. Thanks [1] https://groups.google.com/forum/#!topic/comp.lang.ada/cyrk-IRZBtQ -- Ricardo Brandao ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Starting learning ADA 2019-06-09 14:31 ` Ricardo Brandão @ 2019-06-09 19:35 ` Dmitry A. Kazakov 2019-06-10 12:28 ` Ricardo Brandão 0 siblings, 1 reply; 18+ messages in thread From: Dmitry A. Kazakov @ 2019-06-09 19:35 UTC (permalink / raw) On 2019-06-09 16:31, Ricardo Brandão wrote: > Well, my idea is be able to run Ada programs in many OSs and embedded devices. But probably for this moment, I imagine the better thing to do is start with GPS until I become familiar with Ada and after, move to others OSs and devices. > > I noticed, as well, using the Ubuntu Subsystem for Windows 10 probably is not a good idea to understand how the stuffs run in a actual Linux distro. Well, you could develop and test everything under Windows and then port it to Linux. With Ada it almost always works. E.g. we develop everything under Windows and do 90% tests right there. 10% is the cases when we need the target platform's hardware, e.g. physical CAN bus. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Starting learning ADA 2019-06-09 19:35 ` Dmitry A. Kazakov @ 2019-06-10 12:28 ` Ricardo Brandão 0 siblings, 0 replies; 18+ messages in thread From: Ricardo Brandão @ 2019-06-10 12:28 UTC (permalink / raw) Hey guys, Thank you so much for all valuable information. I will continue learn Ada, and looking forward for my first project. Best regards -- Ricardo ^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2019-06-10 17:40 UTC | newest] Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2019-06-08 15:26 Starting learning ADA Ricardo Brandão 2019-06-08 15:53 ` Simon Wright 2019-06-08 17:07 ` Ricardo Brandão 2019-06-09 1:42 ` Dennis Lee Bieber 2019-06-09 7:25 ` Niklas Holsti 2019-06-08 15:55 ` joakimds 2019-06-08 17:10 ` Ricardo Brandão 2019-06-08 17:46 ` joakimds 2019-06-08 20:10 ` Simon Wright 2019-06-09 14:39 ` Ricardo Brandão 2019-06-09 17:44 ` Simon Wright 2019-06-09 18:12 ` Ricardo Brandão 2019-06-09 19:29 ` Dmitry A. Kazakov 2019-06-10 17:40 ` Dennis Lee Bieber 2019-06-09 18:23 ` Dennis Lee Bieber 2019-06-09 14:31 ` Ricardo Brandão 2019-06-09 19:35 ` Dmitry A. Kazakov 2019-06-10 12:28 ` Ricardo Brandão
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox