From: Jerry <lan...@qw...> - 2008-01-07 02:50:21
|
On Jan 5, 2008, at 8:55 PM, Hazen Babcock wrote: > > On Jan 5, 2008, at 6:36 PM, Jerry wrote: > >> I am taking another run at getting the OS X graphics display, >> AquaTerm, to work with the Ada bindings. AquaTerm is almost certainly >> the most popular output device for PLplot on the Mac. >> >> My previous attempt failed because of some problem related to the >> Objective C compiler. I suppose that the Objective C compiler is >> needed because the AquaTerm driver uses some Cocoa (written in >> Objective C) frameworks. >> >> I have a working version of AquaTerm installed on my computer. >> >> In my previous attempt, I thought that perhaps the PLplot build >> system was not seeing the compiler because my PATH variable has the >> path to the Ada compiler at the front, as directed by the Mac Ada >> folks, and might be blocking the other compilers. (I really don't >> know what I'm talking about here, mostly.) My PATH variable is: >> /opt/local/bin:/opt/local/sbin:/usr/local/ada-4.3/bin:/bin:/sbin:/ >> usr/ >> bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/Applications > > I was able to compile PLplot with both Ada and Aquaterm. I have (or > at least I believe I have) installed Ada from www.macada.org using > the GnatPPC-4.3.dmg installer. I say I believe since I did this a > while ago and while I seem to have ada on my computer and I also > have this installer I've forgotten whether I actually used this > installer to install ada. Anyway. > > The approach is to use the ada gcc *only* for compiling the ada > bindings. All my ada stuff is in /usr/local/ada-4.3, so I set: > > CMAKE_Ada_compiler= /usr/local/ada-4.3/bin/gcc > GNAT_EXECUTABLE_BUILDER = /usr/local/ada-4.3/bin/gnatmake > GNAT_LIB = /usr/local/ada-4.3/lib/gcc/powerpc-apple-darwin8/4.3.0/ > adalib/libgnat.dylib I added these lines to the bash script which I use to build from SVN: CMAKE_Ada_compiler=/usr/local/ada-4.3/bin/gcc GNAT_EXECUTABLE_BUILDER=/usr/local/ada-4.3/bin/gnatmake GNAT_LIB=/usr/local/ada-4.3/lib/gcc/powerpc-apple-darwin8/4.3.0/ adalib/libgnat.dylib CMAKE_C_COMPILER=/usr/bin/gcc I don't know if this is relevant but cmake reports (as I think it did before I added these lines): CMAKE_BUILD_TYPE: CMAKE_C_COMPILER CMAKE_C_FLAGS: /usr/local/ada-4.3/ bin/gcc LIB_TAG: d The build process reports: [ 35%] Building C object drivers/CMakeFiles/aqt.dir/aqt.o /usr/local/ada-4.3/bin/gcc -Daqt_EXPORTS -fPIC -I/Users/jb/ Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/plplot/include -I/usr/local/plplot_build_dir -I/usr/local/plplot_build_dir/include -DHAVE_CONFIG_H -ObjC -o drivers/CMakeFiles/aqt.dir/aqt.o -c /Users/ jb/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/plplot/ drivers/aqt.c cc1: error: invalid option argument '-ObjC' make[2]: *** [drivers/CMakeFiles/aqt.dir/aqt.o] Error 1 make[1]: *** [drivers/CMakeFiles/aqt.dir/all] Error 2 make: *** [all] Error 2 which looks like the same output that I reported before. > > (CMAKE_C_COMPILER is /usr/bin/gcc) > > This will compile for me (OS-X 10.4, gcc 4.0.1), but the linking is > messed up in that the paths to the necessary ada libraries are not > correct: > > examples/ada : otool -L x01a > x01a: > libplplotadad.0.0.0.dylib (compatibility version 0.0.0, > current version 0.0.0) > /Users/hbabcock/Documents/OpenSource/PLplot/plplot-CBS-1/ > src/libplplotd.9.dylib (compatibility version 0.0.0, current > version 0.0.0) > /usr/lib/libltdl.3.dylib (compatibility version 5.0.0, > current version 5.0.0) > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, > current version 88.1.10) > /Users/hbabcock/Documents/OpenSource/PLplot/plplot-CBS-1/ > lib/csa/libcsirocsa.0.dylib (compatibility version 0.0.0, current > version 0.0.0) > /Users/hbabcock/Documents/OpenSource/PLplot/plplot-CBS-1/ > lib/nn/libcsironn.0.dylib (compatibility version 0.0.0, current > version 0.0.0) > /usr/local/lib/libqhull.5.dylib (compatibility version > 6.0.0, current version 6.0.0) > libgnat-4.3.dylib (compatibility version 0.0.0, current > version 0.0.0) > /usr/local/lib/libgcc_s.1.dylib (compatibility version > 1.0.0, current version 1.0.0) > > Note that libplplotadad.0.0.0.dylib and libgnat-4.3.dylib do not > have any path information in front of them, unlike all the other > libraries. You can run the examples if you provide symlinks to > these libraries in the examples folder and I checked that you can > in fact use the aquaterm device with the ada examples. I've had problems with these libraries, too. libplplotadad. 0.0.0.dylib is in the build directory which I assume is correct. And I've tried telling gnatmake where it is (gnatmake passes the library path to the linker.) I didn't have immediate success and I didn't pursue it any further at the time. I am a little concerned in that I think that it might be possible that gnatmake could hide certain problems related to missing object files or libraries. As I understand it, gnatmake guarantees that inconsistent sources can never be compiled. (This is a requirement of Ada.) If it does not find certain things, it will kindly recompile whatever it needs, assuming that the proper source files can be found. It helps to remember that Ada files specify all of their dependencies directly in the code, so that building a project of any size can be accomplished simply by running, e.g., gnatmake main.adb -- if all of the source paths are known, gnatmake looks in the source files for "with" statements and then looks around for the needed source files. With my present set-up, in the directory containing the main program of a PLplot project, after running gnatmake, I see such (new) files as plplot_thin.o plplot_thin.ali plplot_auxiliary.o plplot_auxiliary.ali plplot.o plplot.ali The .o are newly-made object files and the .ali are Ada things made by the Ada binder and which can be deleted if desired, after a compilation. The point is, it looks to me as if gnatmake is not seeing libplplotadad but sees the sources and politely recompiles plplot_thin.ad?, plplot_auxiliary.ad?, and plplot.ad?. I'm curious to know if you see any such files on your system, including plplot_traditional.o plplot_traditional.ali Jerry > > Obviously it would better to have the correct path information with > the libraries. > > -Hazen > > |