comp.lang.ada
 help / color / mirror / Atom feed
* gprbuild not working on GNAT 2015 GPL for raspberry pi cross compile
@ 2015-07-11 18:13 Brad Moore
  2015-07-11 19:04 ` Simon Wright
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Brad Moore @ 2015-07-11 18:13 UTC (permalink / raw)


I am trying to get gprbuild to work for the GNAT 2015 GPL  Raspberry Pi 2 Linux (32 bits) release.

When I try to build one of my project files, I get the error,

"warning: no compiler specified for language "Ada", ignoring all its sources"

I can build most of my projects with

arm-linux-gnueabihf-gnatmake instead of gprbuild.

However, some of my projects involve multi-language support, which fails to build.
I suspect that if I could get gprbuild to work, then I would be able to build these projects.

I have googled and found others with similar problems on other GNAT releases, but have not seen any real fixes.

Has anyone had any luck using gprbuild for this release.

I think I could possibly get things to work by defining the GNAT compiler from scratch
in the gprbuild knowledgebase files, but surely one shouldn't need to do that if the compiler
is GNAT. One would think the base install would have set things up for compiling Ada.

So I suspect, there is a quick and easy fix.

Anyone know what that might be?
Has anyone managed to get gprbuild to work with the 2015 Raspberry Pi GPL release of GNAT?

gprbuild does work fine with the x86 build of the x86 2015 GPL release.

One thing I note, is that when I use the -v flag on the gprbuild command line,
I see  --target=x86-linux

I would have thought the target show as --target=arm-linux-gnueabihf

Yet, the only compilers in my PATH are the Raspberry GNAT cross compiler,
and the FSF x86 compiler for the 4.9 release.  The Raspberry GPL compiler appears first in the PATH.

However, if I run
/usr/gnat/bin/gprconfig --show-targets

I only get the following output;

List of targets supported by a compiler:
x86_64-linux-gnu

It appears that gprbuild and gprconfig are unable to find the install of the raspberry Pi cross compiler.


Regards,
Brad Moore

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

* Re: gprbuild not working on GNAT 2015 GPL for raspberry pi cross compile
  2015-07-11 18:13 gprbuild not working on GNAT 2015 GPL for raspberry pi cross compile Brad Moore
@ 2015-07-11 19:04 ` Simon Wright
  2015-07-12  4:40 ` Stephen Leake
  2018-06-16 10:28 ` jeanbaptistesmn
  2 siblings, 0 replies; 8+ messages in thread
From: Simon Wright @ 2015-07-11 19:04 UTC (permalink / raw)


Brad Moore <brad.moore@shaw.ca> writes:

> I would have thought the target show as --target=arm-linux-gnueabihf

Perhaps you need to say

   gprbuild --target=arm-linux-gnueabihf

I think that gprconfig checks whether a compiler is available using
{target-}gnatls -v, does that work?


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

* Re: gprbuild not working on GNAT 2015 GPL for raspberry pi cross compile
  2015-07-11 18:13 gprbuild not working on GNAT 2015 GPL for raspberry pi cross compile Brad Moore
  2015-07-11 19:04 ` Simon Wright
@ 2015-07-12  4:40 ` Stephen Leake
  2015-07-12  5:56   ` Simon Wright
  2018-06-16 10:28 ` jeanbaptistesmn
  2 siblings, 1 reply; 8+ messages in thread
From: Stephen Leake @ 2015-07-12  4:40 UTC (permalink / raw)


Brad Moore <brad.moore@shaw.ca> writes:

> I am trying to get gprbuild to work for the GNAT 2015 GPL Raspberry Pi
> 2 Linux (32 bits) release.
>
> When I try to build one of my project files, I get the error,
>
> "warning: no compiler specified for language "Ada", ignoring all its
> sources"

Run gprconfig -v

and see what it says about what compilers are available. Then specify
one of those as the target for the gprbuild.

