From: Jerry <lanceboyle@qwest.net>
Subject: gprbuild worked for GNAT GPL 2010, fails for 2011 edition
Date: Fri, 4 May 2012 18:08:00 -0700 (PDT)
Date: 2012-05-04T18:08:00-07:00 [thread overview]
Message-ID: <a04a8d21-896a-4d61-b219-26092b0df09a@r9g2000yqd.googlegroups.com> (raw)
I'm on OS X 10.7.3 (Lion) and recently changed the Ada tools from
Adacore's 2010 GPL edition to their 2011 edition. Unfortunately, my
_simple_ project build process using gprbuild now fails, where it
worked with the 2010 edition.
The problem is in making a project file for externally built
libraries. (I find the GPRbuild's user guide a little vague on this
subject.) The external library in question is that made by cmake
during the PLplot installation. There are two libraries: the "core"
PLplot library which is compiled from C and which I am linking
sucessfully (see PLplot_Library_1 below).
The other kind of library contains the Ada bindings (which I wrote)
which are built (from cmake) using gnatmake. As I see it, there are
two versions of this library: (1) a dynamic library which lives at
/usr/local/plplot/lib/libplplotadad.dylib
and (2) an Ada-style library directory containing the .ali and .o
files for the Ada bindings which is at
/usr/local/plplot_build_dir/bindings/ada/CMakeFiles/plplotadad.dir
(I don't know which of these is preferred, if either. I'm not getting
either one to work.) For my own work, I can arrange for the PLplot
bindings to be re-compiled from source but I prefer to link to the pre-
built library because I think that is the way that users would work
and it provides me with a small bit of testing to work this way.
Note that the PLplot_Library_2 uses
for Library_Dir use "/usr/local/plplot/lib/ada/adalib/plplotadad";
which contains the bindings' .ali files but not .o files--this worked
for 2010 but seems to be a problem for 2011. However, when I reference
the directory mentioned above which does contain both .o and .ali
files, the process still fails.
In one of my attempts, the process aborted, asking for the sources for
the Ada bindings. Why would sources be required for a pre-built
library?
Now, using the 2011 edition, using the below project files which work
for 2010, the process fails with
gcc: /usr/local/plplot/lib/ada/adalib/plplotadad//libplplotadad.a:
No such file or directory
Incidentally, if I build the library using 2010 and try to link with
2011, failure happens with
fatal error: file plplot.ali is incorrectly formatted
make sure you are using consistent versions of gcc/gnatbind
Sorry for the long post.
Jerry
-- Library for core (C) PLplot functionality; this works.
library project PLplot_Library_1 is
for Externally_Built use "true";
for Library_Dir use "/usr/local/plplot/lib";
for Library_Name use "plplotd";
for Library_Kind use "dynamic";
end PLplot_Library_1;
-- Library for Ada bindings; worked for Adacore 2010, broken for 2011.
library project PLplot_Library_2 is
for Externally_Built use "true";
for Source_Dirs use ("/usr/local/plplot/share/ada/adainclude/
plplotadad");
for Library_Dir use "/usr/local/plplot/lib/ada/adalib/plplotadad";
for Library_Name use "plplotadad";
end PLplot_Library_2;
-- Main project file
with "PLplot_Library_1";
with "PLplot_Library_2";
project Build is
for Source_Dirs use
("source",
"/Users/me/Documents/Programs/Ada/Code/My_Code/Specialized/
Sampling",
"/Users/me/Documents/Programs/Ada/Code/My_Code/Specialized/Sampling/
Post-processing",
"/Users/me/Documents/Programs/Ada/Code/My_Code/My_Tools");
for Object_Dir use "build-normal";
for Exec_Dir use ".";
for Main use ("third.adb");
package Builder is
for Default_Switches ("Ada") use ("-O2", "-gnat05", "-gnato");
for Executable ("third.adb") use "product-normal/run";
end Builder;
package Compiler is
end Compiler;
package Binder is
end Binder;
package Linker is
end Linker;
end Build;
next reply other threads:[~2012-05-05 1:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-05 1:08 Jerry [this message]
2012-05-07 6:10 ` gprbuild worked for GNAT GPL 2010, fails for 2011 edition Simon Wright
2012-05-08 4:02 ` Jerry
2012-05-09 7:36 ` Simon Wright
2012-05-10 1:19 ` Jerry
2012-05-10 7:26 ` Ludovic Brenta
2012-05-11 1:01 ` Jerry
2012-05-15 6:13 ` Simon Wright
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox