From: resander on
I installed (by doinstall) the latest version of free GNAT GPL from
Libre into directory /usr/gnat/bin. After install this contains:

ken(a)meijin-desktop:/usr/gnat/bin$ ls
addr2line gdb gnathtml.pl gnatprep gprof
c++ gdbserver gnatkr gnatstub gps
cbrowser gnat gnatlink gnatxref gps_exe
cpp gnatbind gnatls gprbuild i686-pc-linux-gnu-c
++
dbimp gnatcheck gnatmake gprbuild_debug i686-pc-linux-gnu-g
++
g++ gnatchop gnatmem gprclean i686-pc-linux-gnu-
gcc
gcc gnatclean gnatmetric gprclean_debug i686-pc-linux-gnu-
gcc-4.3.4
gccbug gnatelim gnatname gprconfig objdump
gcov gnatfind gnatpp gprconfig_debug


I added /usr/gnat/bin to the (Ubuntu 10.04) bashrc startup script of
the user 'ken' from which I want to use GPS. The echo command

echo $PATH
/usr/gnat/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/
bin:/usr/games

issued after login to 'ken' shows that /usr/gnat/bin is on the path.

gnatmake works from the command line for a small test program main.adb
in adatestproj directory:

ken(a)meijin-desktop:/home$ ls
ken kr lost+found meijin

ken(a)meijin-desktop:/home$ cd ken
ken(a)meijin-desktop:~$ ls
adatestproj Documents Music Videos...

ken(a)meijin-desktop:~$ cd adatestproj
ken(a)meijin-desktop:~/adatestproj$ ls
main.adb main.gpr
ken(a)meijin-desktop:~/adatestproj$ gnatmake main.adb
gcc -c main.adb
gnatbind -x main.ali
gnatlink main.ali


but from GPS 'Could not locate executable on path: gnatmake' appears
when I request compile file from adaptestproj directory.

I cannot see what is wrong. Would be grateful for advice.

From: Ludovic Brenta on
resander <kresander(a)yahoo.com> writes:
> I added /usr/gnat/bin to the (Ubuntu 10.04) bashrc startup script of
> the user 'ken' from which I want to use GPS. The echo command
>
> echo $PATH
> /usr/gnat/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/
> bin:/usr/games
>
> issued after login to 'ken' shows that /usr/gnat/bin is on the path.

[...]

> but from GPS 'Could not locate executable on path: gnatmake' appears
> when I request compile file from adaptestproj directory.
>
> I cannot see what is wrong. Would be grateful for advice.

The $PATH you set in ~/.bashrc is only valid for bash, i.e. only in the
terminal window you open. If you start GPS from a graphical menu, this
menu does not run in your shell therefore cannot see your changed $PATH,
so neither can GPS.

For GPS to see your $PATH, two conditions must be met:

* your ~/.bashrc exports PATH (not just sets it)
* you must start GPS from bash, i.e. from a command line.

Or, simply upgrade to Debian :)

HTH

--
Ludovic Brenta.
From: Dmitry A. Kazakov on
On Fri, 7 May 2010 01:33:49 -0700 (PDT), resander wrote:

> but from GPS 'Could not locate executable on path: gnatmake' appears
> when I request compile file from adaptestproj directory.
>
> I cannot see what is wrong. Would be grateful for advice.

When PATH is correct, check if the project file *.gpr specifies gnat tools.
E.g. stuff like

for Gnatlist use "i586-wrs-vxworks-gnatls";
for Gnat use "i586-wrs-vxworks-gnat";
for Compiler_Command ("ada") use "i586-wrs-vxworks-gnatmake";
for Debugger_Command use "i586-wrs-vxworks6-gdb";

(which would not work under Linux)

BTW, never edit project files using GPS GUI. Use gedit, vi, ... sed (:-))

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
From: Gautier write-only on
On 7 Mai, 11:49, Ludovic Brenta <ludo...(a)ludovic-brenta.org> wrote:
[...]
> Or, simply upgrade to Debian :)

I knew it! It had to happen!
From: Georg Bauhaus on
On 07.05.10 11:49, Ludovic Brenta wrote:

> For GPS to see your $PATH, two conditions must be met:
>
> * your ~/.bashrc exports PATH (not just sets it)
> * you must start GPS from bash, i.e. from a command line.
>
> Or, simply upgrade to Debian :)

This, or find the proper initialization file for your shell.
Or start gps from the command line that has the PATH set
for GNAT.
From the BASH manual,

"When bash is invoked as an interactive login shell, or as a
non-interactive shell with the --login option, it first reads and
executes commands from the file /etc/profile, if that file exists.
After reading that file, it
looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that
order, and reads and executes commands from the first one that
exists and is readable. The --noprofile option may be used when
the shell is started to inhibit this behavior."