-- 
-- Stephe


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

* Re: gprbuild not working on GNAT 2015 GPL for raspberry pi cross compile
  2015-07-12  4:40 ` Stephen Leake
@ 2015-07-12  5:56   ` Simon Wright
  2015-07-12 20:32     ` Brad Moore
  0 siblings, 1 reply; 8+ messages in thread
From: Simon Wright @ 2015-07-12  5:56 UTC (permalink / raw)


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

> Brad Moore <brad.moore@shaw.ca> writes:
>
>> I am trying to get gprbuild to work for the GNAT 2015 GPL Raspberry Pi
>> 2 Linux (32 bits) release.
>>
>> When I try to build one of my project files, I get the error,
>>
>> "warning: no compiler specified for language "Ada", ignoring all its
>> sources"
>
> Run gprconfig -v
>
> and see what it says about what compilers are available. Then specify
> one of those as the target for the gprbuild.

Actually,

   gprconfig -v --target=<your target>

or

   gprconfig -v --target=all

Gprconfig looks for a compiler and a runtime. If it finds {target}-gcc
it runs -dumpmachine to find the version, then looks for runtimes in (at
least) lib/gcc/{target}/{version}; first in adalib/, then via
ada_object_path, then via rts-*/.


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

* Re: gprbuild not working on GNAT 2015 GPL for raspberry pi cross compile
  2015-07-12  5:56   ` Simon Wright
@ 2015-07-12 20:32     ` Brad Moore
  2017-08-28 17:22       ` paherbst
  0 siblings, 1 reply; 8+ messages in thread
From: Brad Moore @ 2015-07-12 20:32 UTC (permalink / raw)


On 2015-07-11 11:56 PM, Simon Wright wrote:
> Stephen Leake <stephen_leake@stephe-leake.org> writes:
>
>> Brad Moore <brad.moore@shaw.ca> writes:
>>
>>> I am trying to get gprbuild to work for the GNAT 2015 GPL Raspberry Pi
>>> 2 Linux (32 bits) release.
>>>
>>> When I try to build one of my project files, I get the error,
>>>
>>> "warning: no compiler specified for language "Ada", ignoring all its
>>> sources"
>>
>> Run gprconfig -v
>>
>> and see what it says about what compilers are available. Then specify
>> one of those as the target for the gprbuild.
>
> Actually,
>
>     gprconfig -v --target=<your target>
>
> or
>
>     gprconfig -v --target=all
>
> Gprconfig looks for a compiler and a runtime. If it finds {target}-gcc
> it runs -dumpmachine to find the version, then looks for runtimes in (at
> least) lib/gcc/{target}/{version}; first in adalib/, then via
> ada_object_path, then via rts-*/.
>

Thanks Stephen and Simon for the suggestions,

Executing the above commands pointed out that I hadn't set the ENV_PREFIX variable correctly,
which was why my compiler install was not being detected.
 From this I was eventually able to get things to compile and execute using gprbuild.

There were a few other things I had to setup as well, for example, the run-time had to be
explicitly linked in via the project file directives for Raspian, but for the x86 builds, this wasn't necessary.
(This was only needed for an executable for which the main was written in C, calling Ada, otherwise
the project files involving pure Ada code did not require any modifications)

Cheers,

Brad

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

* Re: gprbuild not working on GNAT 2015 GPL for raspberry pi cross compile
  2015-07-12 20:32     ` Brad Moore
@ 2017-08-28 17:22       ` paherbst
  0 siblings, 0 replies; 8+ messages in thread
From: paherbst @ 2017-08-28 17:22 UTC (permalink / raw)


