[vtk-developers] Re: VTK Python Installation [was: VTK 5.0 branch in mid-August]

Brad King brad.king at kitware.com
Wed Aug 3 14:25:01 EDT 2005


Prabhu Ramachandran wrote:
>>>>>>"David" == David Gobbi <dgobbi at atamai.com> writes:
>     David> If there was a way to use rpath to force python modules to
>     David> search for .so files in their own directory, then that
>     David> would be fine.  But as far as I know, rpath with relative
>     David> paths doesn't work this way, and using a chdir trick just
>     David> doesn't seem right.  However, if it works, it is worth
>     David> considering unless it is known to cause other things to
>     David> break.
> 
> AFAICT, and according to my tests under Linux (Debian sarge, i386),
> setting '.' in the rpath allows the Python modules to search for
> others in the current directory.  However, I have no idea if this is
> Linux specific or not.  Maybe Brad will be able to clarify?
> 
> If this does work on all unices then the chdir trick is a possibility,
> although I still think the Apple solution is cleaner.

The two approaches are not mutually exclusive.  I like the Apple 
approach too.  The actual module that gets loaded can be put in the 
site-packages directory, but since it links to the vtk python shared 
libraries they must be found somehow.  My solution uses the rpath/chdir 
trick to accomplish this part.  It has been tested on several unices and 
should work for any unix that supports rpath.  Note that OSX does not 
support rpath but does allow a path to be put in the soname field of a 
library, which can be used to approximate rpath behavior.

I thinks the real solution is to finally put the shared library version 
numbers on the VTK libraries and install them in lib/ instead of 
lib/vtk.  Then the system ld.so.conf should find the libraries.  For 
users that install into another prefix it is their problem to get its 
lib/ directory in the shared library search path.  We could then use the 
rpath/chdir trick only when creating binary tarballs or CDs.

Comments?
-Brad



More information about the vtk-developers mailing list