Prev: Dhrystone
Next: Learning Ada
From: Simon Wright on
Ada novice <posts(a)gmx.us> writes:

> On Jul 30, 9:41 pm, "John B. Matthews" <nos...(a)nospam.invalid> wrote:
>
>>
>> I think you may be looking at [raw] [diff] (difference) files.
>
> Thanks. I have been able to locate the correct set of files.

Great!

> Opening
> test_extensions.gpr in GPS gives me the following error messages:
>
> [2010-07-30 22:54:16] E:\\ada\numerics\simon\jul29\test_extensions.gpr:
> 15:06: unknown project file: "../src/ada_math_build"
> [2010-07-30 22:54:16] Error while loading project 'E:\ada\numerics
> \simon\jul29\test_extensions.gpr'. Loading the default project.

Maybe - for Windows - you'll need to change

with "../src/ada_math_build";

to

with "..\src\ada_math_build";

(I thought gnatmake was slash-direction-agnostic, certainly it's OK for
paths inside a GPR ...)


Oh! that probably wasn't it: you seem to have the structure set up
differently from what the GPR expects, which is:

./src:
ada-numerics-generic_complex_arrays-extensions.adb
ada-numerics-generic_complex_arrays-extensions.ads
ada_math_build.gpr

./test:
test_extensions.adb
test_extensions.gpr

If you go to the 'test' directory in a command window (or whatever it's
called in Windows now) and say

E:\...> gnatmake -p -P test_extensions

it should go OK. The '-p' says 'create any necessary directories'. I'm
pretty sure it'll do this in GPS too (it may ask for permission).


> I've tried to compile the source ads file
> (Ada.Numerics.Generic_Complex_Arrays.Extensions.ads) in AdaGIDE and I
> get the warning:
>
> 22. package Ada.Numerics.Generic_Complex_Arrays.Extensions is
> |
> >>> warning: file name does not match unit name, should be "a-
> ngcaex.ads"

From back in the day when GNAT had to run on DOS filesystems, the names
of units had to be 'krunched' to fit the 8.3 format, and for some reason
the standard library is still supplied this way. However, the code as
supplied builds OK with GCC 4.5.0 and GNAT GPL 2010 provided it's
compiled with ada_math_build.gpr.

I don't know whether AdaGIDE can manage GPRs, if not you're going to
have trouble using it for this...


> and I get an error message with
> Ada.Numerics.Generic_Complex_Arrays.Extensions.adb on compiling:
>
> 25.
> 26. package body Ada.Numerics.Generic_Complex_Arrays.Extensions is
> |
> >>> descendents of package Ada may not be compiled

You need special compilation options (-gnatpg) to allow compiling units
like these which (look as if they) are part of the standard
library. These options mean too that compilations have to be
warning-free.

src/ada_math_build.gpr supplies the necessary options.


> Note: for the source files adb and ads the name is ada-numerics-
> generic_complex_arrays-extensions. Should it be ada-numerics-
> generic_complex_arrays.extensions (with a dot between "arrays" and
> "extensions" instead)?

No, the dash is right:

ada-numerics-generic_complex_arrays-extensions
Ada.Numerics.Generic_Complex_Arrays.Extensions
From: Ada novice on
On Jul 31, 12:19 am, Simon Wright <si...(a)pushface.org> wrote:
> Maybe - for Windows - you'll need to change
>
>    with "../src/ada_math_build";
>
> to
>
>    with "..\src\ada_math_build";
>

Actually, this doesn't seem to make a difference.


>
> Oh! that probably wasn't it: you seem to have the structure set up
> differently from what the GPR expects, which is:
>
>    ./src:
>       ada-numerics-generic_complex_arrays-extensions.adb
>       ada-numerics-generic_complex_arrays-extensions.ads
>       ada_math_build.gpr
>
>    ./test:
>       test_extensions.adb
>       test_extensions.gpr
>
> If you go to the 'test' directory in a command window (or whatever it's
> called in Windows now) and say
>
>    E:\...> gnatmake -p -P test_extensions
>
> it should go OK. The '-p' says 'create any necessary directories'. I'm
> pretty sure it'll do this in GPS too (it may ask for permission).

I did what you suggested on the command line. This is what I get:

E:\...\jul29\test>gnatmake -p -P test_extensions
object directory "E:\...\jul29\src\.build" created for project
ada_math_build
library directory "E:\...\jul29\src\..\lib" created for project
ada_math_build
object directory "E:\...\jul29\test\.build" created for project
test_extensions
ada_math_build.gpr:15:09: there are no ada sources in this project
gnatmake: "test_extensions" processing failed


As a result of the above operations, now I have:

