Sitelet https://github.com/imageworks/Field3D/issues/62
Skip to content
This repository was archived by the owner on Jul 15, 2023. It is now read-only.
This repository was archived by the owner on Jul 15, 2023. It is now read-only.

Fix library install_name on OS X #62

Description

@ryandesign

The install_name of the library is not correct on OS X. Here's what the library looks like when building field3d 1.3.2 in MacPorts:

$ otool -L /opt/local/var/macports/build/_Users_rschmidt_macports_dports_graphics_field3d/field3d/work/Field3D-1.3.2/install/darwin/m64/release/lib/libField3D.dylib
/opt/local/var/macports/build/_Users_rschmidt_macports_dports_graphics_field3d/field3d/work/Field3D-1.3.2/install/darwin/m64/release/lib/libField3D.dylib:
    /opt/local/var/macports/build/_Users_rschmidt_macports_dports_graphics_field3d/field3d/work/Field3D-1.3.2/install/darwin/m64/release/lib/libField3D.dylib (compatibility version 0.0.0, current version 0.0.0)
    /opt/local/lib/libHalf.6.dylib (compatibility version 7.0.0, current version 7.0.0)
    /opt/local/lib/libIex.6.dylib (compatibility version 7.0.0, current version 7.0.0)
    /opt/local/lib/libImath.6.dylib (compatibility version 7.0.0, current version 7.0.0)
    /opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.7)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
    /opt/local/lib/libhdf5.7.dylib (compatibility version 8.0.0, current version 8.3.0)
    /opt/local/lib/libboost_thread-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    /opt/local/lib/libboost_system-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0)

/opt/local/var/macports/build/_Users_rschmidt_macports_dports_graphics_field3d/field3d/work/Field3D-1.3.2/install/darwin/m64/release/lib/libField3D.dylib is the location of the library on disk at build time, but that should not be the path baked into the library as its install_name (shown as the first line of output from otool -L); the install_name needs to be the absolute path the library will have after installation, for example in the case of MacPorts /opt/local/lib/libField3D.dylib. In MacPorts we are fixing this by running install_name_tool manually after the build, but it would be better if you fixed it in your build system.

You should also be setting the current_version and compatibility_version of the library as befits your library version numbering scheme.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions