[Insight-users] Installed project with shared libs

Kevin H. Hobbs kevin.hobbs.1 at ohiou.edu
Thu Feb 23 14:58:18 EST 2006


On Thu, 2006-02-23 at 11:39 -0800, Zachary Pincus wrote:
> Hi folks,
> 
> For the first time ever, I actually installed ITK (built with shard  
> libs) as opposed to using it from the build directory.
> 
> After installing ITK, I moved the build directory and tried to build  
> and run a project that uses ITK. The project built fine, because the  
> linker saw the installed dylibs. However, the project won't run,  
> because the rpaths in the installed dylibs were paths to the build  
> directory, not the install directory. Thus dyld can't find the itk  
> libraries.
> 
> It seems like this issue will arise with any CMake-driven project,  
> and not just ITK. So, in its current state, can CMake be used to  
> create shared libs that work properly when installed? I know that  
> CMake just got custom rpath support (thanks Brad!), so I'm curious as  
> to what ITK (or any CMake project that installs shared libs) would  
> need to do to support this.
> 
> It seems like two copies of the libs would have to be linked: one for  
> use in the build dir, and one InstallOnly copy, with the correct  
> install rpath. Is this correct? Is there an easier/better solution  
> (preferably cross-platform)?
> 
> Thanks,
> 
> Zach

This has been discussed on the VTK list a lot. I think the
solution/(proper way to do things) is to not set rpath on installed
libraries, but to instead make sure they are installed somewhere that
the linker will find them. This is the way of system libraries.  I just
put it all in my .bash_profile, but you could put it in /etc/ld.so.conf.

Do non unix-like operating systems even have anything like this?

PATH=$PATH:$HOME/bin
PATH=$PATH:/opt/vtk/bin
PATH=$PATH:/opt/itk/bin
PATH=$PATH:/opt/paraview/bin
PATH=$PATH:/opt/itk_app/bin
PATH=$PATH:/opt/wine-0.9.6_32-bit/bin
export PATH

LD_LIBRARY_PATH=/opt/vtk/lib
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/itk/lib
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/paraview/lib
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/itk_app/lib
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/wine-0.9.6_32-bit/lib
export LD_LIBRARY_PATH
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : http://public.kitware.com/pipermail/insight-users/attachments/20060223/51d878c8/attachment-0001.pgp


More information about the Insight-users mailing list