Skip to content Skip to sidebar Skip to footer

Alternative For The Dyld_library_path-trick Since Mac Os 10.11 El Capitan With System Integrity Protection

Here is what I have: Mac OS 10.11 El Capitan python 2.7.12, installed from python.org under /Library/Frameworks/Python.framework/ PyCharm 2016.2.3 vtk 7.1.0 Here is what I do: B

Solution 1:

After a long struggle, I was able to solve the last bit of my problem.

By setting a fixed value for the RPATH Run-Path dependent Libraries of the installed binaries, my linking problems are gone.

There are different possibilities to achieve this. I guess one option is to use install_name_tool. For me, the easiest was to build vtk with appropriate CMake flags. Here my updated call to cmake, where CMAKE_MACOSX_RPATH and CMAKE_INSTALL_RPATH make the difference:

    cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release \
              -DVTK_WRAP_PYTHON=ON \
              -DBUILD_EXAMPLES=OFF \
              -DBUILD_SHARED_LIBS=ON \
              -DBUILD_TESTING=OFF \
              -DCMAKE_INSTALL_PREFIX="/opt/dev/versions/vtk/vtk-7.1.0-shared" \
              -DCMAKE_MACOSX_RPATH=ON \
              -DCMAKE_INSTALL_RPATH="/opt/dev/versions/vtk/vtk-7.1.0-shared/lib" \
              -DPYTHON_INCLUDE_DIR="/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/" \
              -DPYTHON_LIBRARY="/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib"

Read here more about CMake's rpath handling. Note that otool -L vtkCommonCorePython.so (for an example) will still write @rpath in the output, but the value still is fixed.

@rpath/libvtkCommonCorePython27D-7.1.1.dylib (compatibility version 0.0.0, current version 0.0.0)
@rpath/libvtkWrappingPython27Core-7.1.1.dylib (compatibility version 0.0.0, current version 0.0.0)
/Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.0)
@rpath/libvtksys-7.1.1.dylib (compatibility version 0.0.0, current version 0.0.0)
@rpath/libvtkCommonCore-7.1.1.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)

Post a Comment for "Alternative For The Dyld_library_path-trick Since Mac Os 10.11 El Capitan With System Integrity Protection"