This is probably something very simple, but I cannot find the answer. I would like to remove all references to rpath and have my executable and libraries be controlled by LD_LIBRARY_PATH. According to the wiki, that's the default behavior. However, I am finding it does not work so I set several options and nothing seems to work. I think I might have stumbled into a bug in the libstdc++, but want to check:

Currently I have:

# use, i.e. don't skip the full RPATH for the build tree
SET(CMAKE_SKIP_BUILD_RPATH FALSE)

# when building, don't use the install RPATH already
# (but later on when installing)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)

# the RPATH to be used when installing
SET(CMAKE_INSTALL_RPATH "")

# don't add the automatically determined parts of the RPATH
# which point to directories outside the build tree to the install RPATH
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)

I compile my code on an Ubuntu 12.04.5 box for compatibility reasons.

When I install on an Ubuntu 16.04 which I also compile for, the error of my executable I get is the following:

/usr/local/mrViewer-v4.3.1-Linux-64/bin/mrViewer: relocation error: /usr/local/lib/libIlmCtl.so.1.5.0: symbol _ZTTNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEE version GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference

If I remove /usr/local/lib/libIlmCtl.so.1.5.0 from its location my executable works. I am also shipping a version of libstdc++.so.6 with my executable, which might be a little weird.

The questions I would like some clarification are:

1) Do all the libs that my executable links to should have the rpath removed?

2) Why when I install an executable without rpath:

Set runtime path of "/usr/local/bin/exrmultiview" to ""

I can still run it even if LD_LIBRARY_PATH is unset?

3) Why does running 'readelf -d myexecutable | grep RPATH' returns nothing

--
Gonzalo Garramuño

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

Reply via email to