comp.lang.ada
 help / color / mirror / Atom feed
* Error when running gcc from GPS
@ 2010-04-24 11:03 resander
  2010-04-24 11:15 ` Simon Wright
  0 siblings, 1 reply; 10+ messages in thread
From: resander @ 2010-04-24 11:03 UTC (permalink / raw)


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;





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Error when running gcc from GPS
  2010-04-24 11:03 Error when running gcc from GPS resander
@ 2010-04-24 11:15 ` Simon Wright
  2010-04-24 16:53   ` resander
  2010-04-25 12:42   ` Stephen Leake
  0 siblings, 2 replies; 10+ messages in thread
From: Simon Wright @ 2010-04-24 11:15 UTC (permalink / raw)


resander <kresander@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?)



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Error when running gcc from GPS
  2010-04-24 11:15 ` Simon Wright
@ 2010-04-24 16:53   ` resander
  2010-04-24 17:46     ` Ludovic Brenta
  2010-04-25 12:42   ` Stephen Leake
  1 sibling, 1 reply; 10+ messages in thread
From: resander @ 2010-04-24 16:53 UTC (permalink / raw)


On Apr 24, 12:15 pm, Simon Wright <si...@pushface.org> wrote:
> resander <kresan...@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.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Error when running gcc from GPS
  2010-04-24 16:53   ` resander
@ 2010-04-24 17:46     ` Ludovic Brenta
  2010-04-25 10:41       ` resander
  0 siblings, 1 reply; 10+ messages in thread
From: Ludovic Brenta @ 2010-04-24 17:46 UTC (permalink / raw)


resander <kresander@gmail.com> writes:
> On Apr 24, 12:15 pm, Simon Wright <si...@pushface.org> wrote:
>> resander <kresan...@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.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Error when running gcc from GPS
  2010-04-24 17:46     ` Ludovic Brenta
@ 2010-04-25 10:41       ` resander
  2010-04-25 17:12         ` Ludovic Brenta
  0 siblings, 1 reply; 10+ messages in thread
From: resander @ 2010-04-25 10:41 UTC (permalink / raw)


On Apr 24, 6:46 pm, Ludovic Brenta <ludo...@ludovic-brenta.org> wrote:
> resander <kresan...@gmail.com> writes:
> > On Apr 24, 12:15 pm, Simon Wright <si...@pushface.org> wrote:
> >> resander <kresan...@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?




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Error when running gcc from GPS
  2010-04-24 11:15 ` Simon Wright
  2010-04-24 16:53   ` resander
@ 2010-04-25 12:42   ` Stephen Leake
  2010-04-25 15:07     ` resander
  2010-04-25 15:22     ` Simon Wright
  1 sibling, 2 replies; 10+ messages in thread
From: Stephen Leake @ 2010-04-25 12:42 UTC (permalink / raw)


Simon Wright <simon@pushface.org> writes:

> resander <kresander@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

As resander discovered, this is not the right solution. There are other
executables and files that gprbuild needs, and it uses the path to the
invoked executable to find them.

You need to put
/home/ken/AdaGPL/gnat-2008-i686-gnu-linux-libc2.3-bin/bin in your PATH,
so gprbuild is invoked with the right path, and can find these other files.

The best way to do all of this is to use the Debian testing
distribution, as Ludovic says.

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Error when running gcc from GPS
  2010-04-25 12:42   ` Stephen Leake
@ 2010-04-25 15:07     ` resander
  2010-04-25 17:13       ` Ludovic Brenta
  2010-04-25 15:22     ` Simon Wright
  1 sibling, 1 reply; 10+ messages in thread
From: resander @ 2010-04-25 15:07 UTC (permalink / raw)


On Apr 25, 1:42 pm, Stephen Leake <stephen_le...@stephe-leake.org>
wrote:
> Simon Wright <si...@pushface.org> writes:
> > resander <kresan...@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
>
> As resander discovered, this is not the right solution. There are other
> executables and files that gprbuild needs, and it uses the path to the
> invoked executable to find them.
>
> You need to put
> /home/ken/AdaGPL/gnat-2008-i686-gnu-linux-libc2.3-bin/bin in your PATH,
> so gprbuild is invoked with the right path, and can find these other files.
>
> The best way to do all of this is to use the Debian testing
> distribution, as Ludovic says.
>
> --
> -- Stephe



Thanks Stephen,

I added to the PATH as you suggested, but it is still not working.

How do I get the Debian testing distribution onto my Ubuntu 8.04?




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Error when running gcc from GPS
  2010-04-25 12:42   ` Stephen Leake
  2010-04-25 15:07     ` resander
@ 2010-04-25 15:22     ` Simon Wright
  1 sibling, 0 replies; 10+ messages in thread
