[vtkusers] Interacting with VTK under Mac OS X

John Norris jnorris at mcs.anl.gov
Wed Mar 14 12:26:44 EDT 2007


First of all, apparently just to keep things interesting, Mac OS X uses 
DYLD_LIBRARY_PATH, not LD_LIBRARY_PATH.

You can also try using the -install_name flag when building VTK.  Here's 
the relevant line from my CMakeCache.txt file.

CMAKE_SHARED_LINKER_FLAGS:STRING=-fPIC -undefined dynamic_lookup 
-multiply_defined suppress -install_name libvtk${KIT}.dylib

This builds the library without any built-in path (the default built-in 
path is wrong).  You could also hard-code in the install directory, and 
then you won't need to worry about DYLD_LIBRARY_PATH.

HTH,
John

Sean McBride wrote:
> On 3/13/07 3:37 PM, Miguel Angel Rodriguez Florido said:
> 
>> Now, I have only a path problem because when I run the vtk command
>> outside the /vtkBin/bin folder it gives me an error like it isn't able
>> to load dylibs (even when I have declared the LD_LIBRARY_PATH pointing
>> to the folder where the dylibs are). The same happens if I double-click
>> vtk in the finder. I think that this is resolved if I create an ".app"
>> for Mac.
> 
> This is no doubt due to the fact that Mac OS X (annoyingly) puts the
> full path within dynamic libraries.  One solution would be to build with
> static libraries instead.  I believe there is another solution though,
> something to do with 'RPATH' but I don't know the details.  If you
> search the list archives, you will see it has been discussed before.

-- 
John Norris
Research Programmer
Center for Simulation of Advanced Rockets
http://www.uiuc.edu/ph/www/jnorris



More information about the vtkusers mailing list