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

David Gobbi dgobbi at atamai.com
Wed Aug 3 14:52:39 EDT 2005


Brad King wrote:

> 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.

This sounds good.  If the default behaviour of VTK's cmake; make; make 
install was to put versioned and rpath-free libraries into 
/usr/local/lib, that would be wonderful.

I have spent a lot of time trying to help users who do "make install" 
and then get into trouble because the rpaths of the installed libraries 
point back to the source tree that they are monkeying with.  In fact 
I've been bitten by this several times, myself.  It seems that 
LD_LIBRARY_PATH is a better approach than rpath for running things from 
the source tree, and it would be easy to set LD_LIBRARY_PATH (or its 
equivalent depending on the flavor of UNIX) from a front-end script.

 - David






More information about the vtk-developers mailing list