Last active
August 24, 2017 13:03
-
-
Save chrismullins/e0bbdee84eb94c3a6c81 to your computer and use it in GitHub Desktop.
Setup ITK with python wrapping
This file contains 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
BASEDIR=`pwd` | |
mkdir python-3.4.2 && cd python-3.4.2 | |
PYTHONDIR=`pwd` | |
wget https://www.python.org/ftp/python/3.4.2/Python-3.4.2.tar.xz | |
tar xf Python-3.4.2.tar.xz | |
mkdir build && mkdir install && cd build | |
CFLAGS=-fPIC CPPFLAGS=-fPIC $PYTHONDIR/Python-3.4.2/configure --prefix=$PYTHONDIR/install | |
make | |
make install | |
cd $BASEDIR | |
mkdir ITK && cd ITK | |
ITKDIR=`pwd` | |
git clone git://itk.org/ITK.git | |
mkdir build && mkdir install && cd build | |
cmake $ITKDIR/ITK -DITK_WRAP_PYTHON:BOOL=ON -DPYTHON_EXECUTABLE:PATH=$PYTHONDIR/install/bin/python3 -DPYTHON_LIBRARY:PATH=$PYTHONDIR/install/lib/libpython3.4m.a -DPYTHON_INCLUDE_DIR:PATH=$PYTHONDIR/install/include/python3.4m -DPY_SITE_PACKAGES_PATH=$PYTHONDIR/install/lib/python3.4/site-packages $ITKDIR/ITK | |
make -j16 > output.txt 2>&1 & | |
$PYTHONDIR/install/bin/pyvenv --system-site-package $ITKDIR/wrapitk-venv | |
VENVDIR=$ITK/wrapitk-venv | |
cd $VENVDIR/lib/python3.4/site-packages | |
ln -s $ITKDIR/build/Wrapping/Generators/Python/WrapITK.pth |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment