On May 9, 2012, at 2:27 PM, Alan W. Irwin wrote:

> On 2012-05-09 01:36-0700 Jerry wrote:
> 
>> I recently updated my Ada compiler from the 2010 GPL version provided by 
>> Adacore (the commercial source) to the 2011 version and encountered a rather 
>> odd problem when trying to link the Ada bindings into my own project.
>> 
>> GCC Ada aka GNAT and its tools provide two systems of building stuff--the 
>> older and still-used one uses the gnatmake and related commands, providing a 
>> somewhat traditional way of passing arguments on to the gcc tools.
>> 
>> The other system is called GPR (Gnat PRoject), gprbuild, and one writes some 
>> relatively sane-looking files that do the same thing as gnatmake et al and 
>> more. This is the system that I have used, in very simple ways.
>> 
>> I don't know if what I'll describe in a bit is necessary for gnatmake but is 
>> seems so for gprbuild. It is a complete mystery why this worked for the 2010 
>> tools at all without the following change, which I believe we should 
>> incorporate into the PLplot build. It's really simple.
>> 
>> Copy
>> 
>> /usr/local/plplot/lib/libplplotadad.0.0.0.dylib
>> /usr/local/plplot/lib/libplplotadad.0.dylib
>> /usr/local/plplot/lib/libplplotadad.dylib
>> 
>> to
>> 
>> /usr/local/plplot/lib/ada/adalib/plplotadad
>> 
>> where /usr/local/plplot is my installation directory. That's it. When I do 
>> this manually, my personal stuff builds using the 2011 tools, but if I don't 
>> do it the 2011-tool build fails. There are some other files in the target 
>> directory, ending in .ali--these should remain--the .dylib needs to be in 
>> the same folder as these .ali. I suppose another directory would suffice as 
>> long as the .dylib and .alis are in it.
>> 
> 
> Hi Jerry:
> 
> I think the above change will screw up our installed Ada examples
> build which exclusively uses the gnatmake approach.  So please test
> the installed examples build with and without the above change to see
> whether that hypothesis is correct.
> 
> To remind you how to do such testing do your normal procedure
> for building and installing PLplot.  Then
> run cmake in an empty directory
> with no options and with just a reference to the installed examples
> tree like this:
> 
> # insures initially empty build tree.
> rm -rf test_install_build
> mkdir test_install_build
> cd test_install_build
> 
> cmake /usr/local/plplot/share/plplot5.9.9/examples
> 
> then
> 
> make test_ada_psc
> 
> That make command should work fine for an unmolested install, but if

Hmm.... I did this

cd /usr/local/dumpme
rm -rf test_install_build
mkdir test_install_build
cd test_install_build
cmake /usr/local/plplot/share/plplot5.9.9/examples
make test_ada_psc


and got this...


Generate ada results for psc device
Testing front-end ada
x01
/usr/local/plplot/share/plplot5.9.9/examples/test_ada.sh: line 32: 34044 
Trace/BPT trap: 5       "$adadir"/x${index}${lang} -dev $device -o 
"${OUTPUT_DIR}"/x${index}${lang}%n.$dsuffix $options 2> test.error 
>|"${OUTPUT_DIR}"/x${index}${lang}_${dsuffix}.txt
dyld: Library not loaded: @rpath/libgnat-2010.dylib
  Referenced from: /usr/local/dumpme/test_install_build/./ada/x01a
  Reason: image not found
make[3]: *** [x01a.psc] Error 1
make[2]: *** [CMakeFiles/test_ada_psc.dir/all] Error 2
make[1]: *** [CMakeFiles/test_ada_psc.dir/rule] Error 2
make: *** [test_ada_psc] Error 2


I tried to supply the path to what I think it is asking for but I'm not sure 
how to do that.


> you move install tree files around and repeat the above commands
> (again for an initially empty build directory) I predict it won't
> work.
> 
> To me it would make a lot of sense if you configured the GPR build
> process for your own use

As I understand it, to use gprbuild, the library (.dylib on OS X, or .a if 
built that way) needs to be in the same directory as the .ali files. I also 
think that an alternative to linking to the .dylib would be to designate a 
directory that contains all of the bindings' .ali and .o files which (as of 
now) is

  /usr/local/plplot_build_dir/bindings/ada/CMakeFiles/plplotadad.dir

> (as opposed to the PLplot build system which
> uses gnatmake exclusively) so that it followed the traditional gnatmake
> location conventions (as the PLplot core build, install, and installed
> examples build processes do now).

I understand what you're saying, but I think that gprbuild is just a layer over 
gcc like gnatmake. In any case, it would be of use to users to be able to use 
gprbuild if they wish. How can _copying_ these files mess with the current 
build process for the examples?

I'm still hoping for more help on general library issues from 
comp.lang.ada--the GPS docs are not the finest example of technical writing and 
seem especially vague on this topic.

Jerry
> 
> Alan


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to