[vtk-developers] Adding python version numbers to VTK python lib names

David Gobbi david.gobbi at gmail.com
Tue May 29 19:13:29 EDT 2012


Hi All,

I've pushed a gerrit branch that adds the python version number to
each of the VTK python libraries (not to the python modules, just
the libraries). E.g.:

libvtkCommonCorePython26D.so (library)
vtkCommonCorePython.so (module)

The intent is to assist the tireless volunteers who package VTK for
Linux distros.  Each linux distro usually has more than one version of
python that can be installed, and it is typical for python extension
packages to install for all versions of python.

E.g. for numpy, my linux box has two versions of the multiarray module:

/usr/lib/python2.6/site-packages/numpy/core/multiarray.so
/usr/lib/python2.7/site-packages/numpy/core/multiarray.so

Because python modules for different versions of python go into
different directories, they don't need to have the version number as
part of the filename.  But this is not true for python libraries, all
of which usually go directly into /usr/lib/.  Which is why it is nice
to have:

/usr/lib/libpython2.6.so
/usr/lib/libpython2.7.so
/usr/lib/libvtkCommonCorePython26D-6.0.1.so
/usr/lib/libvtkCommonCorePython27D-6.0.1.so

That way, a person can build and install VTK twice, with two different
versions of python, and have both active on their system at the same
time.

The gerrit branch is here:
http://review.source.kitware.com/#/t/706/

The "development" install wouldn't be as tidy but is still doable...
VTKTargets.cmake and vtkPython.h are currently work with a single
version of python, so distro maintainers would have to apply a patch
to these files to make them work with multiple versions of python.  If
anyone is interested in knowing exactly what the patch would have to
do, email me and I can provide the details.

 - David



More information about the vtk-developers mailing list