From: Simon Wright @ 2010-04-25 15:22 UTC (permalink / raw)


Stephen Leake <stephen_leake@stephe-leake.org> writes:

> You need to put
> /home/ken/AdaGPL/gnat-2008-i686-gnu-linux-libc2.3-bin/bin in your
> PATH, so gprbuild is invoked with the right path, and can find these
> other files.

This doesn't sound like the way it _should_ be installed. Something must
have gone wrong with OP's installation.

I have an 8.04 Ubuntu running in a VMWare Fusion VM, and it has GNAT GPL
2008 installed at /opt/gnat-gpl-2008 (I find it handy to keep several
compilers available), and the contents of the bin/ directory are

   addr2line cbrowser cpp dbimp gcc gccbug gcov gdb gnat gnatbind
   gnatcheck gnatchop gnatclean gnatelim gnatfind gnathtml.pl gnatkr
   gnatlink gnatls gnatmake gnatmem gnatmetric gnatname gnatpp gnatprep
   gnatstub gnatxref gprbuild gprbuild_debug gprclean gprclean_debug
   gprconfig gprconfig_debug gprmake gprof gps gps_exe
   i686-pc-linux-gnu-gcc i686-pc-linux-gnu-gcc-4.1.3 objdump

I'm a bit suspicious about the OP's file locations in
general. /home/ken/AdaGPL/gnat-2008-i686-gnu-linux-libc2.3-bin is the
place where the binary distribution would unpack to; whenever I've done
installs (which I do as root) it asks me where I want it to install
(default /usr/local, I think, but as I said above I don't use that) and
copies all the files it needs to to that location. You can delete the
distribution directory completely after the install.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Error when running gcc from GPS
  2010-04-25 10:41       ` resander
@ 2010-04-25 17:12         ` Ludovic Brenta
  0 siblings, 0 replies; 10+ messages in thread
From: Ludovic Brenta @ 2010-04-25 17:12 UTC (permalink / raw)


resander <kresander@gmail.com> writes:
> 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.

It seems you did not download all of GNAT GPL 2009, then.  You should
have gprbuild as part of it.

> GNAT GPL 2008 is available via the Ubuntu Synaptic Package Manager

No, it is not.

What you see in Synaptic are the Debian packages that I made; they are
not GNAT GPL but rather GNAT from the FSF.

> (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.

gprbuild is indeed not present in Ubuntu 8.10; it appeared in Debian
unstable in January 2010 and migrated to Debian testing on 2010-04-14.
I do not know what the Ubuntu maintainers plan but chances are that
gprbuild will be present in the next release of Ubuntu (presumably 10.04
or 10.10).

So what you end up with is a partial install of GNAT GPL 2009 in
/usr/gnat, lacking gprbuild, and an installation of a few Debian
packages in /usr/bin; you should double-check your $PATH to make sure
which version of the IDE (GPS) and compiler (gcc) you use.

> How do I install GNAT GPL 2009 on Ubuntu?

I think you only need to add gprbuild to your machine, now.  It is
available from libre.adacore.com and from Debian testing, but not from
Ubuntu 8.10.

-- 
Ludovic Brenta.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Error when running gcc from GPS
  2010-04-25 15:07     ` resander
@ 2010-04-25 17:13       ` Ludovic Brenta
  0 siblings, 0 replies; 10+ messages in thread
From: Ludovic Brenta @ 2010-04-25 17:13 UTC (permalink / raw)


resander <kresander@gmail.com> writes:
> How do I get the Debian testing distribution onto my Ubuntu 8.04?

Someone else asked the same question on this newsgroup a couple of
months ago; I saved my answer for future reference here:

http://lists.debian.org/debian-ada/2010/02/msg00003.html

HTH

-- 
Ludovic Brenta.



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-04-25 17:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-24 11:03 Error when running gcc from GPS resander
2010-04-24 11:15 ` Simon Wright
2010-04-24 16:53   ` resander
2010-04-24 17:46     ` Ludovic Brenta
2010-04-25 10:41       ` resander
2010-04-25 17:12         ` Ludovic Brenta
2010-04-25 12:42   ` Stephen Leake
2010-04-25 15:07     ` resander
2010-04-25 17:13       ` Ludovic Brenta
2010-04-25 15:22     ` Simon Wright

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox