Linking with installed instead of local
I frequently have the issue that unless I install, unit tests fail with dynamic linking errors. That seems to suggest that the installed library is preferred over the locally built one. Richard, is this something you can fix easily?
Comments (8)
-
-
@fdellaert, I can't see any obvious reason this would happen - it doesn't happen on my machine. CMake normally sets up library "rpath"s so that this works correctly. Is there something about the configuration of your machine, like how do you set up your LD_LIBRARY_PATH or DYLD_LIBRARY_PATH ? How do other programs link to gtsam?
-
BTW I checked through the cmake files to see if we were somewhere overriding any rpath settings but it doesn't seem we are.
-
reporter DYLD_LIBRARY_PATH=/Users/frank/lib:/Library/Frameworks/Intel_IPP.framework/Libraries:/Users/frank/projects/ARToolKitPlus_MacOS/lib LD_LIBRARY_PATH=/Users/frank/lib:/Library/Frameworks/Intel_IPP.framework/Libraries:/Users/frank/projects/ARToolKitPlus_MacOS/lib
-
Can you please use 'otool -L unitTestProgram' to see which libraries are being used, and paste the output here?
-
reporter I will when I see the problem again...
-
Ok, though you can do it even if you're not getting a crash - it will tell you which library is used at run time. But no rush, whenever you do it is fine.
-
- changed status to resolved
I checked the rpaths and they appear to be working correctly - in the build-directory exes, paths to the build-directory libraries are specified as absolute paths, which are subsequently removed in the installed libraries and exes. Closing this because we can no longer reproduce it.
- Log in to comment
yes I'll take a look - cmake is supposed to take care of that automatically. maybe we're doing something to prevent it.