comp.lang.ada
 help / color / mirror / Atom feed
* GNAT Programming System Problems
@ 2004-06-22  4:54 Robert C. Leif
  2004-06-22  6:06 ` Martin Krischik
  2004-06-22 20:58 ` Simon Wright
  0 siblings, 2 replies; 9+ messages in thread
From: Robert C. Leif @ 2004-06-22  4:54 UTC (permalink / raw)
  To: comp.lang.ada

After much time and effort, I have been able to compile a program with the
GNAT Programming System.  Initially, when I created a project, the files
would neither compile nor even check syntax.  I received a message,

"pretty_printer" is not an allowed package name
warning: undefined attribute "default_switches"

This problem was eliminated by commenting out information on the pretty
printer in the .gpr file.

--     package Pretty_Printer is
--        for Default_Switches ("Ada") use ("");
--     end Pretty_Printer;

For each of my Ada Utilities, I created its own project.  Since in each
utility there are packages (mostly bodies) that depend on packages in
another utility, there are circular dependencies amongst the .gpr files.
Fortunately, these do not exist in the specifications.  After extensive
searching, I found mention of a "limited with construct".  The addition of
limited before with in the project file did not work.

Obviously, I would greatly appreciate help.  I also should state that I have
described one of the reasons for the Ada's lack of popularity.  Microsoft
and other software manufacturers have demonstrated that for the customer the
ease of use of the environment can outweigh the comparative lack of quality
of the compiler.  I was hopping that the development of A# would result in a
commercial quality compiler that could be hosted, as many other languages
have been, under Microsoft Visual Studio.  The traditional Ada compiler
vendors might extend their J code generators to produce the ECMA
intermediate language employed by Microsoft.

Robert (Bob) Leif






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

* Re: GNAT Programming System Problems
  2004-06-22  4:54 GNAT Programming System Problems Robert C. Leif
@ 2004-06-22  6:06 ` Martin Krischik
  2004-06-22 14:06   ` Robert Love
  2004-06-22 20:58 ` Simon Wright
  1 sibling, 1 reply; 9+ messages in thread
From: Martin Krischik @ 2004-06-22  6:06 UTC (permalink / raw)


C. Leif wrote:

> After much time and effort, I have been able to compile a program with the
> GNAT Programming System.  Initially, when I created a project, the files
> would neither compile nor even check syntax.  I received a message,
> 
> "pretty_printer" is not an allowed package name
> warning: undefined attribute "default_switches"
> 
> This problem was eliminated by commenting out information on the pretty
> printer in the .gpr file.

The pretty printer is only available to newer GNATs. Personally I think this
is a design mistake. Unknown packages should have been a warning not an
error.

> For each of my Ada Utilities, I created its own project.  Since in each
> utility there are packages (mostly bodies) that depend on packages in
> another utility, there are circular dependencies amongst the .gpr files.
> Fortunately, these do not exist in the specifications.  After extensive
> searching, I found mention of a "limited with construct".  The addition of
> limited before with in the project file did not work.

In which case you might consider a library package. Just create a package
with the shared packages and add:

    Version := "1.0.0";
    for Library_Name        use "adacl";

   case Style is
      when "Release" =>
         for Library_Kind        use "dynamic";
         for Library_Version     use "libmylib.so." & Version;
      when "Debug" =>
         for Library_Kind        use "static";
         for Library_Version     use "libmylib.a." & Version;
   end case;

and remove the 

    for Main ...
    for Executable ...

statements.

> Obviously, I would greatly appreciate help.  I also should state that I
> have
> described one of the reasons for the Ada's lack of popularity.  Microsoft
> and other software manufacturers have demonstrated that for the customer
> the ease of use of the environment can outweigh the comparative lack of
> quality
> of the compiler.  I was hopping that the development of A# would result in
> a commercial quality compiler that could be hosted, as many other
> languages
> have been, under Microsoft Visual Studio.  The traditional Ada compiler
> vendors might extend their J code generators to produce the ECMA
> intermediate language employed by Microsoft.

Remember: you are using the free academic version! GNAT Pro comes with
pretty printer, the newest GPS, and support.

With Regards

Martin

-- 
mailto://krischik@users.sourceforge.net
http://www.ada.krischik.com




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

* Re: GNAT Programming System Problems
  2004-06-22  6:06 ` Martin Krischik
