comp.lang.ada
 help / color / mirror / Atom feed
* How to enable Ada with GCC in linux
@ 2012-07-25  9:06 Ada novice
  2012-07-25  9:41 ` Georg Bauhaus
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Ada novice @ 2012-07-25  9:06 UTC (permalink / raw)


I'm new to Linux and I have been able to run Ada programs under linux. On my machine, I found:

gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i486-linux-gnu/4.6/lto-wrapper
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.6.3-1' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc --enable-targets=all --with-arch-32=i586 --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.6.3 (Debian 4.6.3-1)

As we can see above, Ada is not enabled in the languages available in GCC. Yet, my gnatmake calls gcc well.

gnatmake --version
GNATMAKE GPL 2011 (20110419)
Copyright (C) 1995-2011, Free Software Foundation, Inc.

Should I leave things as they are since I am able to compile the Ada programs well?


Thanks 
YC



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

* Re: How to enable Ada with GCC in linux
  2012-07-25  9:06 How to enable Ada with GCC in linux Ada novice
@ 2012-07-25  9:41 ` Georg Bauhaus
  2012-07-25  9:51 ` Brian Drummond
  2012-07-25 10:32 ` Simon Wright
  2 siblings, 0 replies; 8+ messages in thread
From: Georg Bauhaus @ 2012-07-25  9:41 UTC (permalink / raw)


On 25.07.12 11:06, Ada novice wrote:
> I'm new to Linux and I have been able to run Ada programs under linux. On my machine, I found:
> 
> gcc -v

> gcc version 4.6.3 (Debian 4.6.3-1)
> 
> As we can see above, Ada is not enabled in the languages available in GCC. Yet, my gnatmake calls gcc well.
> 
> gnatmake --version
> GNATMAKE GPL 2011 (20110419)
> Copyright (C) 1995-2011, Free Software Foundation, Inc.
> 
> Should I leave things as they are since I am able to compile the Ada programs well?

Looks like gcc is /usr/bin/gcc and gnatmake is
/wherever/you/installed/GNATGPL/bin/gcc.
What is the value of your PATH variable?




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

* Re: How to enable Ada with GCC in linux
  2012-07-25  9:06 How to enable Ada with GCC in linux Ada novice
  2012-07-25  9:41 ` Georg Bauhaus
@ 2012-07-25  9:51 ` Brian Drummond
  2012-07-25 10:03   ` Nasser M. Abbasi
  2012-07-25 10:32 ` Simon Wright
  2 siblings, 1 reply; 8+ messages in thread
From: Brian Drummond @ 2012-07-25  9:51 UTC (permalink / raw)


On Wed, 25 Jul 2012 02:06:33 -0700, Ada novice wrote:

> I'm new to Linux and I have been able to run Ada programs under linux.
> On my machine, I found:
> 
> gcc -v Using built-in specs.
...
> --enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr
...
> version 4.6.3 (Debian 4.6.3-1)
> 
> As we can see above, Ada is not enabled in the languages available in
> GCC. Yet, my gnatmake calls gcc well.
> 
> gnatmake --version GNATMAKE GPL 2011 (20110419)
> Copyright (C) 1995-2011, Free Software Foundation, Inc.

Two different versions of gcc...

> Should I leave things as they are since I am able to compile the Ada
> programs well?

