comp.lang.ada
 help / color / mirror / Atom feed
* Configurable Run Time without GPR Tools
@ 2019-11-05  5:47 Daniel Way
  2019-11-05  8:28 ` Dmitry A. Kazakov
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Way @ 2019-11-05  5:47 UTC (permalink / raw)


I'm trying to write a motor control application running on an ARM Cortex-M0+. I've installed GNAT CE 2019 targeting arm-eabi and I can compile various test programs using the -I switch to specify a system.ads file.

To create an executable, I believe I will need an installed run time, but I find the way these are handled in GNAT to be confusing. I'd like to package all library sources in a project subfolder to make sharing everything easier, however, the deeply nested library structure that comes with GNAT is overwhelming.

- I'd like to know how others prefer to package the library with application code

- are the GPR tools absolutely necessary for building a run time, or is there another way to compile standard library packages?

Thank you,

Daniel Way

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

* Re: Configurable Run Time without GPR Tools
  2019-11-05  5:47 Configurable Run Time without GPR Tools Daniel Way
@ 2019-11-05  8:28 ` Dmitry A. Kazakov
  2019-11-05  8:43   ` Daniel Way
  2019-11-05  9:18   ` Simon Wright
  0 siblings, 2 replies; 7+ messages in thread
From: Dmitry A. Kazakov @ 2019-11-05  8:28 UTC (permalink / raw)


On 2019-11-05 06:47, Daniel Way wrote:
> I'm trying to write a motor control application running on an ARM Cortex-M0+. I've installed GNAT CE 2019 targeting arm-eabi and I can compile various test programs using the -I switch to specify a system.ads file.
> 
> To create an executable, I believe I will need an installed run time, but I find the way these are handled in GNAT to be confusing. I'd like to package all library sources in a project subfolder to make sharing everything easier, however, the deeply nested library structure that comes with GNAT is overwhelming.

Why? You need not to care about these libraries.

> - I'd like to know how others prefer to package the library with application code

Your third-party libraries you can place anywhere. It is not a good idea 
to mix them with the libraries that come with the cross-compiler tool 
chain. In out project we keep and maintain them separate, because the 
former come updated with the compiler wavefronts and the latter with our 
tinkering on the target. These are two completely independent cycles.

> - are the GPR tools absolutely necessary for building a run time, or is there another way to compile standard library packages?

They are not necessary. You can use gnatmake or even just gcc and 
gnatbind etc. Yet gprbuild saves a huge amount of time and work, 
especially for large projects. It is also quite powerful and safe when 
it comes to multiple targets within same project. It really pays off to 
learn it a bit.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

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

* Re: Configurable Run Time without GPR Tools
  2019-11-05  8:28 ` Dmitry A. Kazakov
@ 2019-11-05  8:43   ` Daniel Way
  2019-11-05  8:59     ` Dmitry A. Kazakov
                       ` (2 more replies)
  2019-11-05  9:18   ` Simon Wright
  1 sibling, 3 replies; 7+ messages in thread
From: Daniel Way @ 2019-11-05  8:43 UTC (permalink / raw)


Thank you, Dmitry.

My questions are specifically related to the standard library (ZFP right now, but possibly Ravenscar in the future); I’m not concerned with third-party libraries yet.

Since I need to port a run time for my target hardware and I want to share this project via GitHub, I want all the run time files grouped. I guess I can make it work if I become more familiar with the tools.

Cheers,
Daniel

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

* Re: Configurable Run Time without GPR Tools
  2019-11-05  8:43   ` Daniel Way
