[vtkusers] VTK 5.4.2 build with Python Wrapping on Ubuntu 9.10: ImportError: libvtkCommonPythonD.so.5.4, LD_LIBRARY_PATH, /etc/ld.so.conf, /etc/ld.so.conf.d/vtk.conf
Jonathan Winterflood
jonathan.winterflood at gmail.com
Wed Mar 17 03:41:12 EDT 2010
Hi list,
I have built and installed the 5.4.2 release of VTK from source on Ubuntu
9.10, with Python wrappings (not Java or Tcl), and had some difficulty
getting them recognized by python (2.6.4), namely:
>>> from vtk import *
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File
"/usr/local/lib/python2.6/dist-packages/VTK-5.4.2-py2.6.egg/vtk/__init__.py",
line 41, in <module>
from common import *
File
"/usr/local/lib/python2.6/dist-packages/VTK-5.4.2-py2.6.egg/vtk/common.py",
line 7, in <module>
from libvtkCommonPython import *
ImportError: libvtkCommonPythonD.so.5.4: cannot open shared object file: No
such file or directory
My build was a typical out-of-source one:
$ ls -d VTK
VTK/
$ mkdir build
$ cd build
$ ccmake ../VTK
$ make -j 3
$ sudo make install
As far as I can tell, the python egg was properly installed in
/usr/local/lib/python2.6/dist-packages/VTK-5.4.2-py2.6.egg
And the rest of VTK in /usr/local/lib/vtk-5.4
According to Wrapping/Python/README.txt this should be enough, but I found
that I also needed to add /usr/local/lib/vtk-5.4 to LD_LIBRARY_PATH to get
python to find libvtkCommonPythonD.so.5.4
Unwilling to have to add this to .bash-rc files and so-on, I found that
creating a /etc/ld.so.conf.d/vtk.conf containing this path, then running
ldconfig seems to work just as well. (as per
http://koobmeej.blogspot.com/2007/04/alternative-to-ldlibrarypath.html, but
using an included file instead of editing the master ld.so.conf file)
Should this have been necessary or am I missing something in my
build/install?
If this seems to be the proper way to finish the install, maybe this should
be added to the install target?
For info, I ran "make test" from the build folder and 97% pass with the
/etc/ld.so.conf.d/vtk.conf entry, compared to 3% without. Results with the
entry below:
The following tests FAILED:
35 - TestNumpySupportPython-image (Failed)
141 - HyperPython (Failed)
142 - HyperScalarBarPython (Failed)
156 - TestBoxFunctionPython (Failed)
390 - TestLabelPlacer (SEGFAULT)
391 - TestLabelPlacer2D (SEGFAULT)
392 - TestLabelPlacerCoincidentPoints (SEGFAULT)
402 - TestTextActorAlphaBlending (SEGFAULT)
403 - TestTextActorDepthPeeling (SEGFAULT)
404 - TestTextActor3DAlphaBlending (SEGFAULT)
405 - TestTextActor3DDepthPeeling (SEGFAULT)
444 - TestTilingPython (Failed)
496 - TestCaptionActorPython (SEGFAULT)
522 - TestImplicitPlaneWidget (Failed)
524 - TestOrientationMarkerWidget (SEGFAULT)
528 - ImagePlaneWidget (SEGFAULT)
539 - TestOrthoPlanes (SEGFAULT)
569 - Infovis-TestArcEdges (Failed)
624 - Geovis-TestGeoView (SEGFAULT)
625 - Geovis-TestLabeledGeoView2D (SEGFAULT)
Thanks for your help,
Jonathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100317/058943ba/attachment.htm>
More information about the vtkusers
mailing list