[vtk-developers] Fixing VTK Python Installation

Brad King brad.king at kitware.com
Thu Aug 11 13:24:10 EDT 2005


Prabhu,

I've just committed changes that cause VTK libraries to be installed to
PREFIX/lib instead of PREFIX/lib/vtk.  The Tcl wrappers have been
updated to be installed for the Tcl way of doing things.  Since there 
were no python install rules other than setup.py before I have left it
unchanged, so it is probably broken.

Now that the VTK libraries have versions and are installed in the proper
place it is time to get the python install working as we discussed.  Do
you have time to do this?  We are planning to branch 5.0 in the next
week or two.

Here are a couple concerns I still have:

1.) If more than one version of VTK is installed (say 5.0 and 5.2) how 
can the desired version be selected by python?  In tcl one can write

   package require -exact vtk 5.0

or

   package require -exact vtk 5.2

and the proper version will be loaded.  This is because things get 
installed to PREFIX/lib/vtk-<version> and PREFIX/lib is automatically 
added to the TCLLIBPATH by Tcl.  The pkgIndex.tcl file installed for 
each VTK version specifies that it provides a certain version of VTK.

What is the python equivalent for this?  If everything goes in 
site-packages how can multiple versions be installed?


2.) I think running "make install" or building the INSTALL target should 
be all that is needed to install VTK.  It has already been built with a 
specific version of python so it needs to be installed in only one 
place.  We could provide a VTK_INSTALL_PYTHON_DIR cache entry that 
defaults to lib/python-<version>/site-packages and is settable by the 
user.  Then the main install target could install things directly to 
that location by automatically running a disutils-style setup.py 
configured to get things from the proper part of the build tree.

Is there any reason to require setup.py to be executed by the user after 
building?  I think if a setup.py is provided at all it should be in the 
source tree and it should know how to build and install VTK with python 
wrapping.  IIRC, that would be consistent with other python extension 
module sources.

Comments?
-Brad




More information about the vtk-developers mailing list