I installed the Python bindings of VTK 5.1 correctly. In Python, import vtk worked, but import itk did not work yet. So I wanted to install the Python bindings of ITK 4.2.
I needed to install SWIG 2.0.7, and from the error message which arose during ./configure in the SWIG source directory, I understood I needed to install pcre. So I chose the version 8.31 of pcre. Here is a summary of the process:
(VTK + Python) ---> This works.
(ITK + Python) ---> SWIG needed ---> pcre needed
Now that pcre is installed, my problem is yum has stopped working:
[root@wok build]# yum
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:
libvtkIOPythonD.so.5.10: cannot open shared object file: No such file or directory
Please install a package which provides this module, or
verify that the module is installed correctly.
It's possible that the above module doesn't match the
current version of Python, which is:
2.7 (r27:82500, Sep 16 2010, 18:02:00)
[GCC 4.5.1 20100907 (Red Hat 4.5.1-3)]
If you cannot solve this problem yourself, please go to
the yum faq at:
http://yum.baseurl.org/wiki/Faq
I wonder if I should add variables to the PATH.
Maybe it is related to a problem I had with SWIG: it worked as a user but not as root.
wok ~ $ swig -swiglib
/usr/local/share/swig/2.0.7
[root@wok home]# swig -swiglib
swig: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory
I had to add one line to .bashrc of the root user to make swig work with both the user and the root:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/
There could be something with the Python path.
In Python, I noticed I could import vtk as a user, but not as root.
wok ~ $ python
Python 2.7 (r27:82500, Sep 16 2010, 18:02:00)
[GCC 4.5.1 20100907 (Red Hat 4.5.1-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import vtk
>>>
but:
[root@wok ~]# python
Python 2.7 (r27:82500, Sep 16 2010, 18:02:00)
[GCC 4.5.1 20100907 (Red Hat 4.5.1-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import vtk
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/user/wok/home/Softwares/VTK_5.1/build/Wrapping/Python/vtk/__init__.py", line 41, in <module>
from vtkCommonPython import *
ImportError: libvtkCommonPythonD.so.5.10: cannot open shared object file: No such file or directory
PCRE seems to me to be installed correctly:
[root@wok build]# pcretest -C
PCRE version 8.31 2012-07-06
Compiled with
8-bit support only
No UTF-8 support
No Unicode properties support
No just-in-time compiler support
Newline sequence is LF
\R matches all Unicode newlines
Internal link size = 2
POSIX malloc threshold = 10
Default match limit = 10000000
Default recursion depth limit = 10000000
Match recursion uses stack
and
[root@wok build]# locate libpcre
/lib64/libpcre.so.0
/lib64/libpcre.so.0.0.1
/usr/lib64/libpcrecpp.so.0
/usr/lib64/libpcrecpp.so.0.0.0
/usr/lib64/libpcreposix.so.0
/usr/lib64/libpcreposix.so.0.0.0