On Sunday, July 12, 2015 at 4:32:32 PM UTC-4, Brad Moore wrote:
> On 2015-07-11 11:56 PM, Simon Wright wrote:
> > Stephen Leake <stephen_leake@stephe-leake.org> writes:
> >
> >> Brad Moore <brad.moore@shaw.ca> writes:
> >>
> >>> I am trying to get gprbuild to work for the GNAT 2015 GPL Raspberry Pi
> >>> 2 Linux (32 bits) release.
> >>>
> >>> When I try to build one of my project files, I get the error,
> >>>
> >>> "warning: no compiler specified for language "Ada", ignoring all its
> >>> sources"
> >>
> >> Run gprconfig -v
> >>
> >> and see what it says about what compilers are available. Then specify
> >> one of those as the target for the gprbuild.
> >
> > Actually,
> >
> >     gprconfig -v --target=<your target>
> >
> > or
> >
> >     gprconfig -v --target=all
> >
> > Gprconfig looks for a compiler and a runtime. If it finds {target}-gcc
> > it runs -dumpmachine to find the version, then looks for runtimes in (at
> > least) lib/gcc/{target}/{version}; first in adalib/, then via
> > ada_object_path, then via rts-*/.
> >
> 
> Thanks Stephen and Simon for the suggestions,
> 
> Executing the above commands pointed out that I hadn't set the ENV_PREFIX variable correctly,
> which was why my compiler install was not being detected.
>  From this I was eventually able to get things to compile and execute using gprbuild.
> 
> There were a few other things I had to setup as well, for example, the run-time had to be
> explicitly linked in via the project file directives for Raspian, but for the x86 builds, this wasn't necessary.
> (This was only needed for an executable for which the main was written in C, calling Ada, otherwise
> the project files involving pure Ada code did not require any modifications)
> 
> Cheers,
> 
> Brad

Brad, what exactly did you have to do to fix this?

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

* Re: gprbuild not working on GNAT 2015 GPL for raspberry pi cross compile
  2015-07-11 18:13 gprbuild not working on GNAT 2015 GPL for raspberry pi cross compile Brad Moore
  2015-07-11 19:04 ` Simon Wright
  2015-07-12  4:40 ` Stephen Leake
@ 2018-06-16 10:28 ` jeanbaptistesmn
  2018-06-21 16:27   ` Simon Wright
  2 siblings, 1 reply; 8+ messages in thread
From: jeanbaptistesmn @ 2018-06-16 10:28 UTC (permalink / raw)


Le samedi 11 juillet 2015 20:13:09 UTC+2, Brad Moore a écrit :
> I am trying to get gprbuild to work for the GNAT 2015 GPL  Raspberry Pi 2 Linux (32 bits) release.
> 
> When I try to build one of my project files, I get the error,
> 
> "warning: no compiler specified for language "Ada", ignoring all its sources"
> 
> I can build most of my projects with
> 
> arm-linux-gnueabihf-gnatmake instead of gprbuild.
> 
> However, some of my projects involve multi-language support, which fails to build.
> I suspect that if I could get gprbuild to work, then I would be able to build these projects.
> 
> I have googled and found others with similar problems on other GNAT releases, but have not seen any real fixes.
> 
> Has anyone had any luck using gprbuild for this release.
> 
> I think I could possibly get things to work by defining the GNAT compiler from scratch
> in the gprbuild knowledgebase files, but surely one shouldn't need to do that if the compiler
> is GNAT. One would think the base install would have set things up for compiling Ada.
> 
> So I suspect, there is a quick and easy fix.
> 
> Anyone know what that might be?
> Has anyone managed to get gprbuild to work with the 2015 Raspberry Pi GPL release of GNAT?
> 
> gprbuild does work fine with the x86 build of the x86 2015 GPL release.
> 
> One thing I note, is that when I use the -v flag on the gprbuild command line,
> I see  --target=x86-linux
> 
> I would have thought the target show as --target=arm-linux-gnueabihf
> 
> Yet, the only compilers in my PATH are the Raspberry GNAT cross compiler,
> and the FSF x86 compiler for the 4.9 release.  The Raspberry GPL compiler appears first in the PATH.
> 
> However, if I run
> /usr/gnat/bin/gprconfig --show-targets
> 
> I only get the following output;
> 
> List of targets supported by a compiler:
> x86_64-linux-gnu
> 
> It appears that gprbuild and gprconfig are unable to find the install of the raspberry Pi cross compiler.
> 
> 
> Regards,
> Brad Moore

