# builing on OSX XCode 12.0

**URL:** https://discourse.vtk.org/t/builing-on-osx-xcode-12-0/4286
**Category:** Support
**Created:** [September 23, 2020, 10:10am UTC](https://discourse.vtk.org/t/builing-on-osx-xcode-12-0/4286 "2020-09-23T10:10:44Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![djduke](https://discourse.vtk.org/user_avatar/discourse.vtk.org/djduke/32/2174_2.png) [@djduke](https://discourse.vtk.org/u/djduke)
#### Post date: [September 23, 2020, 10:10am UTC](https://discourse.vtk.org/t/builing-on-osx-xcode-12-0/4286/1 "2020-09-23T10:10:44Z")

</div>

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

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [September 23, 2020, 2:40pm UTC](https://discourse.vtk.org/t/builing-on-osx-xcode-12-0/4286/2 "2020-09-23T14:40:19Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/cory.quammen/32/6751_2.png) [@cory.quammen](https://discourse.vtk.org/u/cory.quammen)
#### Post date: [September 23, 2020, 8:24pm UTC](https://discourse.vtk.org/t/builing-on-osx-xcode-12-0/4286/3 "2020-09-23T20:24:34Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![djduke](https://discourse.vtk.org/user_avatar/discourse.vtk.org/djduke/32/2174_2.png) [@djduke](https://discourse.vtk.org/u/djduke)
#### Post date: [September 24, 2020, 6:42pm UTC](https://discourse.vtk.org/t/builing-on-osx-xcode-12-0/4286/4 "2020-09-24T18:42:35Z")

</div>

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

---

<div class="post-metadata">

### Author: ![djduke](https://discourse.vtk.org/user_avatar/discourse.vtk.org/djduke/32/2174_2.png) [@djduke](https://discourse.vtk.org/u/djduke)
#### Post date: [October 18, 2020, 4:33pm UTC](https://discourse.vtk.org/t/builing-on-osx-xcode-12-0/4286/5 "2020-10-18T16:33:19Z")

</div>

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

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [October 19, 2020, 12:56pm UTC](https://discourse.vtk.org/t/builing-on-osx-xcode-12-0/4286/6 "2020-10-19T12:56:20Z")

</div>

> [@djduke](#):
>
> set(CMAKE\_BUILD\_RPATH:STRING=“/Library/Developer/CommandLineTools/Library/Frameworks/”)

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)
