Monday, November 24, 2008

building VTK on (intel) Mac OS 10.5

Based on [directions found here](https://svn.enthought.com/enthought/wiki/IntelMacPython25), I created a working build of VTK with Python bindings.

First, download the source from CVS, [here](http://www.vtk.org/get-software.php). You will need to make sure you have a recent version of [CMake](http://www.cmake.org/) installed as well. Then, go into the VTK directory and type:

mkdir build; cd build
ccmake ..

Press c to do the initial configuration. Set:

BUILD_SHARED_LIBS=ON
VTK_WRAP_PYTHON=ON

Press c again. Press t to look at the advanced options. This is where my directions diverge slightly from the enthought directions. I used the system python, which ccmake seems to recognize right away, so I only changed:

PYTHON_LIBRARY=-framework Python

Press c, then press g to generate the files. Then

make
make install

The make can take *forever*, so be patient.

One final thing to get vtk working with python is to go into the Build/Wrapping/Python directory and do a python build and install:

cd Wrapping/Python
python setup.py build
sudo python setup.py install

Done. Now you should be able to import vtk in python.