[vtkusers] vtkpython:Linux SMP:SIGSEGV upon import vtk

donna at v1.wustl.edu donna at v1.wustl.edu
Fri Feb 28 10:10:19 EST 2003


Hi Brent,

Brent Goodrick wrote:
> That concerned me too (I'm on Red Hat 7.3 however and even building
> VTK on GCC 3.2.1), so I double checked that if I moved the VTK/bin
> somewhere, that the runtime linker could still find the shared libraries
> therein, provided LD_LIBRARY_PATH was set properly:
> 
>   cd /tmp/VTK/bin
>   cd ..
>   mv bin bin2
> 
>   # now change the LD_LIBRARY_PATH that ldd will lookup things in the
>   # bin2 directory:
>   LD_LIBRARY_PATH=`pwd`/bin2:$LD_LIBRARY_PATH
>   export LD_LIBRARY_PATH
> 
>   ldd bin2/libvtkCommonPython.so
> 
>   # ok now move it back as it was:
>   mv bin2 bin
> 
> ldd then spits out the fact that it found its dependency libraries in
> the bin2 directory:
> 
>         libvtkCommon.so => /tmp/VTK/VTK/bin2/libvtkCommon.so (0x402c6000)
[snip]
> If I did not add the bin2 directory, it would not find it.  If I did
> not move the bin directory to the bin2 directory and did not change
> the LD_LIBRARY_PATH, then it _would_ still find it because there must
> be a default path set inside the .so that is hardcoded to your build
> directory.

Note that after you mv bin2 bin, ldd resolves to
/tmp/VTK/VTK/bin2/libvtkCommon.so -- not /tmp/VTK/bin2/libvtkCommon.so. 
You've got /tmp/VTK and /tmp/VTK/VTK, evidently.  If you got rid of
/tmp/VTK/VTK, then you'd probably get a not found after moving bin2 bin,
until you updated your LD_LIBRARY_PATH.

> Notice above also that the libstdc++.so.5 was not found!  Why? because
> LD_LIBRARY_PATH does not include my special path to the GCC 3.2.1
> libstdc++.so* libraries.

Yes -- I copied my gcc libs to a directory in my LD_LIBRARY_PATH,
actually.

> Try using the following script, modifying the following script for
> your own use, being very careful to match up the proper directories to
> GCC_HEAD, VTK_HEAD (my non-standard variable names), and PYTHONHOME.

Based not only on ldd output, but also on my stack traces, I am
convinced python and vtkpython both are finding the right libraries. 
For whatever reason, however, vtkpython cannot load the vtk libraries.

Donna



More information about the vtkusers mailing list