VTK installation: shell scripts for env vars

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

VTK installation: shell scripts for env vars

David Gobbi-2
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.

 - David
_______________________________________________
vtk-developers mailing list
[hidden email]
http://www.vtk.org/mailman/listinfo/vtk-developers
Reply | Threaded
Open this post in threaded view
|

Re: VTK installation: shell scripts for env vars

Brad King
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
_______________________________________________
vtk-developers mailing list
[hidden email]
http://www.vtk.org/mailman/listinfo/vtk-developers
Reply | Threaded
Open this post in threaded view
|

Re: VTK installation: shell scripts for env vars

David Gobbi-2

--- Brad King <[hidden email]> wrote:

> David Gobbi wrote:

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

Thanks, Brad.  I created a CMake/vtkSharedLibraryPathInfo.cxx using that code and it works great.
Now my CMakeLists.txt has a TRY_RUN that sets SHARED_LDPATH to the LD_LIBRARY_PATH-equivalent for
the platform.

Sebastien: I can put this into VTK cvs.  Should the variable that holds the info be called
VTK_SHARED_LDPATH or CMAKE_SHARED_LDPATH?

 - David


_______________________________________________
vtk-developers mailing list
[hidden email]
http://www.vtk.org/mailman/listinfo/vtk-developers