Hi Jim, Thanks for the explanation. I think the right thing to do is start a thread on osg-users about this issue, calling for feedback from other OSX users. Once we have more information on the nature of this issue we'll be in a better place to decide how to resolve it.
Could you please start a thread on osg-users explaining the issue you are up against and your proposed solution and ask for feedback from fellow OSX users. Cheers, Robert. On Wed, Dec 2, 2009 at 5:36 PM, Jim Brooks <[email protected]> wrote: > Hi Robert, > >>Just disabling the FIND_LIBRARY(MATH_LIBRARY m) for all Apple builds >>doesn't feel right. The are lots of other Apple developers using the >>CMake build and haven't had problems with these particular line of the >>OpenSceneGraph/CMakeLists.txt so I am surprised that you are having >>problems. Given that there is chance that making this change will >>break the build for other Apply developers I feel that this specific >>change is inappropriate to apply at this time. >> >>It would be useful to try and work what combination of OS/XCode that >>the problem you see exists and where it doesn't exist, and where the >>MATH_LIBRARY needs to be defined, and where not. Could you write a >>post to osg-users explaining the error you are seeing and the version >>of the OSX/XCode etc and call for feedback from other OSX users. From >>this feedback we can try and come up with a workable solution. > > > This linker problem surfaced after I switched from Fink to MacPorts. > > Apple doesn't really have "libm" but rather has 2 symlinks: > > ........ > [j...@mac]:/usr/lib dir libm.* > lrwxr-xr-x 1 root wheel 15 Apr 12 2009 libm.dylib -> libSystem.dylib > > [j...@mac]:/Developer/SDKs/MacOSX10.4u.sdk/usr/lib dir libm.dylib > lrwxr-xr-x 1 root wheel 15 Aug 16 18:49 libm.dylib -> libSystem.dylib > ........ > > The linker gets confused by these two different libSystem.dylib. > > Removing "/usr/lib/libm.dylib" from the linker's args solves the problem. > > So OSG has been linking the "UNIX way" but not the "Apple way" > (since UNIX includes APPLE on cmake). > > Don't know if changing this would break Leopard/SnowLeopard > (I'm using Tiger). > > Maybe try this change in OSG's development branch??? > > IF(UNIX) > # Not sure what this will do on Cygwin and Msys > # Also, remember OS X X11 is a user installed option so it may not exist. > FIND_PACKAGE(X11) > # Some Unicies need explicit linkage to the Math library or the build > fails. > IF(NOT APPLE) > FIND_LIBRARY(MATH_LIBRARY m) > ENDIF(NOT APPLE) > > ............................................................................ > > > Linking CXX shared library ../../lib/libosgText.dylib > cd > /Users/jimb/tmp/OpenSceneGraph-2.8.2-squareBracketFix-appleMacFix/src/osgText > && /opt/local/bin/cmake -E cmake_link_script CMakeFiles/osgText.dir/link.txt > -- > verbose=1 > /usr/bin/c++ -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk > -mmacosx-vers > ion-min=10.4 -O2 -mmacosx-version-min=10.4 -ftree-vectorize > -fvisibility-inline > s-hidden -dynamiclib -headerpad_max_install_names -compatibility_version > 55.0.0 > -current_version 2.8.2 -o ../../lib/libosgText.2.8.2.dylib -install_name > /Users/ > jimb/tmp/OpenSceneGraph-2.8.2-squareBracketFix-appleMacFix/lib/libosgText.55.dyl > ib CMakeFiles/osgText.dir/DefaultFont.cpp.o CMakeFiles/osgText.dir/Font.cpp.o > CM > akeFiles/osgText.dir/Font3D.cpp.o CMakeFiles/osgText.dir/String.cpp.o > CMakeFiles > /osgText.dir/FadeText.cpp.o CMakeFiles/osgText.dir/TextBase.cpp.o > CMakeFiles/osg > Text.dir/Text.cpp.o CMakeFiles/osgText.dir/Text3D.cpp.o > CMakeFiles/osgText.dir/Version.cpp.o ../../lib/libosgDB.2.8.2.dylib > ../../lib/libosg.2.8.2.dylib ../../lib/libOpenThreads.2.4.0.dylib -framework > AGL > -framework OpenGL /usr/lib/libm.dylib > -lpthread -framework Carbon -framework AGL -framework OpenGL > ld: Undefined symbols: > _acl_copy_ext_native referenced from CarbonCore expected to be defined in > libSys > tem > _acl_copy_int_native referenced from CarbonCore expected to be defined in > libSys > tem > _task_name_for_pid referenced from CarbonCore expected to be defined in > libSyste > m > /usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/libtool: internal link edit > command > failed > make[2]: *** [lib/libosgText.2.8.2.dylib] Error 1 > make[1]: *** [src/osgText/CMakeFiles/osgText.dir/all] Error 2 > make: *** [all] Error 2 > _______________________________________________ > osg-submissions mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org > _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