@ 2019-11-05  8:59     ` Dmitry A. Kazakov
  2019-11-05  9:14     ` Simon Wright
  2019-11-05 15:15     ` Shark8
  2 siblings, 0 replies; 7+ messages in thread
From: Dmitry A. Kazakov @ 2019-11-05  8:59 UTC (permalink / raw)


On 2019-11-05 09:43, Daniel Way wrote:

> Since I need to port a run time for my target hardware and I want to share this project via GitHub, I want all the run time files grouped. I guess I can make it work if I become more familiar with the tools.

I don't know GitHub well enough, but assuming GitHub were designed in a 
reasonable way, then your GitHub project would contain no such thing as 
libraries from a tool chain. It would rather /depend/ on another GitHub 
project: GNAT cross-compiler for the target XYZ version N.M. Pulling out 
your project would recursively pull all projects it depends on, just 
like Linux repositories work. Cut'n'paste approach is never good idea, 
repository or not.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


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

* Re: Configurable Run Time without GPR Tools
  2019-11-05  8:43   ` Daniel Way
  2019-11-05  8:59     ` Dmitry A. Kazakov
@ 2019-11-05  9:14     ` Simon Wright
  2019-11-05 15:15     ` Shark8
  2 siblings, 0 replies; 7+ messages in thread
From: Simon Wright @ 2019-11-05  9:14 UTC (permalink / raw)


Daniel Way <p.waydan@gmail.com> writes:

> Since I need to port a run time for my target hardware and I want to
> share this project via GitHub, I want all the run time files
> grouped. 

If you look at [1], you'll see I used

  common/            for shared non-math source
  common/math/       for shared math source
  {mcu}/adainclude/  for MCU-specific source

and I could quite well have put the shared math source in common/ too.

I do agree that the AdaCore source is spread out a bit; but if you work
from one of the distributed RTSs you should find the source in either
gnat/ or gnarl/.

[1] https://github.com/simonjwright/cortex-gnat-rts

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

* Re: Configurable Run Time without GPR Tools
  2019-11-05  8:28 ` Dmitry A. Kazakov
  2019-11-05  8:43   ` Daniel Way
@ 2019-11-05  9:18   ` Simon Wright
  1 sibling, 0 replies; 7+ messages in thread
From: Simon Wright @ 2019-11-05  9:18 UTC (permalink / raw)


"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:

> On 2019-11-05 06:47, Daniel Way wrote:

>> - are the GPR tools absolutely necessary for building a run time, or
>> is there another way to compile standard library packages?

> They are not necessary. You can use gnatmake or even just gcc and
> gnatbind etc. Yet gprbuild saves a huge amount of time and work,
> especially for large projects. It is also quite powerful and safe when
> it comes to multiple targets within same project. It really pays off
> to learn it a bit.

If you look at e.g. $prefix/arm-eabi/lib/gnat/zfp-stm32f4 you'll see
runtime.xml which gprbuild uses to control the target-specific switches
for the compiler and linker. It saves a lot of grief to let gprbuild do
this.


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

* Re: Configurable Run Time without GPR Tools
  2019-11-05  8:43   ` Daniel Way
  2019-11-05  8:59     ` Dmitry A. Kazakov
  2019-11-05  9:14     ` Simon Wright
@ 2019-11-05 15:15     ` Shark8
  2 siblings, 0 replies; 7+ messages in thread
From: Shark8 @ 2019-11-05 15:15 UTC (permalink / raw)


On Tuesday, November 5, 2019 at 1:44:00 AM UTC-7, Daniel Way wrote:
> Since I need to port a run time for my target hardware and I want to share this project via GitHub, I want all the run time files grouped. I guess I can make it work if I become more familiar with the tools.
Allow me to suggest multiple github repositories, one for the main project and one for each of the dependencies -- I know there's a way to do 'nested' repos so that you can have subsystems in their own project... but I typically go with packaging *EVERYTHING* in my repository so that anyone can build it w/o having to be concerned about the other items, but that seems unsuitable for what you're describing.


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

end of thread, other threads:[~2019-11-05 15:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-05  5:47 Configurable Run Time without GPR Tools Daniel Way
2019-11-05  8:28 ` Dmitry A. Kazakov
2019-11-05  8:43   ` Daniel Way
2019-11-05  8:59     ` Dmitry A. Kazakov
2019-11-05  9:14     ` Simon Wright
2019-11-05 15:15     ` Shark8
2019-11-05  9:18   ` Simon Wright

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