[vtk-developers] VTK installation: shell scripts for env vars

Brad King brad.king at kitware.com
Thu Feb 16 19:11:02 EST 2006


David Gobbi wrote:
> I've recently started playing with the KWWidgets packages, and it has 
> this very nice feature that it creates shell scripts that set PATH, 
> TCLLIBPATH, and PYTHONPATH to make it very easy to use VTK and KWWidgets 
> directly from the build tree.
> 
> It would be great if VTK would also produce similar scripts.  Right now 
> VTK creates "vtk" and "vtkpython" executables that have the paths built 
> in, but I prefer to use the stock "wish" and "python" that come with the 
> system.
> 
> To be complete, these scripts will also have to set the LD_LIBRARY_PATH 
> for people like me who don't like rpath.  This is a challenging thing to 
> do, since the library path variable has different names on different 
> unices.  I've already written some CMake code that does most of the 
> work, but hit a brick wall when trying to figure out whether 
> LD_LIBRARYN32_PATH or LD_LIBRARY64_PATH should be used on IRIX.  Setting 
> both doesn't work, it breaks the system if 64-bit .so files are in the 
> LD_LIBRARYN32_PATH or vice versa.  The only reliable way to check is to 
> use the compiler to build a test executable, and then somehow look into 
> that executable to test what kind of binary it is, and the test is going 
> to vary from platform to platform.
> 
> Are there other people who think that having CMake figure out the 
> LD_LIBRARY_PATH would be valuable?  Even though it is a complicated 
> thing to do, it is certainly doable.

The proper LD_LIBRARY_PATH-like variable can be computed with a TRY_RUN 
on a simple program that uses the preprocessor to determine the right 
variable.  See this file for an example used in ParaView:

http://www.paraview.org/cgi-bin/viewcvs.cgi/VTK/Utilities/kwsys/SharedForward.h.in?root=ParaView&view=markup

-Brad



More information about the vtk-developers mailing list