Difference between revisions of "Avoid LD LIBRARY PATH"
|Line 6:||Line 6:|
Latest revision as of 16:53, 29 October 2015
First of all, you need to be aware that nothing particular is required if you do *not* install the software or you install it in system directories.
A common solution adopted to make libraries available in the other cases is to use the LD_LIBRARY_PATH environment variable. However some people strongly discourage this solution.
It is possible to avoid setting LD_LIBRARY_PATH, using the rpath. In other words you can instruct cmake to pass flags to the compiler so that binaries contains all the information to localize the variables they need. This achieved by setting the following flags to true in cmake:
Nothing to do, RPATH is automatically enabled. RPATH can be disabled by setting the CMAKE_SKIP_INSTALL_RPATH option to ON.
ICUB_INSTALL_WITH_RPATH = TRUE
- Why LD_LIBRARY_PATH is bad?
- Commands to inspect the rpath or dynamic libraries needed by an executable:
objdump -x iKinArmCtrl | grep NEEDED
objdump -x iKinArmCtrl | grep RPATH