Skip to content

Commit 636ffc4

Browse files
authored
Add note for compiling eigenpy with python3 on macOS
Getting eigenpy (and pinocchio) to compile on macOS with python3 took me some effort. The required trick turned out to "only" add `-DPYTHON_EXECUTABLE=\`which python3\`` to the cmake argument. Do you think this is worth adding to the README.md/installation instructions? I am happy to provide something similar for pinocchio as well.
1 parent 5f61bdc commit 636ffc4

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,23 @@ directory:
2323
Please note that CMake produces a `CMakeCache.txt` file which should
2424
be deleted to reconfigure a package from scratch.
2525

26+
#### Compiling for python3 on macOS
27+
28+
Make sure you have boost for python3 installed. If you use homebrew, you can install it via `brew install boost-python3`.
29+
30+
Assuming you have python2 and python3 installed on your system, you can compile for python3 using
31+
32+
```
33+
cmake -DPYTHON_EXECUTABLE=`which python3` ..
34+
```
35+
36+
In case you get an error as only the libraries for python2 are found, make sure macOS can find the python3 libraries. One way to ensure this is by adding a symbolic link to the python3 libraries like
37+
38+
```
39+
ln -s /usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/libpython3.7.dylib /usr/loca/lib/libpython3.7.dylib
40+
```
41+
42+
where the abolve file source path was determined by looking at the output of `brew ls --verbose python3 | grep libpython3`.
2643

2744
### Dependencies
2845

0 commit comments

Comments
 (0)