From: resander on
Using GPS GPL Edition.
GPS 4.2.1 (20080115) hosted on i686-pc-linux-gnu
GNAT 4.3.2

I have only just started using GPS.

I created a directory Adaproj in the home directory
and requested the default project to be put there.
It now contains the files main.adb, test.c
and default.gpr.

The file main.adb compiles, links and runs
without problems. It is a small self-contained test
program. The second file test.c does not
compile and the following error message appears:

'Could not locate executable on path: gprbuild'

I have ticked the checkbox for language C in the
Languages tab in 'Edit Project Properties on the
Project menu.

I am guessing that 'executable' refers to gcc.
I did a search on gcc and found these:

/usr/bin/gcc -- linked to
/usr/bin/gcc-4.3

/usr/bin/gnatgcc -- linked to
/usr/bin/gcc-4.3

/home/ken/AdaGPL/gnat-2008-i686-gnu-linux-libc2.3-bin/bin/gcc

I also searched on gprbuild and found it is available in

/home/ken/AdaGPL/gnat-2008-i686-gnu-linux-libc2.3-bin/bin


How do I make GPS compile C files?

P.S.
default.gpr in Adaproj contains:
project Default is

type Mode_Type is
("Production", "Debug");
Mode : Mode_Type := external ("BUILD", "Debug");

package Ide is
for Vcs_Kind use "CVS";
end Ide;

package Compiler is

case Mode is

