[vtkusers] OSX Mountain Lion - shared libraries

Sean McBride sean at rogue-research.com
Fri Jan 24 10:30:06 EST 2014


On Thu, 23 Jan 2014 20:59:15 -0700, David Gobbi said:

>When you build VTK, or when you build your own programs against the
>VTK libraries, cmake bakes the load path into the libraries and the
>executables that it produces.  So in general, no paths have to be set.
> The run-time libraries will be found automatically.
>
>CMake will strip out these baked-in library paths when you run a make
>install, so that the installed VTK programs will only search the
>system library paths, rather than searching your build directory for
>the libraries.  So if you install libraries to some location that is
>not in the system library path, then you will need to use
>DYLD_LIBRARY_PATH or some other path-setting mechanism.
>
>More information (general info, not specific to OS X) is available on
>the wiki: http://www.cmake.org/Wiki/CMake_RPATH_handling

And it is the complication of shared libraries having these built-in paths that makes static libraries preferable in many situations.

Of course, as with everything, "it depends" what you're doing.  Aaron, what are you doing with VTK exactly?  If you are trying to build a stand-alone .app then using static libraries will be preferable because the linker will just add them to your main executable, and you won't have to worry about embedding the dylibs in your .app, plus the linker will be able to dead strip a lot of VTK away for you.

Cheers,

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada




More information about the vtkusers mailing list