|
Prev: ada and other programming language tutorial
Next: gnatmake: "ada.numerics.real_arrays" is not a predefined libraryunit
From: Reinert Korsnes on 21 Apr 2008 07:34 Hello, My linux system (opensuse 10.3 updated) does not find "ada.numerics.real_arrays. Should it ? Details: -------- I tried to compile a program starting like this: with Text_IO; use Text_IO; with Ada.Numerics,Ada.Numerics.Real_Arrays; with Ada.Numerics.Generic_Elementary_Functions; procedure test2 is .... I used the command: gnatmake -gnat05 test2.adb Then I get the error message: test2.adb:3:21: "ada.numerics.real_arrays" is not a predefined library unit gnatmake: "test2.adb" compilation error Is there any hope for me to use "Ada.Numerics.Real.Arrays" ? reinert
From: Ludovic Brenta on 21 Apr 2008 09:46 Georg Bauhaus wrote: > Also, I'd consider getting Debian (or Ubuntu); Thanks; I really appreciate this but in this particular area, Debian is probably no better than any other distribution. You see, the GNAT implementation of Annex G is, essentially, a binding to LAPACK. The relevant units (Ada.Numerics.*) are in a static library called libgnala.a (GNAT Linear Algebra) which is separate from libgnat.a. Moreover, the upstream Makefile does not build a shared version of libgnala.a. So, if someone wants to use Annex G you must: - build with "gnatmake -static" - link with libgnala.a - link with LAPACK It's been in the back of my mind for a few months that I should build a shared libgnala.so, package it separately from libgnat-4.3.so, and arrange for it to depend on lapack. Patches to that effect are, of course, welcome and will be gratefully accepted. To the OP: this libgnala.a only appeared in GCC 4.3 released in January 2008. If SuSE ships anything older than that, you must upgrade your compiler if you want to take advantage of Annex G. -- Ludovic Brenta.
From: Jerry on 21 Apr 2008 17:34 On Apr 21, 4:34 am, Reinert Korsnes <a...(a)b.no> wrote: > Hello, > > My linux system (opensuse 10.3 updated) does not > find "ada.numerics.real_arrays. Should it ? > > Details: > -------- > I tried to compile a program starting like this: > > with Text_IO; > use Text_IO; > with Ada.Numerics,Ada.Numerics.Real_Arrays; > with Ada.Numerics.Generic_Elementary_Functions; > procedure test2 is > > ... > > I used the command: > > gnatmake -gnat05 test2.adb > > Then I get the error message: > > test2.adb:3:21: "ada.numerics.real_arrays" is not a predefined library unit > gnatmake: "test2.adb" compilation error > > Is there any hope for me to use "Ada.Numerics.Real.Arrays" ? > > reinert I don't want to confuse the discussion here, but the OS X ada list (www.macada.org) has been discussing this lately, (as well as December, 2007 if you're inclined to dig through archives). The upshot is that the file i-forbla.adb is edited to comment out one line, so that after the edit we see this: -- pragma Linker_Options ("-lgnalasup") All I did then was to compile a "hello" program using -a that with-ed Ada.Numerics.Long_Real_Arrays and Ada.Numerics.Long_Complex_Arrays, then copied the new .o and .ali to the proper Ada library directory. I can supply more details if needed. Also, I don't pretend to understand why this works. Incidentally, BLAS and LAPACK, both Fortran and C versions, come pre- installed on OS X so linking to them is pretty trivial. Jerry P.S. Sorry if this post appears twice. My last two posts did, and I'm blaming it on my browser.
From: Ludovic Brenta on 22 Apr 2008 08:04
Samuel Tardieu wrote: > Yes, I changed the GCC sources this morning to reference LAPACK and > BLAS directly by default instead of gnalasup which is a repackaging of > those libraries done by AdaCore. This patch will make it into the next upload of gnat-4.3. However, since I uploaded a new gnat-4.3 just yesterday evening, I'll wait a couple of weeks before the next upload, to see if new bugs are introduced. (Note: yesterday's upload, 4.3.0-5, brings in several bug fixes that Sam backported from GCC 4.4, as well as support for 64-bit PowerPC. Debian is the only distribution that has these bug fixes and I didn't want to deprive our users of them any longer. So, happy hacking :)) -- Ludovic Brenta. |