when "Debug" =>
for Default_Switches ("ada") use ("-g", "-gnato", "-fstack-
check", "-gnatVa");

when "Production" =>
for Default_Switches ("ada") use ("-gnatp", "-O2");
end case;
end Compiler;

case Mode is

when "Debug" =>
for Languages use ("Ada", "C");

when "Production" =>

end case;

end Default;


From: Simon Wright on
resander <kresander(a)gmail.com> writes:

> 'Could not locate executable on path: gprbuild'
>
> I have ticked the checkbox for language C in the
> Languages tab in 'Edit Project Properties on the
> Project menu.
>
> I am guessing that 'executable' refers to gcc.

No, it refers to gprbuild!

> I did a search on gcc and found these:
>
> /usr/bin/gcc -- linked to
> /usr/bin/gcc-4.3
>
> /usr/bin/gnatgcc -- linked to
> /usr/bin/gcc-4.3
>
> /home/ken/AdaGPL/gnat-2008-i686-gnu-linux-libc2.3-bin/bin/gcc
>
> I also searched on gprbuild and found it is available in
>
> /home/ken/AdaGPL/gnat-2008-i686-gnu-linux-libc2.3-bin/bin
>
> How do I make GPS compile C files?

Make a link to it,

$ sudo ln -s \
/home/ken/AdaGPL/gnat-2008-i686-gnu-linux-libc2.3-bin/bin/gprbuild \
/usr/bin

(there may well be a more appropriate way, inclusing perhaps using GNAT
GPL 2009?)
From: resander on
On Apr 24, 12:15 pm, Simon Wright <si...(a)pushface.org> wrote:
> resander <kresan...(a)gmail.com> writes:
> > 'Could not locate executable on path: gprbuild'
>
> > I have ticked the checkbox for language C in the
> > Languages tab in 'Edit Project Properties on the
> > Project menu.
>
> > I am guessing that 'executable' refers to gcc.
>
> No, it refers to gprbuild!
>
> > I did a search on gcc and found these:
>
> >   /usr/bin/gcc    -- linked to
> >   /usr/bin/gcc-4.3
>
> >   /usr/bin/gnatgcc    -- linked to
> >   /usr/bin/gcc-4.3
>
> >   /home/ken/AdaGPL/gnat-2008-i686-gnu-linux-libc2.3-bin/bin/gcc
>
> > I also searched on gprbuild and found it is available in
>
> >  /home/ken/AdaGPL/gnat-2008-i686-gnu-linux-libc2.3-bin/bin
>
> > How do I make GPS compile C files?
>
> Make a link to it,
>
> $ sudo ln -s \
>  /home/ken/AdaGPL/gnat-2008-i686-gnu-linux-libc2.3-bin/bin/gprbuild \
>  /usr/bin
>
> (there may well be a more appropriate way, inclusing perhaps using GNAT
> GPL 2009?)




Many thanks Simon.

Setting the link to gprbuild as you suggested made the C compile
proceed a bit further, but it then stumbled on gprconfig. I made a
link to that too in a similar way. This did not solve the problem, it
immediately stopped with a message about
/usr/share/gprconfig (don't remember the exact words).

I then installed GNAT GPL 2009 and now both Ada and C compilations
fail.
I specified the install base directory as /usr/gnat as suggested in
the install Readme file.

Have the logs this time:

gprbuild -ws -c -u -P/home/ken/Adaproj/default.gpr -XBUILD=Debug
main.adb
creating auto.cgpr
Directory not found: /usr/share/gprconfig
No valid configuration found
Generation of configuration files failed
gprbuild: could not create /home/ken/Adaproj/auto.cgpr

[2010-04-24 17:22:40] process exited with status 4 (elapsed time:
00.11s)


gprbuild -ws -c -u -P/home/ken/Adaproj/default.gpr -XBUILD=Debug
guidb.c
creating auto.cgpr
Directory not found: /usr/share/gprconfig
No valid configuration found
Generation of configuration files failed
gprbuild: could not create /home/ken/Adaproj/auto.cgpr

[2010-04-24 17:20:14] process exited with status 4 (elapsed time:
00.11s)


I don't know how to interpret and fix this.
From: Ludovic Brenta on
resander <kresander(a)gmail.com> writes:
> On Apr 24, 12:15 pm, Simon Wright <si...(a)pushface.org> wrote:
>> resander <kresan...(a)gmail.com> writes:
>> > 'Could not locate executable on path: gprbuild'
>>
>> > I have ticked the checkbox for language C in the
>> > Languages tab in 'Edit Project Properties on the
>> > Project menu.
>>
>> > I am guessing that 'executable' refers to gcc.
>>
>> No, it refers to gprbuild!
>>
>> > I did a search on gcc and found these:
>>
>> >   /usr/bin/gcc    -- linked to
>> >   /usr/bin/gcc-4.3
>>
>> >   /usr/bin/gnatgcc    -- linked to
>> >   /usr/bin/gcc-4.3

(Caution: shameless plug ahead)

These seem to be the executables installed by the Debian packages. Are
you using Debian or a derivative thereof?

Your problems seem to be a bad installation of GNAT GPL; I suggest you
either re-install GNAT GPL properly, i.e. following the installation
instructions _to the letter_, or upgrade to Debian GNU/Linux "testing"
(soon to be released as 6.0 "Squeeze"). Thanks to Stephen Leake, Debian
now includes gprbuild and installs it properly. All your problems would
go away if you installed the following packages:

gnat
gnat-gps
gprbuild

You can do this with "aptitude install gnat gnat-gps gprbuild".

(The entire purpose of a binary distribution like Debian is to ease the
burden of installing and configuring software, so you don't have to
troubleshoot such problems and can concentrate on your programming
instead).

--
Ludovic Brenta.
From: resander on
On Apr 24, 6:46 pm, Ludovic Brenta <ludo...(a)ludovic-brenta.org> wrote:
> resander <kresan...(a)gmail.com> writes:
> > On Apr 24, 12:15 pm, Simon Wright <si...(a)pushface.org> wrote:
> >> resander <kresan...(a)gmail.com> writes:
> >> > 'Could not locate executable on path: gprbuild'
>
> >> > I have ticked the checkbox for language C in the
> >> > Languages tab in 'Edit Project Properties on the
> >> > Project menu.
>
> >> > I am guessing that 'executable' refers to gcc.
>
> >> No, it refers to gprbuild!
>
> >> > I did a search on gcc and found these:
>
> >> >   /usr/bin/gcc    -- linked to
> >> >   /usr/bin/gcc-4.3
>
> >> >   /usr/bin/gnatgcc    -- linked to
> >> >   /usr/bin/gcc-4.3
>
> (Caution: shameless plug ahead)
>
> These seem to be the executables installed by the Debian packages.  Are
> you using Debian or a derivative thereof?
>
> Your problems seem to be a bad installation of GNAT GPL; I suggest you
> either re-install GNAT GPL properly, i.e. following the installation
> instructions _to the letter_, or upgrade to Debian GNU/Linux "testing"
> (soon to be released as 6.0 "Squeeze").  Thanks to Stephen Leake, Debian
> now includes gprbuild and installs it properly.  All your problems would
> go away if you installed the following packages:
>
> gnat
> gnat-gps
> gprbuild
>
> You can do this with "aptitude install gnat gnat-gps gprbuild".
>
> (The entire purpose of a binary distribution like Debian is to ease the
> burden of installing and configuring software, so you don't have to
> troubleshoot such problems and can concentrate on your programming
> instead).
>
> --
> Ludovic Brenta.



I am on Ubuntu 8.10 and have not used any other Linux.

I agree this is an installation problem, but I still don't know how to
fix it.

I downloaded GNAT GPL 2009 from Libre. I unpacked using the GUI
decompress program available from the Ubuntu menu and it ended up in
directory /home/ken/Desktop/gnat-2009-i686-gnu-linux-libc2.3-bin. I
used the doinstall script in this directory and gave the install base
direcory as /usr/gnat as suggested. Installation ran to completion
without errors and I added /usr/gnat/bin to the $PATH as the doinstall
script prompted me to do.

Result: I could enter the new GPS program, but it failed compiling Ada
and C with errors shown in my previous post.

I guess this has something to do with grpbuild. There is a gprbuild in
the old GNAT GPL 2008 install directory, but there are no gpr-related
files in the new install directory at /usr/gnat.

GNAT GPL 2008 is available via the Ubuntu Synaptic Package Manager (a
GUI front end for the commandline package manager) I used Synaptic. No
luck, still the same. I tried the commandline too by sudo aptitude
install gnat gnat-gps gprbuild and got message 'Couldn't find any
package whose name or description matched "gprbuild', so gprbuild is
not available via the repository used by ubuntu.

How do I install GNAT GPL 2009 on Ubuntu?