1. a .build directory is created in the folder test and it's empty;
2. a .build directory is created in the folder src and it's empty;
3. a lib folder is also created at the same level of hierarchy as the
folders test and src and it's empty

Afterwards, I'm able to open test_extensions.gpr WITHOUT any warning/
error messages in GPS

So next I tried to compile/build in GPS:

I press "Build main" (i.e. test_extensions.adb) and Ada_Math_Build.gpr
opens up and I get the message:

ada_math_build.gpr : there are no ada sources in this project


Looking at the structure of the gpr files in GPS in the "Project View"
pane on the LHS, I see that we just have 1 file: test_extensions.adb.
The source files Ada.Numerics.Generic_Complex_Arrays-
Extensions.ad(b,s) don't appear.
So there's something wrong. This is why I get the message: there are
no ada sources in this project on compiling.


> >         >>> warning: file name does not match unit name, should be "a-
> > ngcaex.ads"
>
> From back in the day when GNAT had to run on DOS filesystems, the names
> of units had to be 'krunched' to fit the 8.3 format, and for some reason
> the standard library is still supplied this way. However, the code as
> supplied builds OK with GCC 4.5.0 and GNAT GPL 2010 provided it's
> compiled with ada_math_build.gpr.
>
> I don't know whether AdaGIDE can manage GPRs, if not you're going to
> have trouble using it for this...


When I had problems earlier opening test_extensions.gpr in GPS as I
mentioned in my earlier post, I tried then to open the source files in
AdaGIDE just to compile them and see if everything is ok for the
source files. But I'm not using AdaGIDE. I will stick to GPS.


>
> > and I get an error message with
> > Ada.Numerics.Generic_Complex_Arrays.Extensions.adb on compiling:
>
> > 25.
> >     26. package body Ada.Numerics.Generic_Complex_Arrays.Extensions is
> >         |
> >         >>> descendents of package Ada may not be compiled
>
> You need special compilation options (-gnatpg) to allow compiling units
> like these which (look as if they) are part of the standard
> library. These options mean too that compilations have to be
> warning-free.

In GPS, I've taken a look at what switch is there for
test_entionsions.gpr and I see -gnatqQ. Changing this to -gnatpg puts
also -gnatVn automaticallt by GPS.


> > Note: for the source files adb and ads the name is ada-numerics-
> > generic_complex_arrays-extensions. Should it be ada-numerics-
> > generic_complex_arrays.extensions (with a dot between "arrays" and
> > "extensions" instead)?
>
> No, the dash is right:
>
> ada-numerics-generic_complex_arrays-extensions
> Ada.Numerics.Generic_Complex_Arrays.Extensions

I raised this issue as in the ads and adb files, you wrote:
Ada.Numerics.Generic_Complex_Arrays.Extensions .The dash is not
present. When I copied the plain text files of the codes from SF to
AdaGIDE, then of course, AdaGIDE proposed me the names
Ada.Numerics.Generic_Complex_Arrays.Extensions which match the names
inside the ads and adb files. But then I saw that on your website, you
named them with the dash instead. If I understand correctly, should
the names of the files not match the main procedure or package used
inside an Ada file? Maybe I'm thinking wrong here.


Thanks for giving me suggestions to make it work. We are not yet there
but hopefully with some minir adjustments, everything will be working
fine :).

YC

From: Ada novice on
On Jul 31, 12:19 am, Simon Wright <si...(a)pushface.org> wrote:

> Maybe - for Windows - you'll need to change

> with "../src/ada_math_build";

> to

> with "..\src\ada_math_build";

Actually, this doesn't seem to make a difference.

- Hide quoted text -
- Show quoted text -

> Oh! that probably wasn't it: you seem to have the structure set up
> differently from what the GPR expects, which is:

> ./src:
> ada-numerics-generic_complex_arrays-extensions.adb
> ada-numerics-generic_complex_arrays-extensions.ads
> ada_math_build.gpr

> ./test:
> test_extensions.adb
> test_extensions.gpr

> If you go to the 'test' directory in a command window (or whatever it's
> called in Windows now) and say

> E:\...> gnatmake -p -P test_extensions

> it should go OK. The '-p' says 'create any necessary directories'. I'm
> pretty sure it'll do this in GPS too (it may ask for permission).

I did what you suggested on the command line. This is what I get:

E:\...\jul29\test>gnatmake -p -P test_extensions
object directory "E:\...\jul29\src\.build" created for project
ada_math_build
library directory "E:\...\jul29\src\..\lib" created for project
ada_math_build
object directory "E:\...\jul29\test\.build" created for project
test_extensions
ada_math_build.gpr:15:09: there are no ada sources in this project
gnatmake: "test_extensions" processing failed

Note the ERROR message in the last line. As a result of the above
operations, now I have:

