From: zeta_no on
Hi to all,

With the distribution of GNAT GPL form Adacore Libre comes some code
examples like "ada_cpp" that presents mixed Ada/C++ projetcs. My
problem is the following: In GPS, for the project to build, we need
GPRBUILD which uses GCC and the -gnat05 option. Well, using GPRBUILD,
the ouput of a BUILD ALL tells me that GCC 4.4 installed by Ubuntu was
triggered, not GCC 4.3 coming with the GNAT distro. How do I tell GPS
and GPRBUILD to use the good GCC? The problem is on the Ubuntu side or
GPRBUILD?

We have to admit that my setup is ugly. I use GPS and GPRBUILD from
Adacore, but GNAT from Ubuntu. That's not all. I don't know why, but
by using GNAT from Ubuntu, the second example from ada_cpp,
animals.gpr, does not compile at all. I get the following error
mesage:

cannot import abstract subprogram "Number_Of_Teeth" declared at line
5.
cannot imp...

If someone could help me with my problem of GNAT versioning to resolve
the good use of GCC, I would really appreciate. Just to confirm, I
did exported /usr/gnat/bin into my PATH env. variable.

Thanks in advance,

Olivier Henley

From: Stephen Leake on
zeta_no <olivier_henley(a)hotmail.com> writes:

> With the distribution of GNAT GPL form Adacore Libre comes some code
> examples like "ada_cpp" that presents mixed Ada/C++ projetcs. My
> problem is the following: In GPS, for the project to build, we need
> GPRBUILD which uses GCC and the -gnat05 option. Well, using GPRBUILD,
> the ouput of a BUILD ALL tells me that GCC 4.4 installed by Ubuntu was
> triggered, not GCC 4.3 coming with the GNAT distro. How do I tell GPS
> and GPRBUILD to use the good GCC? The problem is on the Ubuntu side or
> GPRBUILD?

It's on your side; set PATH to include the correct gcc first. Or
uninstall gcc 4.4 from Ubuntu. Or install GPS and gprbuild from Ubuntu;
both are in Debian testing, I don't know if they are in Ubuntu yet. If
they are not in Ubuntu, upgrade to Debian.

Just out of curiosity; why are you using Ubuntu instead of Debian in the
first place?

What version of GNAT GPL are you using? Since it has the older compiler,
it is quite likely that there is a newer version.

> We have to admit that my setup is ugly. I use GPS and GPRBUILD from
> Adacore, but GNAT from Ubuntu.

That's what's causing the ugliness; when you install packages outside
the normal Unbuntu package manager, you have to expect problems like
this.

> That's not all. I don't know why, but by using GNAT from Ubuntu, the
> second example from ada_cpp, animals.gpr, does not compile at all. I
> get the following error mesage:
>
> cannot import abstract subprogram "Number_Of_Teeth" declared at line
> 5.
> cannot imp...

It is often the case that newer compilers implement language checks that
older compilers did not.

> If someone could help me with my problem of GNAT versioning to resolve
> the good use of GCC, I would really appreciate. Just to confirm, I
> did exported /usr/gnat/bin into my PATH env. variable.

Is GPS using that PATH? That depends on how you launch it.

--
-- Stephe
From: Ludovic Brenta on
Olivier Henley wrote on comp.lang.ada:
[...]
> We have to admit that my setup is ugly.  I use GPS and GPRBUILD from
> Adacore, but GNAT from Ubuntu.  That's not all.  I don't know why, but
> by using GNAT from Ubuntu, the second example from ada_cpp,
> animals.gpr, does not compile at all. I get the following error
> mesage:
[...]

I think that all your problems are because of this ugly setup of
yours. While I think it must be possible to use GPS with several
different versions of GNAT, I'm not going to investigate the details
of why you fail; rather, out of curiosity, I'd like to know why you
think you must mix the GNAT GPL Edition with the Ubuntu packages, i.e.
what problem are you trying to solve that neither GNAT GPL Edition nor
Ubuntu can solve alone?

--
Ludovic Brenta.
From: zeta_no on
On May 18, 3:53 am, Stephen Leake <stephen_le...(a)stephe-leake.org>
wrote:

> Just out of curiosity; why are you using Ubuntu instead of Debian in the
> first place?

Last time I tried Debian and Ubuntu around the same period, I found
Ubuntu much more polished that Debian. For everyday use, it is
welcomed. But I like your way of thinking... upgrade to Debian :).
Also, I didn't know that the support for Ada in Debian was better...
Correct me if I'm wrong.

> What version of GNAT GPL are you using? Since it has the older compiler,
> it is quite likely that there is a newer version.

From the Ubuntu install, my version is Gnat 4.4

> It is often the case that newer compilers implement language checks that
> older compilers did not.

Good to have a confirmation.

> Is GPS using that PATH? That depends on how you launch it.

I'll check for that.

Thanks for helping me out with these problems.

Olivier

From: zeta_no on
On May 18, 8:56 am, Ludovic Brenta <ludo...(a)ludovic-brenta.org> wrote:

> I think that all your problems are because of this ugly setup of
> yours. While I think it must be possible to use GPS with several
> different versions of GNAT, I'm not going to investigate the details
> of why you fail; rather, out of curiosity, I'd like to know why you
> think you must mix the GNAT GPL Edition with the Ubuntu packages, i.e.
> what problem are you trying to solve that neither GNAT GPL Edition nor
> Ubuntu can solve alone?

No, I don't think I must mix the GNAT GPL Edition and the Ubuntu
packages, I did it because it has been the only successful combination
capable of building the excepts.gpr project, an Ada_CPP project.

When you install GNAT, GPS and GPRbuild from Ubuntu, it looks to me
that when you load the except.gpr project, GPS by default, tries to
build with gnatmake, not GPRbuild. The GNAT/GPS version from Adacore
does build this project out of the box with GPRbuild. But now, GPS,
when it calls GCC, seems to use the system wide default GCC, in my
case, the 4.4 version installed by Ubuntu. My problem is therefore
twofold. First, I cannot strip my Ubuntu box from GCC 4.4 because
synaptic wants to uninstall many important things such as proprietary
video drivers. Second, I would like to use the GCC retrieved from
Adacore, but I just did not figured out how to tell GPS to use that
precise version. You have to realize that I am completely new to GPS
and Ada in general and therefore might fail to configure basic stuff.

To build and run a Ada_CPP project is of great importance to me
because as a participant to an engineering competition, I try to
convince my teammates that the use of Ada for the real time
programming issues would greatly help our cause. On the team we have
hardcore CPP fans and we will be using libraries such as OpenCV (C and
CPP version). Yesterday, I had to make a presentation to the team
showing the possibility of interfacing both language as a bare minimum
to carry on with the idea of using Ada on our project.

So here are all my motivations for making this project build with or
without an ugly setup. To go further, I'll accept nothing else than a
clean install :)

Thanks for your time and concern,

Olivier