[vtk-developers] Python installation issues: need feedback.

Prabhu Ramachandran prabhu at aero.iitm.ernet.in
Wed Jun 12 02:50:02 EDT 2002


hi,

Currently, the libvtk*Python*.so shared modules link to each other.
This causes difficulty when we have to install the Python modules.

Assume PY_LIB=libvtk*Python*.so

There are a few ways to work around the current problem.

 (1) Put PY_LIB in $prefix/lib/pythonX.Y/site-packages/vtk_python/
 However, this is not sufficient since the linker cannot see these
 libraries and because the modules link to each other they will not be
 imported.  To work around this we could simply insert
 $prefix/lib/pythonX.Y/site-packages/vtk_python/ into /etc/ld.so.conf
 or add this path to LD_LIBRARY_PATH.  This will work perfectly.

 (2) Put PY_LIB in $prefix/lib/vtk/ (as is done currently) and then
 add $prefix/lib/vtk to the PYTHONPATH.  However, this approach
 requires two things to be done:

    (i) $prefix/lib/vtk should already be in the linkers path.  This
    would require an entry in ld.so.conf or LD_LIBRARY_PATH.

    (ii) additioanally we'd need to change PYTHONPATH or add another
    (we need one anyway) appropriate vtk_lib.pth file.

 (3) Put PY_LIB in $prefix/lib and also set this directory in
 PYTHONPATH.  This approach is the worst since every blessed library
 in $prefix/lib might be potentially treated as python module.
 Besides that usually /usr/lib is a very large directory.  So, this is
 not a tolerable solution.

 (4) Modify the current python modules so that all the PY_LIB's link
 to one libvtkpythonbase.so or something that is installed in
 $prefix/lib (or somewhere on linkers path) and the PY_LIB's
 themselves go into the correct site-packages directory (as in
 approach(1)).


Option (4) is clearly the best and cleanest solution. (3) is the
worst.  For now (1) seems the best compromise since one needs to set
the LD_LIBRARY_PATH (or PATH under Win32) alone.  Option (2) is worse
than (1) because if PY_LIB goes into /usr/lib instead of /usr/lib/vtk
the situation degrades to option (3).

What do you folks think?  Any other ideas?  David, how would one go
about implementing (4)?  Is it possible at all?  IIRC you mentioned
something about it but indicated that it was hard to do.  I dont
remember clearly.  Could you please clarify.

BTW, last night I got a basic distutils based setup.py working for
VTK.  Its not perfect and the above issue is really unresolved (I
default to option (1) where the user has to set LD_LIBRARY_PATH) but
the rest seems to work fine.

I'll try and commit the setup.py sometime this week so that you can
play with it and give me feedback.  I'll mail the list later on how to
use it, issues etc.

Thanks!
prabhu



More information about the vtk-developers mailing list