1. a .build directory is created in the folder test and it's empty;
2. a .build directory is created in the folder src and it's empty;
3. a lib folder is also created at the same level of hierarchy as the
folders test and src and it's empty

Afterwards, I'm able to open test_extensions.gpr WITHOUT any warning/
error messages in GPS

So next I tried to compile/build in GPS:

I press "Build main" (i.e. test_extensions.adb) and Ada_Math_Build.gpr
opens up and I get the message:

ada_math_build.gpr : there are no ada sources in this project

Looking at the structure of the gpr files in GPS in the "Project View"
pane on the LHS, I see that we just have 1 file: test_extensions.adb.
The source files Ada.Numerics.Generic_Complex_Arrays-
Extensions.ad(b,s) don't appear.
So there's something wrong. This is why I get the message: there are
no ada sources in this project on compiling.

> > >>> warning: file name does not match unit name, should be "a-
> > ngcaex.ads"

> From back in the day when GNAT had to run on DOS filesystems, the names
> of units had to be 'krunched' to fit the 8.3 format, and for some reason
> the standard library is still supplied this way. However, the code as
> supplied builds OK with GCC 4.5.0 and GNAT GPL 2010 provided it's
> compiled with ada_math_build.gpr.

> I don't know whether AdaGIDE can manage GPRs, if not you're going to
> have trouble using it for this...

When I had problems earlier opening test_extensions.gpr in GPS as I
mentioned in my earlier post, I tried then to open the source files in
AdaGIDE just to compile them and see if everything is ok for the
source files. But I'm not using AdaGIDE. I will stick to GPS.

> > and I get an error message with
> > Ada.Numerics.Generic_Complex_Arrays.Extensions.adb on compiling:

> > 25.
> > 26. package body Ada.Numerics.Generic_Complex_Arrays.Extensions is
> > |
> > >>> descendents of package Ada may not be compiled

> You need special compilation options (-gnatpg) to allow compiling units
> like these which (look as if they) are part of the standard
> library. These options mean too that compilations have to be
> warning-free.

In GPS, I've taken a look at what switch is there for
test_entionsions.gpr and I see -gnatqQ. Changing this to -gnatpg puts
also -gnatVn automaticallt by GPS.

> > Note: for the source files adb and ads the name is ada-numerics-
> > generic_complex_arrays-extensions. Should it be ada-numerics-
> > generic_complex_arrays.extensions (with a dot between "arrays" and
> > "extensions" instead)?

> No, the dash is right:

> ada-numerics-generic_complex_arrays-extensions
> Ada.Numerics.Generic_Complex_Arrays.Extensions

I raised this issue as in the ads and adb files, you wrote:
Ada.Numerics.Generic_Complex_Arrays.Extensions .The dash is not
present. When I copied the plain text files of the codes from SF to
AdaGIDE, then of course, AdaGIDE proposed me the names
Ada.Numerics.Generic_Complex_Arrays.Extensions which match the names
inside the ads and adb files. But then I saw that on your website, you
named them with the dash instead. If I understand correctly, should
the names of the files not match the main procedure or package used
inside an Ada file? Maybe I'm thinking wrong here.

Thanks for giving me suggestions to make it work. We are not yet there
but hopefully with some minor adjustments, everything will be working
fine :).

YC
From: Simon Wright on
Ada novice <posts(a)gmx.us> writes:

> ada_math_build.gpr:15:09: there are no ada sources in this project

I get this if I've not put the two ada-numerics- source files in the
src/ directory.

I wanted to attach a screenshot of GPS here, showing how the structure
should look. Nowever, eternal-september.org doesn't allow binary
attachments, so see https://public.me.com/simon.j.wright,
numerics/gps-building-view.jpg.

Also, in the Build Main dialog box, see under Project the checked
'Create object dirs' box -- the equivalent of the -p flag to gnatmake.
From: Simon Wright on
I forgot to add that (with GNAT GPL 2010) you'll need to use the
'-gnat05' flag. I've updated Sourceforge (the two GPRs).

test_extensions.gpr now reads
package Compiler is
for Default_Switches ("ada") use
(
"-gnatqQ",
"-gnat05" -- GNAT GPL 2010 requires this (GCC 4.5.0 doesn't)
);
end Compiler;

and ada_math_build.gpr now reads
package Compiler is
for Default_Switches ("ada") use
(
"-gnatpg", -- to build Ada library items
"-gnatqQ", -- to keep ALI files even if there are compilation errors
"-gnat05" -- GNAT GPL 2010 requires this (GCC 4.5.0 doesn't)
);
end Compiler;
First  |  Prev  |  Next  |  Last
Pages: 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Prev: Dhrystone
Next: Learning Ada