@ 2004-06-22 14:06   ` Robert Love
  2004-06-22 14:39     ` Ludovic Brenta
  2004-06-22 15:10     ` Arnaud Charlet
  0 siblings, 2 replies; 9+ messages in thread
From: Robert Love @ 2004-06-22 14:06 UTC (permalink / raw)


Martin Krischik <krischik@users.sourceforge.net> wrote in message 
> 
> Remember: you are using the free academic version! GNAT Pro comes with
> pretty printer, the newest GPS, and support.
> 

Ah, if it were only that easy.  I work on a project where we have a
contract with ACT so I can get the latest tools but the powers that be
will not step up to the newer compilers.  We're over 3 years behind
and there is no concrete plan to modernize.

I agree with the original poster that having to comment out the
"pretty print" section of every project every time you make a change
is a real pain.  It should not be a fatal error to have some unused
feature in the project file!



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

* Re: GNAT Programming System Problems
  2004-06-22 14:06   ` Robert Love
@ 2004-06-22 14:39     ` Ludovic Brenta
  2004-06-23 13:39       ` Robert Love
  2004-06-22 15:10     ` Arnaud Charlet
  1 sibling, 1 reply; 9+ messages in thread
From: Ludovic Brenta @ 2004-06-22 14:39 UTC (permalink / raw)



Robert Love wrote:
> Ah, if it were only that easy. I work on a project where we have a
> contract with ACT so I can get the latest tools but the powers that be
> will not step up to the newer compilers. We're over 3 years behind
> and there is no concrete plan to modernize.

For Debian GNU/Linux, I have patched GPS so it does not generate the
offending lines in project files.  My patches also make it possible
to compile GPS with GNAT 3.15p.  You may want to apply them and rebuild
GPS from source.  On the URL below, look for the .diff.gz file, it contains
the patches.

http://packages.qa.debian.org/g/gnat-gps.html

BTW, how come the powers that be allow you to use GPS of they won't
allow newer versions of GNAT?

-- 
Ludovic Brenta.


-- 
Use our news server 'news.foorum.com' from anywhere.
More details at: http://nnrpinfo.go.foorum.com/



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

* Re: GNAT Programming System Problems
  2004-06-22 14:06   ` Robert Love
  2004-06-22 14:39     ` Ludovic Brenta
@ 2004-06-22 15:10     ` Arnaud Charlet
  1 sibling, 0 replies; 9+ messages in thread
From: Arnaud Charlet @ 2004-06-22 15:10 UTC (permalink / raw)


> Ah, if it were only that easy.  I work on a project where we have a
> contract with ACT so I can get the latest tools but the powers that be
> will not step up to the newer compilers.  We're over 3 years behind
> and there is no concrete plan to modernize.

If you're 3 years behind for all GNAT tools, it means you are not
even using GPS, so you can't possibly have the problem with the
Pretty_Printer package anyway :-)

If only your compiler has to be 3 years behind and you are allowed to use
more recent versions of other tools (e.g. GPS), as is the case for
many of our customers, then you can simply use the current GPS Pro
version, see below.

> I agree with the original poster that having to comment out the
> "pretty print" section of every project every time you make a change
> is a real pain.  It should not be a fatal error to have some unused
> feature in the project file!

Current GPS Pro versions do not generate any Printer_Package by default,
so that's not an issue there either, even if you're using an old version
of GNAT.

This will also be included into the next academic release of GPS.

Arno




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

* Re: GNAT Programming System Problems
  2004-06-22  4:54 GNAT Programming System Problems Robert C. Leif
  2004-06-22  6:06 ` Martin Krischik
@ 2004-06-22 20:58 ` Simon Wright
  2004-06-22 22:04   ` Ludovic Brenta
  1 sibling, 1 reply; 9+ messages in thread
From: Simon Wright @ 2004-06-22 20:58 UTC (permalink / raw)


"Robert C. Leif" <rleif@rleif.com> writes:

> For each of my Ada Utilities, I created its own project.  Since in
> each utility there are packages (mostly bodies) that depend on
> packages in another utility, there are circular dependencies amongst
> the .gpr files.  Fortunately, these do not exist in the
> specifications.  After extensive searching, I found mention of a
> "limited with construct".  The addition of limited before with in
> the project file did not work.

If you want not-yet-standard features such as limited with to work you
must enable them with -gnatX (if I remember correctly) -- a compiler
flag. Not sure if this will be available in anything other than the
latest versions of the compiler, though (free or paid-for!), I think
it was introduced November of last year or thereabouts.

I agree that GNAT Project is not easy to get to grips with, especially
if (as I did) you start out with misconceptions.

A key thing is "every Project must have its own 'Object_Dir" -- it may
seem as though it is working without this but if so it will only be
because of bugs in GNAT Project handling in the tools.

Another key thing is "without project extension, each source file may
appear only once in all the with'ed projects".

The distribution of my ColdFrame (http://pushface.org/coldframe/)
comes with a set of GPRs, if that would help. They successfully build
my regression tests with GNAT 3.15p (but for some reason I haven't
followed through the tests fail with that release. Hmm! I normally
test on 3.16a1 ..)

-- 
Simon Wright                               100% Ada, no bugs.



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

* Re: GNAT Programming System Problems
  2004-06-22 20:58 ` Simon Wright
