Created
January 27, 2016 10:00
-
-
Save kevin-keraudren/40489545b30ad3f8ca9c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x | |
set -e | |
git clone https://github.com/Kitware/VTK.git | |
cd VTK | |
mkdir build | |
cd build | |
# we want to install it in our virtual environment | |
virtualenv_root=`python -c 'import sys; print(sys.prefix)'` | |
# we want to compile against our Python 3 installed with brew | |
brew_root="/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5" | |
cmake -D BUILD_TESTING:BOOL=OFF \ | |
-D CMAKE_BUILD_TYPE:STRING=Release \ | |
-D CMAKE_INSTALL_PREFIX:PATH=${virtualenv_root} \ | |
-D VTK_WRAP_PYTHON:BOOL=ON \ | |
-D VTK_PYTHON_VERSION:STRING=3 \ | |
-D PYTHON_INCLUDE_DIR:PATH=${brew_root}/include/python3.5m/ \ | |
-D PYTHON_LIBRARY:FILEPATH=${brew_root}/lib/libpython3.5.dylib \ | |
-D VTK_INSTALL_PYTHON_MODULE_DIR:PATH=${virtualenv_root}/lib/python3.5/site-packages/ \ | |
.. | |
make -j4 | |
make install | |
# add a line to your bash_profile: | |
# export DYLD_FALLBACK_LIBRARY_PATH=`python -c 'import sys; print(sys.prefix)'`/lib |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Two small improvements:
$virtualenv_root
already exists as$VIRTUAL_ENV
, and$brew_root
should be determined by the output frompython3.5-config --prefix
.