That depends...
If you are happy with GPL for everything you write at the moment, and 
Gnat GPL does what you want, then leave things as they are. (If it ain't 
broke, don't fix it!)

If you want the option of writing non-GPL code, get the FSF version of 
Gnat (with the GMGPL license, or GPL3 replagement). On debian, "apt-get 
install gnat" ought to do it.

If you have other problems (hitting obscure compiler bugs?) or want 
something not available in Gnat GPL (mixing Ada and Go code perhaps?) or 
something in FSF GCC that isn't in GPL yet) then get the FSF version.

You can have more than one gnat installed, and fiddle with paths to 
switch between them. (It can get confusing though.)

- Brian



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

* Re: How to enable Ada with GCC in linux
  2012-07-25  9:51 ` Brian Drummond
@ 2012-07-25 10:03   ` Nasser M. Abbasi
  0 siblings, 0 replies; 8+ messages in thread
From: Nasser M. Abbasi @ 2012-07-25 10:03 UTC (permalink / raw)


On 7/25/2012 4:51 AM, Brian Drummond wrote:

>
> You can have more than one gnat installed, and fiddle with paths to
> switch between them. (It can get confusing though.)
>

I have few VM's with different linuxes in them. For example, one I use
only for latest octave because it is not to date on the other distro I use
more. It was easier to just install the different distro which had the
up-to-date package for octave than build one (it is big). I have other
VM's for different things also. Some to try different things on.

So, one can easily have one VM for GNAT 2012, one VM for GNAT/gcc and
keep things separate.  They are all just different windows on the desktop.
No difference than having them on the same Linux or different ones.

I use shared files system between them all, and mount the FS from each,
so the data is all shared. I also have Dexpot virtual desktop on windows
and so I can have as many virtual desktops as I want, so I can move
the VM's around.

Memory is cheap, diskspace is cheap. Linux is free, VBox is free.
Run 10 different linuxes's on the same host. no problem. I think
I installed 30 different Linux disto's so far, lost count :)

ps. one can boot Vbox VM from the iso image directly. i.e. No need
to even burn the iso image to DVD first then boot from that.

--Nasser




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

* Re: How to enable Ada with GCC in linux
  2012-07-25  9:06 How to enable Ada with GCC in linux Ada novice
  2012-07-25  9:41 ` Georg Bauhaus
  2012-07-25  9:51 ` Brian Drummond
@ 2012-07-25 10:32 ` Simon Wright
  2012-07-25 11:25   ` Ada novice
  2012-07-25 11:58   ` Ada novice
  2 siblings, 2 replies; 8+ messages in thread
From: Simon Wright @ 2012-07-25 10:32 UTC (permalink / raw)


Ada novice <shai.lesh@gmx.com> writes:

> I'm new to Linux and I have been able to run Ada programs under
> linux. On my machine, I found:
>
> gcc -v
[...]
> gcc version 4.6.3 (Debian 4.6.3-1)
>
> As we can see above, Ada is not enabled in the languages available in
> GCC. Yet, my gnatmake calls gcc well.

This seems to be how Debian handles Ada.

> gnatmake --version
> GNATMAKE GPL 2011 (20110419)
> Copyright (C) 1995-2011, Free Software Foundation, Inc.

'gnatls -v' includes extra helpful information.

> Should I leave things as they are since I am able to compile the Ada
> programs well?

I would fix it. If you don't it will come back to bite you.

Please tell us the output of

   $ echo $PATH

and

   $ gnatgcc -v

(I would expect it to be the same as the output of gcc -v, since (here)
/usr/bin/gnatgcc is a symlink to /usr/bin/gcc-4.4).

The symptoms appear to indicate that you have GNAT GPL 2011's bin/
directory on your PATH *after* /usr/bin and that you don't have Debian's
Ada package installed. Things would be more consistent if you had GNAT
GPL 2011's bin/ directory first.

By the way, I think you said that you have GNAT GPL 2011 installed in
something like /usr/gnat/? It would be better to install it in
/usr/local/gnat-2011, for example, then you could install 2012 in a
parallel directory, and have a choice. Rather like it's done for
Windows. And then you can 'rm -rf /usr/local/gnat-2012' and remove all
trace of it.



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

* Re: How to enable Ada with GCC in linux
  2012-07-25 10:32 ` Simon Wright
@ 2012-07-25 11:25   ` Ada novice
  2012-07-25 11:58   ` Ada novice
  1 sibling, 0 replies; 8+ messages in thread
From: Ada novice @ 2012-07-25 11:25 UTC (permalink / raw)


Thanks all for your inputs. I will answer your queries for  $ echo $PATH, $ gnatls -v and  $ gnatgcc -v:

1. $ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/usr/gnat/bin

2. $ gnatls -v

GNATLS GPL 2011 (20110419)
Copyright (C) 1997-2011, Free Software Foundation, Inc.

Source Search Path:
   <Current_Directory>
   /usr/gnat/lib/gcc/i686-pc-linux-gnu/4.5.3/adainclude/


Object Search Path:
   <Current_Directory>
   /usr/gnat/lib/gcc/i686-pc-linux-gnu/4.5.3/adalib/


Project Search Path:
   <Current_Directory>
   /usr/gnat/i686-pc-linux-gnu/lib/gnat
   /usr/gnat/share/gpr
   /usr/gnat/lib/gnat

3. $ gnatgcc -v
The program 'gnatgcc' is currently not installed.  To run 'gnatgcc' please ask your administrator to install the package 'gnat'
gnatgcc: command not found



Yes I installed gnat in /usr/gnat. This was the default path in the "doinstall" script in the GNAT GPL 2011 installation. Anyway, if I now want to remove the GNAT GPL 2011 and put it in the right folder say /usr/local/gnat-2011 and subsequently have GNAT 2012 in /usr/local/gnat-2012, will a 

rm -rf/usr/gnat suffice?


Yes it would be wise to have a good installation rather than one which would require fixes later on.


Thanks,
YC






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

* Re: How to enable Ada with GCC in linux
  2012-07-25 10:32 ` Simon Wright
  2012-07-25 11:25   ` Ada novice
@ 2012-07-25 11:58   ` Ada novice
  2012-07-25 15:32     ` Ada novice
  1 sibling, 1 reply; 8+ messages in thread
From: Ada novice @ 2012-07-25 11:58 UTC (permalink / raw)


On Wednesday, July 25, 2012 12:32:41 PM UTC+2, Simon Wright wrote:
> The symptoms appear to indicate that you have GNAT GPL 2011&#39;s bin/
> directory on your PATH *after* /usr/bin and that you don&#39;t have Debian&#39;s
> Ada package installed. Things would be more consistent if you had GNAT
> GPL 2011&#39;s bin/ directory first.


Yes this is correct. I have /usr/gnat/bin at the end of the path. You mentioned that things would be more consistent.... Can you please elaborate on this?

I had installed the debian stable 4.4 and debian testing 4.6 before. With the debian 4.4, the lapack binding was not working as you saw in my other discussion. With gnat 4.6, GPS was loading with a small error message in the "message" window that there is something wrong with the tips menu that pop up at startup. So I removed debian gnat and went for the GPL version from AdaCore libre instead.

YC



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

* Re: How to enable Ada with GCC in linux
  2012-07-25 11:58   ` Ada novice
@ 2012-07-25 15:32     ` Ada novice
  0 siblings, 0 replies; 8+ messages in thread
From: Ada novice @ 2012-07-25 15:32 UTC (permalink / raw)


Ok, now I have removed my gnat in /usr/gnat and installed both gnat 2011 and 2012 in /usr/local/gnat-2011 and /usr/local/gnat-2012 respectively.

gcc -v now gives:

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/gnat-2012/bin/../libexec/gcc/i686-pc-linux-gnu/4.5.4/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../src/configure --prefix=/usr/gnat --with-libelf=/caen.a/gnatmail/gpl-2012/build-caen/x86-linux/libmpfr/install --with-mpc=/caen.a/gnatmail/gpl-2012/build-caen/x86-linux/libmpfr/install --with-gmp=/caen.a/gnatmail/gpl-2012/build-caen/x86-linux/libmpfr/install --with-mpfr=/caen.a/gnatmail/gpl-2012/build-caen/x86-linux/libmpfr/install --build=i686-pc-linux-gnu --enable-languages=c,ada,c++ --disable-nls --without-libiconv-prefix --disable-libmudflap --disable-libstdcxx-pch --disable-libada --enable-checking=release --enable-__cxa_atexit --enable-threads=posix --with-bugurl=URL:mailto:report@adacore.com --with-build-time-tools=/caen.a/gnatmail/gpl-2012/build-caen/x86-linux/gnat/obj
Thread model: posix
gcc version 4.5.4 20120510 for GNAT GPL 2012 (20120509) (GCC)

And my path is:
echo $PATH
/usr/local/gnat-2012/bin:/usr/local/gnat-2011/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games

I have given priority to gnat 2012.


Furthermore:

$ gnatls -v

GNATLS GPL 2012 (20120509)
Copyright (C) 1997-2012, Free Software Foundation, Inc.

Source Search Path:
   <Current_Directory>
   /usr/local/gnat-2012/lib/gcc/i686-pc-linux-gnu/4.5.4/adainclude/


Object Search Path:
   <Current_Directory>
   /usr/local/gnat-2012/lib/gcc/i686-pc-linux-gnu/4.5.4/adalib/


Project Search Path:
   <Current_Directory>
   /usr/local/gnat-2012/i686-pc-linux-gnu/lib/gnat
   /usr/local/gnat-2012/share/gpr
   /usr/local/gnat-2012/lib/gnat

and 

$ gnatgcc -v
The program 'gnatgcc' is currently not installed.  To run 'gnatgcc' please ask your administrator to install the package 'gnat'
gnatgcc: command not found



YC



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

end of thread, other threads:[~2012-07-26 14:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-25  9:06 How to enable Ada with GCC in linux Ada novice
2012-07-25  9:41 ` Georg Bauhaus
2012-07-25  9:51 ` Brian Drummond
2012-07-25 10:03   ` Nasser M. Abbasi
2012-07-25 10:32 ` Simon Wright
2012-07-25 11:25   ` Ada novice
2012-07-25 11:58   ` Ada novice
2012-07-25 15:32     ` Ada novice

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