Building VTK. DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON and python wrapper
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
Homebrew builds all software packages in a and then moves it to, e.g. /usr/local/Cellar/vtk//... and /usr/local/lib/vtk is a symlink to that dir.
We use DCMAKE_INSTALL_NAME_DIR and DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON to get the final RPATH correctly written into the libs, even if we build in a .
Then, just during the "make install", we add the /build/bin to DYLD_LIBRARY_PATH and that used to work well (before), since the freshly built libs can find each other.
Unfortunately, now we get the error:
make install [...] Linking CXX executable ../../bin/vtkpython [ 95%] Building CXX object Infovis/CMakeFiles/vtkInfovisPythonD.dir/vtkRISReaderPython.cxx.o [ 95%] [ 95%] Building CXX object Infovis/CMakeFiles/vtkInfovisPythonD.dir/vtkRandomGraphSourcePython.cxx.o Building CXX object Infovis/CMakeFiles/vtkInfovisPythonD.dir/vtkRandomLayoutStrategyPython.cxx.o ld: file not found: /usr/local/Cellar/vtk/5.8.0/lib/vtk-5.8/libvtkDICOMParser.5.8.dylib for architecture x86_64 collect2: ld returned 1 exit status [ 95%] make[2]: *** [bin/vtkpython] Error 1 make[1]: *** [Wrapping/Python/CMakeFiles/vtkpython.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs....
Obviously, some make target associated with python wrapping already expected the a dylib at the target install location (where it is not yet).
Now to my before-mentioned, ugly work-a-round: Is there a better way than to introduce a temporary symlink: /usr/local/Cellar/vtk/5.8.0/lib/vtk-5.8 ---> /build/bin ??? I put this symlink, then "make" then remove that symlink, then "make install". Seems to work. Python can import vtk.