Hello,

i have the problem too but i don't resolve it.
I think the ENV_PREFIX variable is correctly set :

$ echo $ENV_PREFIX
/usr/gnat/arm-linux-gnueabihf/sysroot

sysroot directory was generated

and :

$ gprconfig -show-targets
Lists of targets supported by a compilater:
arm-linux-gnueabihf
x86_64-linux-gnu
arm-linux-gnueabihf

but when i do :
$ gprbuild --target=arm-linux-gnueabihf -P myProject.gpr
"warning: no compiler specified for language "Ada", ignoring all its sources" 
"main.adb" is not a source of project "myProject"

Simon, i'm not sure i understand your answer :

>Gprconfig looks for a compiler and a runtime. If it finds {target}-gcc 
>it runs -dumpmachine to find the version, then looks for runtimes in (at 
>least) lib/gcc/{target}/{version}; first in adalib/, then via 
>ada_object_path, then via rts-*/. 

what's wrong whith my environment ?

Jean-Baptiste

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

* Re: gprbuild not working on GNAT 2015 GPL for raspberry pi cross compile
  2018-06-16 10:28 ` jeanbaptistesmn
@ 2018-06-21 16:27   ` Simon Wright
  0 siblings, 0 replies; 8+ messages in thread
From: Simon Wright @ 2018-06-21 16:27 UTC (permalink / raw)


jeanbaptistesmn@gmail.com writes:

> I think the ENV_PREFIX variable is correctly set :
>
> $ echo $ENV_PREFIX
> /usr/gnat/arm-linux-gnueabihf/sysroot

looks OK

> sysroot directory was generated
>
> and :
>
> $ gprconfig -show-targets
> Lists of targets supported by a compilater:
> arm-linux-gnueabihf
> x86_64-linux-gnu
> arm-linux-gnueabihf

I wonder which gprconfig you're running?

Can you try

$ arm-linux-gnueabihf-gnatls -v

If it says something like "file not found", you're running a 64-bit
Linux; the arm-linux-gnueabihf cross-compiler is built as a 32-bit
executable; and you need the 32-bit system runtime support to be
installed.

On debian jessie I did this, YMMV:

$ sudo dpkg --add-architecture i386
$ sudo apt-get update
$ sudo apt-get upgrade

and then I got a bit lost with what exactly to install, so used
Synaptics to install libstdc++6:i386.

> but when i do :
> $ gprbuild --target=arm-linux-gnueabihf -P myProject.gpr
> "warning: no compiler specified for language "Ada", ignoring all its sources" 
> "main.adb" is not a source of project "myProject"
>
> Simon, i'm not sure i understand your answer :
>
>>Gprconfig looks for a compiler and a runtime. If it finds {target}-gcc
>>it runs -dumpmachine to find the version, then looks for runtimes in
>>(at least) lib/gcc/{target}/{version}; first in adalib/, then via
>>ada_object_path, then via rts-*/.

If when gprconfig finds {target}-gcc and tries to run it with
-dumpmachine and it fails to run, then gprconfig won't consider it as a
candidate compiler.


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

end of thread, other threads:[~2018-06-21 16:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-11 18:13 gprbuild not working on GNAT 2015 GPL for raspberry pi cross compile Brad Moore
2015-07-11 19:04 ` Simon Wright
2015-07-12  4:40 ` Stephen Leake
2015-07-12  5:56   ` Simon Wright
2015-07-12 20:32     ` Brad Moore
2017-08-28 17:22       ` paherbst
2018-06-16 10:28 ` jeanbaptistesmn
2018-06-21 16:27   ` Simon Wright

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