@ 2004-06-22 22:04   ` Ludovic Brenta
  2004-06-23  4:51     ` Simon Wright
  0 siblings, 1 reply; 9+ messages in thread
From: Ludovic Brenta @ 2004-06-22 22:04 UTC (permalink / raw)


Simon Wright writes:
> "Robert C. Leif" writes:
>
>> For each of my Ada Utilities, I created its own project.  Since in
>> each utility there are packages (mostly bodies) that depend on
>> packages in another utility, there are circular dependencies amongst
>> the .gpr files.  Fortunately, these do not exist in the
>> specifications.  After extensive searching, I found mention of a
>> "limited with construct".  The addition of limited before with in
>> the project file did not work.
>
> If you want not-yet-standard features such as limited with to work you
> must enable them with -gnatX (if I remember correctly) -- a compiler
> flag. Not sure if this will be available in anything other than the
> latest versions of the compiler, though (free or paid-for!), I think
> it was introduced November of last year or thereabouts.
>
> I agree that GNAT Project is not easy to get to grips with, especially
> if (as I did) you start out with misconceptions.
>
> A key thing is "every Project must have its own 'Object_Dir" -- it may
> seem as though it is working without this but if so it will only be
> because of bugs in GNAT Project handling in the tools.
>
> Another key thing is "without project extension, each source file may
> appear only once in all the with'ed projects".
>
> The distribution of my ColdFrame (http://pushface.org/coldframe/)
> comes with a set of GPRs, if that would help. They successfully build
> my regression tests with GNAT 3.15p (but for some reason I haven't
> followed through the tests fail with that release. Hmm! I normally
> test on 3.16a1 ..)

Also, the "limited with" feature of Ada 2005 deals with Ada packages,
not with GNAT project files.

-- 
Ludovic Brenta.




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

* Re: GNAT Programming System Problems
  2004-06-22 22:04   ` Ludovic Brenta
@ 2004-06-23  4:51     ` Simon Wright
  0 siblings, 0 replies; 9+ messages in thread
From: Simon Wright @ 2004-06-23  4:51 UTC (permalink / raw)


Ludovic Brenta <ludovic.brenta@insalien.org> writes:

> > "Robert C. Leif" writes:
> >
> >> For each of my Ada Utilities, I created its own project.  Since in
> >> each utility there are packages (mostly bodies) that depend on
> >> packages in another utility, there are circular dependencies amongst
> >> the .gpr files.  Fortunately, these do not exist in the
> >> specifications.  After extensive searching, I found mention of a
> >> "limited with construct".  The addition of limited before with in
> >> the project file did not work.

> Also, the "limited with" feature of Ada 2005 deals with Ada packages,
> not with GNAT project files.

Oh, yes, I didn't spot that ..

-- 
Simon Wright                               100% Ada, no bugs.



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

* Re: GNAT Programming System Problems
  2004-06-22 14:39     ` Ludovic Brenta
@ 2004-06-23 13:39       ` Robert Love
  0 siblings, 0 replies; 9+ messages in thread
From: Robert Love @ 2004-06-23 13:39 UTC (permalink / raw)


Ludovic Brenta <ludovic.brenta@insalien.org> wrote in message news:<2004622-163941-23702@foorum.com>...

> 
> BTW, how come the powers that be allow you to use GPS of they won't
> allow newer versions of GNAT?

Those "powers that be" aren't doing any programming.  They don't know
the issues staying with the old compiler. They just know it is no risk
to stay as is.

Most of my coworkers are using a home brewed development IDE that kind
of looks like Rational's Apex.  So the one or two of us are the only
ones effected. They still use GVD instead of GPS as a front end to
GDB.  I don't think they know that GVD is not being updated any more.

Sadly, GPS is not popular here, there are only 1 or 2 of us using it. 
In talking to them the biggest draw back is that style where all
windows are contained in one frame. Yes, I know you can float windows
optionally but it doesn't seem to matter.



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

end of thread, other threads:[~2004-06-23 13:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-22  4:54 GNAT Programming System Problems Robert C. Leif
2004-06-22  6:06 ` Martin Krischik
2004-06-22 14:06   ` Robert Love
2004-06-22 14:39     ` Ludovic Brenta
2004-06-23 13:39       ` Robert Love
2004-06-22 15:10     ` Arnaud Charlet
2004-06-22 20:58 ` Simon Wright
2004-06-22 22:04   ` Ludovic Brenta
2004-06-23  4:51     ` Simon Wright

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