[vtkusers] Installing VTK with X11 and Python wrapping on OS X

Martin Costabel costabel at wanadoo.fr
Wed Feb 25 19:08:16 EST 2009


Preet wrote:
> Hey all,
> 
> I've had a lot of trouble installing VTK with X11 (no cocoa or carbon) 
> and python wrapping on OS X Leopard.
> 
> Here's what I change from defaults in CMakeCache.txt:
[]
> VTK_WRAP_PYTHON: OFF

OFF? I thought you wanted python wrapping?

[]
>     from libvtkCommonPython import *
> ImportError: 
> dlopen(/Library/Python/2.5/site-packages/VTK-5.2.1-py2.5.egg/vtk/libvtkCommonPython.so, 
> 10): Library not loaded: libvtkCommonPythonD.5.2.dylib
>   Referenced from: 
> /Library/Python/2.5/site-packages/VTK-5.2.1-py2.5.egg/vtk/libvtkCommonPython.so
>   Reason: image not found

Look at libvtkCommonPython.so with "otool -L libvtkCommonPython.so" to 
see where it thinks libvtkCommonPythonD.5.2.dylib is living. If it does 
not specify a path, as I suspect, then you can set the environment 
variable DYLD_FALLBACK_LIBRARY_PATH to the directory where this dylib is 
living (assuming vtk built and installed it somewhere).

You may be victim of a bug in cmake that does not do the right 
install_name_tool tricks for python modules as it does for dylibs and 
for other executables. You can build with

VTK_USE_RPATH=ON

but you must then set, during build time, the environment variable 
DYLD_LIBRARY_PATH to `pwd`/bin, otherwise the executables that run at 
build time won't find their dylibs.

I have been bitten by this when building the Fink package for vtk52, but 
Fink has now all 3 variants x11, carbon, and cocoa, that build correctly.

-- 
Martin




More information about the vtkusers mailing list