Linking with installed instead of local

Issue #24 resolved
Frank Dellaert created an issue

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)

  1. Richard Roberts

    yes I'll take a look - cmake is supposed to take care of that automatically. maybe we're doing something to prevent it.

  2. Richard Roberts

    @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?

  3. Richard Roberts

    BTW I checked through the cmake files to see if we were somewhere overriding any rpath settings but it doesn't seem we are.

  4. Frank Dellaert 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
    
  5. Richard Roberts

    Can you please use 'otool -L unitTestProgram' to see which libraries are being used, and paste the output here?

  6. Richard Roberts

    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.

  7. Richard Roberts

    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.

  8. Log in to comment