On 2007-07-13 22:10-0400 Hazen Babcock wrote: > > On Jul 13, 2007, at 1:32 AM, Alan W. Irwin wrote: > >> On 2007-07-13 00:31-0400 Hazen Babcock wrote: >>> >>> I've installed macada and I've managed to get this far on my OS-X >>> box. I was hoping to be able to tell cmake (using the ccmake >>> facility) to use /usr/bin/gcc for the C compiler. However when I set >>> the CMAKE_C_COMPILER = /usr/bin/gcc and then configure it always gets >>> flipped back to /usr/local/ada-4.3/bin/gcc. My suspicion is that we >>> could get both Ada and Aquaterm to work if we could somehow suppress >>> the behavior. Ideas? >> >> How do you set CMAKE_C_COMPILER? > > I was trying to set it using the cmake text GUI interface, ccmake. > >> I have never used that CMake variable, but my interpretation of >> http://www.cmake.org/Wiki/CMake_Useful_Variables#Compilers_and_Tools is >> you can only set it using a -D option to cmake which will only work >> if you haven't cached anything before (i.e., you are starting fresh >> with no CMakeCache.txt file in your build directory). Anyhow, I assume >> the flipping "back to /usr/local/ada-4.3/bin/gcc" is cause by a cached >> value. >> >> Another way to set the C compiler (and associated flags) which I know >> works, >> is to set the CC environment variable (as also discussed at the above >> site) >> before invoking cmake _with no cache file_. >> >> Similarly, to set the Ada compiler, specify the ADA environment variable >> (see the first few lines of cmake/modules/ >> CMakeDetermineAdaCompiler.cmake). >> From further along in that file you can see that it is always assumed that >> the Ada executable builder is going to be called gnatmake, and gnatmake is >> looked for in the same directory as the specified Ada compiler. >> >> Anyhow, I believe that setting the CC and ADA environment variables before >> running cmake with no CMakeCache.txt file in your build directory should >> give you full and separate control of the C compiler, the Ada compiler, >> and >> the Ada executable builder. Let me know if that is not the case. > > This worked, thanks! I was able to get both ADA and Aquaterm to compile by > doing the following (assuming macada standard install): > > (1) Set the environment variable CC to /usr/bin/gcc. > (2) Set the environment variable CXX to /usr/bin/g++. > (3) Run cmake. > (4) Run ccmake and enable ADA. > (5) Using ccmake, set the following: (it takes a few iterations to get it to > show you all these variables) > 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 am glad you got this to work, but I always feel it is a tricky business to use ccmake to set variables because of caching issues (as indicated by all the retries that were necessary). To make life simpler, why not set the ADA environment variable like I suggested (e.g., in this case to /usr/local/ada-4.3/bin/gcc)? That should automatically give you GNAT_EXECUTABLE_BUILDER as a bonus. I also suggest you set the CMAKE_LIBRARY_PATH environment variable so that GNAT_LIB will automatically be found. In sum, use the environment variables (I have a file that sets this up for me in my case) to make life easy. > I can't get the ADA examples to work though, it looks like the library > dependencies are not properly specified: > > 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-3/src/ > libplplotd.9.dylib (compatibility version 0.0.0, current version 0.0.0) > /usr/local/lib/libltdl.3.dylib (compatibility version 5.0.0, current > version 5.4.0) > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current > version 88.1.10) > /Users/hbabcock/Documents/OpenSource/PLplot/plplot-CBS-3/lib/ > csa/libcsirocsa.0.dylib (compatibility version 0.0.0, current version 0.0.0) > /Users/hbabcock/Documents/OpenSource/PLplot/plplot-CBS-3/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/ada-4.3/lib/libgcc_s.1.dylib (compatibility version 1.0.0, > current version 1.0.0) > > otool -L libplplotadad.dylib > libplplotadad.dylib: > libplplotadad.0.0.0.dylib (compatibility version 0.0.0, current > version 0.0.0) > /Users/hbabcock/Documents/OpenSource/PLplot/plplot-CBS-3/src/ > libplplotd.9.dylib (compatibility version 0.0.0, current version 0.0.0) > libgnat-4.3.dylib (compatibility version 0.0.0, current version > 0.0.0) > /usr/local/lib/libltdl.3.dylib (compatibility version 5.0.0, current > version 5.4.0) > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current > version 88.1.10) > /Users/hbabcock/Documents/OpenSource/PLplot/plplot-CBS-3/lib/ > csa/libcsirocsa.0.dylib (compatibility version 0.0.0, current version 0.0.0) > /Users/hbabcock/Documents/OpenSource/PLplot/plplot-CBS-3/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) > /usr/local/ada-4.3/lib/libgcc_s.1.dylib (compatibility version 1.0.0, > current version 1.0.0) > > Note that there is no path for libplplotadad.0.0.0.dylib and > libgnat-4.3.dylib. One issue is the internal library libplplotd is found in the build tree at run time, but not the internal library libplplotadad. So look for some difference in their build options and fix it. (You can also work around the issue by setting the Mac OS X equivalent of LD_LIBRARY_PATH, but I would prefer you to do the fix.) A different issue is the external library libgnat-4.3.dylib is not found at run time. For that case, you are going to have to set the Mac OS X equivalent of LD_LIBRARY_PATH to /usr/local/ada-4.3/lib/gcc/powerpc-apple-darwin8/4.3.0/adalib/ so that external library will be found at run time. > > Also libplplotadad is not being copied to /usr/local/bin upon running "make > install". Excluding installation was intended in the old days when our Ada interface had not settled down yet, but now that it is more stabilized, I invite any interested volunteer to implement the installation for libplplotadad (dead easy), configure the pkg-config file for libplplotadad (more difficult), and implement the example installation and installed examples build (more difficult). The reason why I am calling for volunteers is I am pretty tied up this summer with research, and it would be a good CMake learning experience for said volunteer to follow (say) how we configure the pkg-config file for our C++ library, and set up the install build for the C++ examples, then follow through by analogy for the Ada case. CMake is really pretty easy to understand (I started with zero knowledge and no CMake-based build system a year ago) so it really is only a matter of confidence to dive right in and deal with build issues that come up. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); PLplot scientific plotting software package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel