builing on OSX XCode 12.0

I’ve recently bumped my OSX to 10.15.6 (Catalina) with XCode 12.0 and have run into issues rebuilding VTK from a fresh git checkout. I have Python3 installed via MacPorts

The build goes fine. However when I try to run VTK:
vtkpython
dyld: Library not loaded: @rpath/Python3.framework/Versions/3.8/Python3
Referenced from: /usr/local/bin/vtkpython
Reason: image not found
Abort trap: 6

I haven’t changed shell so my paths should be the same. Looking at my environment and CMake settings I can’t see anything that looks wrong. Any suggestions on how to correct would be welcome.

thanks
David

Hmm. I’d make sure that your Python3 cache variables are consistent (all from MacPorts or all from the SDK). It appears as though you might have the MacPorts executable with the SDK framework?

If everything is the SDK library, you’ll need to add a flag CMAKE_INSTALL_RPATH to contain…wherever that Python3.framework exists.

I have run into the same problem. When running from the VTK build directory, you’ll want to add CMAKE_BUILD_RPATH:STRING=/Library/Developer/CommandLineTools/Library/Frameworks/ to your CMakeCache.txt file, run cmake again, and build again. Then it should work.

Thanks Cory.
In the process of implementing your suggestions I found that my xcode update had not been successful. once I’ve been able to repair it I’ll be able to try recompiling.

regards
David

still stuck on this. I’ve set RPATH in my CMakeLists file, its currently:
/Library/Developer/CommandLineTools/Library/Frameworks/
if I look in that directory I see
Python3.framework/
Yet running vtkpython gives
dyld: Library not loaded: @rpath/Python3.framework/Versions/3.8/Python3
However the Python3.framework directory does include Version/3.8 etc
Am I misinterpreting RPATH and including/missing a component?
Toconfirm the CMakeLists line is:

set(CMAKE_BUILD_RPATH:STRING="/Library/Developer/CommandLineTools/Library/Frameworks/")

I reconfigured rebuilt, re-installed, all from a fresh git clone

thanks
David

You’re confusing CMake syntax and the command line syntax. Either one will work:

  • cmake -DCMAKE_BUILD_RPATH:STRING=… (command line)
  • set(CMAKE_BUILD_RPATH "…") (CMake code)