comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@gnat.com
Subject: Re: Green Hills Ada library question
Date: 1998/09/30
Date: 1998-09-30T00:00:00+00:00	[thread overview]
Message-ID: <6utg0l$gmk$1@nnrp1.dejanews.com> (raw)
In-Reply-To: victor.giddings-2909982234390001@remote3.ois.com

In article <victor.giddings-2909982234390001@remote3.ois.com>,
  victor.giddings@ois.com (Victor Giddings) wrote:

> We have found it relatively easy to build the "build file" from a shell
> script (actually within a make file). Then it is a matter of using the
> "build" command or the GUI to make everything. The only trick is to delete
> the appropriate build file when its membership should change, or to
> maintain it through the GUI. Admittedly this is suboptimal, however it is
> relatively obvious when a new file has not been made part of the build,
> but is withed by a file that is part of the project.

Yes, you certainly can use make files for Ada programs (we actually build
GNAT that way, since we don't want to rely on GNATMAKE for building GNAT
itself). The reason this approach works much less well for Ada than for
C is because computing the dependencies is difficult in Ada, and because
of the use of pragma Inline, the dependencies tend to change more rapidly.

Computing the dependencies really requires a compiler, to determine inlining
dependencies. There are two problems with conventional Ada 83 library systems
with respect to inlining:

1. You have to compile inlined bodies before the client. This means that what
inlining you get depends on the order of compilation, and it may be impossible
to do mutual inlining between two package bodies. The trouble here is that
the effect of getting the ordering wrong (e.g. by not having all the
dependencies accurate in the make file) is not a binder inconsistency, but
rather just inefficient non-inlined code.

2. Since the order of compilation is strict, you need to know the order of
compilation before you can compile, and you need to compile before you can
figure out the exact order of compilation. Make tools that work with
conventional Ada 83 libraries often have to approximate the dependenceies,
and again, if they get the approximation wrong, the penalty may not be
a detected inconsistency, but rather inefficiency due to inline failures.

The nice thing about the source library structure, used by both GNAT and
by Intermetrics (and consequently by Greenhills) is that since there is no
required order of compilation, you are not stuck on either point. The
GNATMAKE utility works by first compiling the main program to determine
its dependencies, and then works its way *down* the dependency tree (i.e.
in exactly the opposite order of compilation required by a traditional
library system). This means that GNATMAKE can accurately compute the
compilation dependencies, including all inlining requirements, as it
goes along with no inefficiencies.

The same approach should definitely be applicable to systems using the
IM front end, since it uses basically the same source based approach as
GNAT.

We have certainly found gnatmake to be an invaluable tool for GNAT, and indeed
in normal usage, it is the ONLY tool used for compilation.

Robert Dewar
Ada Core Technologies

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum




  parent reply	other threads:[~1998-09-30  0:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-09-14  0:00 Green Hills Ada library question dennison
1998-09-14  0:00 ` Tucker Taft
1998-09-15  0:00   ` dennison
1998-09-29  0:00     ` Victor Giddings
1998-09-30  0:00       ` dennison
1998-10-01  0:00         ` Paul English
1998-09-30  0:00       ` dewar [this message]
1998-09-15  0:00 ` bob
1998-09-15  0:00   ` Green Hills Ada library question (Ada on VxWorks) Corey Minyard
1998-09-16  0:00     ` dennison
1998-09-17  0:00       ` dewar
1998-09-18  0:00         ` dennison
1998-09-18  0:00           ` Tarjei Tj�stheim Jensen
1998-09-18  0:00             ` dennison
1998-09-19  0:00               ` dewarr
1998-09-19  0:00               ` dewarr
1998-09-21  0:00                 ` dennison
1998-09-19  0:00             ` dewarr
1998-09-19  0:00           ` dewar
1998-09-16  0:00     ` dewarr
1998-09-16  0:00       ` dennison
replies disabled

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