[Insight-users] OS X Install_Name setting on Libraries.
Darren Weber
darren.weber.lists at gmail.com
Mon Jun 15 18:59:50 EDT 2009
Hi Mike,
I've updated MacPorts to ITK 3.14.0, please see this wiki page for details:
http://www.vtk.org/Wiki/ITK_MacPorts_Package_Maintainers
FYI, in the wiki, I commented on several CMake issues. Also, I've made some
notes in the Portfile about the issues with a shared library installation,
ie:
# Notes on RPATH settings for the shared dylib build and install:
#
# CMake book, Appendix A, p 234: "CMAKE_SKIP_BUILD_RPATH: Do not include RPATHs
# in the build tree. Normally CMake uses the build tree for the RPATH when
# building executables etc. on systems that use RPATH. When the software is
# installed the executables etc. are relinked by CMake to have the install
# RPATH. If this variable is set to true then the software is always built with
# no RPATH."
#
# CMake book, Appendix B, p. 301: "... SKIP_BUILD_RPATH is a boolean specifying
# whether to skip automatic generation of an rpath allowing the target to run
# from the build tree. BUILD_WITH_INSTALL_RPATH is a boolean specifying whether
# to link the target in the build tree with the INSTALL_RPATH. This takes
# precedence over SKIP_BUILD_RPATH and avoids the need for relinking before
# installation."
#
# Using CMAKE_SKIP_BUILD_RPATH:BOOL=OFF, we get all the executables and dylibs
# built with the $build.dir in the rpath. For this to work, we must also have
# CMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF. After the build, at the destroot
# phase, all the installation candidates (which excludes the examples and
# testing binaries) have their rpath settings reset to the INSTALL_RPATH (which
# should point to $prefix..., not the $destroot location).
variant shared description "build shared libraries (default)" {
configure.args-delete \
-DBUILD_SHARED_LIBS:BOOL=OFF
configure.args-append \
-DBUILD_SHARED_LIBS:BOOL=ON \
-DCMAKE_SKIP_RPATH:BOOL=OFF \
-DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF \
-DCMAKE_INSTALL_RPATH:STRING=${itkLibPath}
}
Another way to do it is to build with the install rpath, but that breaks the
build unless you provide an environment setting for the DYLD_LIBRARY_PATH
(or something like that). This was adopted for the build in the vtk5 port
in MacPorts and I believe that it's also adopted in the fink port.
Take care,
Darren
On Mon, Jun 8, 2009 at 8:39 AM, Michael Jackson <mike.jackson at bluequartz.net
> wrote:
> Is there a hidden setting in the CMake files to enable the use of the
> "install_name" on ITK dynamic libraries built on OS X?
>
> I build ITK 3.14.0 with SHARED_LIBRARIES=ON, installed to my preferred
> CMAKE_INSTALL_PREFIX location, built my project and tried to launch and I
> get the dreaded error that the itk libraries can not be found. And yet when
> I check my build directory and pick an ITK library and inspect it using
> otool, the install_name is set for the build directory. So I guess these are
> stripped off during the installation? Why? If they can be stripped off, why
> can't they be changed to the installation path?
>
> Or is this preferred way to use ITK as static libraries? Or from the Build
> directory?
>
> _________________________________________________________
> Mike Jackson mike.jackson at bluequartz.net
> BlueQuartz Software www.bluequartz.net
> Principal Software Engineer Dayton, Ohio
>
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090615/31a78954/attachment-0001.htm>
More information about the Insight-users
mailing list