This was the thread "[Plplot-devel] Linking problem with 64-bit Ada compiler on OS X 10.5.8 Leopard" but I've started a new one because the problem actually seems to be a compiler problem
Problem summary: I'm trying to build PLplot on OS X Leopard (10.5.8) with a 64-bit Ada compiler. The linker is encountering libraries of non-compatible architectures. I've done a bit of sleuthing on this problem and have discovered a potential explanation, or at least a place to look for problems. In my original post, below, there are three libraries which the linker reports as "file is not of required architecture." These libraries are: libplplotd.9.7.0.dylib libcsirocsa.0.0.1.dylib libqsastime.0.0.1.dylib Running lipo -info filename on results in Non-fat file: filename is architecture: x86_64 Non-fat means that it is a single-architecture file, e.g., no 32-bit code in this case. My earlier suspicion of possible problems in the Qt library were wrong. Now, here is a paragraph from lipo. (I'm guessing that lipo is an OS X thing and not Linux.) "The linker accepts universal (multiple-architecture) input files, but always creates a "thin" (single-architecture), standard Mach-O output file. The architecture for the output file is specified using the -arch option. If this option is not used, ld attempts to determine the output architecture by examining the object files in command line order. The first "thin" architecture determines that of the output file. If no input object file is a "thin" file, the native 32-bit architecture for the host is used." Here is a SUMMARY of running lipo on the files listed sent to the linker: * All Apple-supplied files are both 32- and 64-bits for both PPC and Intel processors EXCEPT THE CARBON FRAMEWORK WHICH IS 32 BITS AND SHOULD NOT BE LINKED WHEN DOING A 64-BIT BUILD. * All Qt libraries are 32- and 64-bits (Intel). * Two PLplot-built libraries are 32-bit and ONE OF THESE IS FIRST IN THE FILE LIST. The very first file in the file list is reported as 32-bit: Non-fat file: ./qt.cpp.o is architecture: i386 Architectures for the other files in the link list in order but not including the three reported above, are (sorry for mixing path styles): Non-fat file: /usr/local/plplot_build_dir/drivers/CMakeFiles/qt.dir/__/ bindings/qt_gui/plqt.cpp.o is architecture: i386 Architectures in the fat file: /usr/lib/libm.dylib are: ppc7400 ppc64 i386 x86_64 Architectures in the fat file: /Library/Frameworks/QtSvg.framework/ Versions/4/QtSvg are: x86_64 i386 [I'm assuming that all of the other Qt frameworks are the same.] Architectures in the fat file: /System/Library/Frameworks/ Carbon.framework/Versions/A/Frameworks/CarbonSound.framework/Versions/ A/CarbonSound are: i386 ppc7400 (There are several frameworks embedded within the main carbon.framework and I believe them to all be 32-bit but I have not checked all of them.) Architectures in the fat file: /usr/lib/libz.dylib are: ppc7400 ppc64 i386 x86_64 Architectures in the fat file: /System/Library/Frameworks/ ApplicationServices.framework/Versions/A/ApplicationServices are: ppc7400 ppc64 i386 x86_64 Architectures in the fat file: /usr/lib/libltdl.dylib are: ppc7400 ppc64 i386 x86_64 Architectures in the fat file: /usr/lib/libdl.dylib are: ppc7400 ppc64 i386 x86_64 The last library in the list is /usr/lib/libm.dylib which appears earlier. I believe that the second occurrence in the list can be removed. On Apr 14, 2010, at 12:53 AM, Jerry wrote: > I have just upgraded my Ada compiler (GNAT GPL 2009) because the one I > have been using has a small bug. The old version was 32 bits and the > new version is 64 bits. I'm on OS X 10.5.8 (Leopard). > > Bad idea. > > I've changed the paths in my build script (below) to accommodate the > new compiler. cmake sees it. The build goes OK until it hits a linking > problem. Here is the problem encountered when linking to a qt library. > FWIW, my Qt installation is the OS binary from > http://qt.nokia.com/downloads/mac-os-cpp/ > . > > > > > > Linking CXX shared module qt.so > cd /usr/local/plplot_build_dir/drivers && "/Applications/Programming/ > CMake 2.6-2.app/Contents/bin/cmake" -E cmake_link_script CMakeFiles/ > qt.dir/link.txt --verbose=1 > /usr/bin/c++ -bundle -headerpad_max_install_names -o qt.so > CMakeFiles/qt.dir/qt.cpp.o CMakeFiles/qt.dir/__/bindings/qt_gui/ > plqt.cpp.o ../src/libplplotd.9.7.0.dylib /usr/lib/libm.dylib - > framework QtSvg -framework QtGui -framework Carbon -framework AppKit - > framework QtXml -framework QtCore /usr/lib/libz.dylib -framework > ApplicationServices /usr/lib/libltdl.dylib /usr/lib/libdl.dylib ../ > lib/ > csa/libcsirocsa.0.0.1.dylib ../lib/qsastime/libqsastime.0.0.1.dylib / > usr/lib/libm.dylib > ld: warning in ../src/libplplotd.9.7.0.dylib, file is not of required > architecture > ld: warning in ../lib/csa/libcsirocsa.0.0.1.dylib, file is not of > required architecture > ld: warning in ../lib/qsastime/libqsastime.0.0.1.dylib, file is not of > required architecture > Undefined symbols: > "_plgesc", referenced from: > QtPLDriver::getTextPicture(unsigned int, unsigned int*, int, > double)in plqt.cpp.o > "_plOpenFile", referenced from: > plD_init_rasterqt(PLStream*) in qt.cpp.o > plD_init_svgqt(PLStream*) in qt.cpp.o > plD_init_epspdfqt(PLStream*) in qt.cpp.o > "_plP_setphy", referenced from: > plD_init_rasterqt(PLStream*) in qt.cpp.o > plD_init_svgqt(PLStream*) in qt.cpp.o > plD_init_epspdfqt(PLStream*) in qt.cpp.o > plD_init_qtwidget(PLStream*) in qt.cpp.o > plD_init_extqt(PLStream*) in qt.cpp.o > "_plGetFam", referenced from: > plD_bop_bmpqt(PLStream*) in qt.cpp.o > plD_bop_jpgqt(PLStream*) in qt.cpp.o > plD_bop_pngqt(PLStream*) in qt.cpp.o > plD_bop_ppmqt(PLStream*) in qt.cpp.o > plD_bop_tiffqt(PLStream*) in qt.cpp.o > plD_bop_svgqt(PLStream*) in qt.cpp.o > plD_bop_epspdfqt_helper(PLStream*, int) in qt.cpp.o > "_plP_setpxl", referenced from: > plD_init_rasterqt(PLStream*) in qt.cpp.o > plD_init_svgqt(PLStream*) in qt.cpp.o > plD_init_epspdfqt(PLStream*) in qt.cpp.o > plD_init_qtwidget(PLStream*) in qt.cpp.o > plD_init_extqt(PLStream*) in qt.cpp.o > "_plP_fci2hex", referenced from: > QtPLDriver::getFont(unsigned int)in plqt.cpp.o > QtPLDriver::getFont(unsigned int)in plqt.cpp.o > QtPLDriver::getFont(unsigned int)in plqt.cpp.o > "_plwarn", referenced from: > qt_family_check(PLStream*) in qt.cpp.o > "_c_plparseopts", referenced from: > plsetqtdev(QtExtWidget*, int, char**)in plqt.cpp.o > "_c_plcalc_world", referenced from: > QtExtWidget::mouseMoveEvent(QMouseEvent*) in plqt.cpp.o > QtExtWidget::mouseReleaseEvent(QMouseEvent*) in > plqt.cpp.o > "_plFamInit", referenced from: > plD_init_rasterqt(PLStream*) in qt.cpp.o > plD_init_svgqt(PLStream*) in qt.cpp.o > plD_init_epspdfqt(PLStream*) in qt.cpp.o > "_plParseDrvOpts", referenced from: > plD_init_rasterqt(PLStream*) in qt.cpp.o > plD_init_svgqt(PLStream*) in qt.cpp.o > plD_init_epspdfqt(PLStream*) in qt.cpp.o > plD_init_qtwidget(PLStream*) in qt.cpp.o > "_c_plgfci", referenced from: > QtPLDriver::drawText(PLStream*, EscText*) in plqt.cpp.o > QtPLWidget::drawText(PLStream*, EscText*) in plqt.cpp.o > "_plsc", referenced from: > _plsc$non_lazy_ptr in qt.cpp.o > _plsc$non_lazy_ptr in plqt.cpp.o > "_plRotationShear", referenced from: > QtPLDriver::drawText(PLStream*, EscText*) in plqt.cpp.o > QtPLWidget::drawText(PLStream*, EscText*) in plqt.cpp.o > ld: symbol(s) not found > collect2: ld returned 1 exit status > make[2]: *** [drivers/qt.so] Error 1 > make[1]: *** [drivers/CMakeFiles/qt.dir/all] Error 2 > make: *** [all] Error 2 > > > > > > Here is the build script: > > > > #!/bin/bash > > # Set environment so that cmake can find the Ada compiler, BLAS, and > LAPACK. > > # Following used for OS X 10.5 with MacAda 32-bit compiler. > #CMAKE_LIBRARY_PATH=/usr/local/ada-4.3/lib/gcc/i686-apple- > darwin9/4.3.0/adalib:\ > #/usr/lib/libblas.dylib:\ > #/usr/lib/liblapack.dylib:\ > #/usr/lib/libtcl.dylib:\ > #/usr/lib/libtk.dylib > > # Following used for OS X 10.5 with GNAT GPL 2009 64-bit installed > April 13, 2010. > CMAKE_LIBRARY_PATH=/usr/local/ada-4.3/lib/gcc/x86_64-apple- > darwin9.6.0/4.3.4/adalib:\ > /usr/lib/libblas.dylib:\ > /usr/lib/liblapack.dylib:\ > /usr/lib/libtcl.dylib:\ > /usr/lib/libtk.dylib > > export CMAKE_LIBRARY_PATH > > # cd to the build directory. > cd /usr/local/plplot_build_dir > > # Clean the build directory. > echo "Deleting most recent build and installation." > sudo rm -rf /usr/local/plplot_build_dir/* > > # Delete the installation directory. > sudo rm -rf /usr/local/plplot > > echo "Running cmake." > # Run cmake. > cmake \ > -DCMAKE_INSTALL_PREFIX=/usr/local/plplot \ > -DCMAKE_VERBOSE_MAKEFILE=ON \ > -DBUILD_TEST=ON \ > -DDEFAULT_NO_BINDINGS=ON \ > -DENABLE_ada=ON \ > -DENABLE_java=OFF \ > -DENABLE_tcl=OFF \ > -DENABLE_tk=OFF \ > -DENABLE_wxwidgets=OFF \ > -DPLD_aqt=OFF \ > -DPLD_wxwidgets=OFF \ > -DENABLE_qt=ON\ > -DHAVE_ADA_2007=OFF \ > -DBUILD_TEST=ON \ > -DBUILD_DOC=ON \ > /Users/jb/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/ > plplot >& cmake.out > > less cmake.out > > echo "Running make." > make > > echo "Running make install as root." > sudo make install > > echo "Finished installing PLplot." > > # Run ctest which builds the examples and runs them. See file called > run_ctest.sh. > echo "Running ctest to test examples." > cd /usr/local/plplot_build_dir > export DYLD_LIBRARY_PATH=/usr/local/plplot_build_dir/bindings/ada:\ > #/usr/local/ada-4.3/lib/gcc/i686-apple-darwin9/4.3.0/adalib # 32-bit > GNAT from MacAda.org > /usr/local/ada-4.3/lib/gcc/x86_64-apple-darwin9.6.0/4.3.4/adalib # 64- > bit GNAT GPL 2009 from AdaCore > ctest --verbose --tests-regex ada > > echo "Finished building and installing PLplot from SVN." > exit 0 > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Plplot-devel mailing list > Plplot-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/plplot-devel > ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel