Skip to content

Conversation

@freakboy3742
Copy link
Contributor

@freakboy3742 freakboy3742 commented Oct 23, 2024

The default behavior of cmake is to build and install a library with the library's install_name set to @rpath/libname.dylib. While this is a good default when the library is being used in an executable, it's a problem on macOS when the library is being used as a dependency in a wheel, because the @rpath can't be resolved as part of the delocate process.

Libraries build with autotools/configure (or manually constructed makefiles) aren't affected by this; their default install name is the full install path unless specifically configured with an installation name.

The libblosc build instruction already included a workaround to explicitly set the library identifiers; it's possible to replace that workaround with an explicit cmake configuration.

In addition, the CMAKE_INSTALL_LIBDIR value used for libjpeg-turbo is redundant, as the /lib suffix will be implied from the CMAKE_INSTALL_PREFIX value.

@freakboy3742
Copy link
Contributor Author

freakboy3742 commented Oct 23, 2024

The CI failure appears to be a transient issue caused by network availability; I've force-pushed to re-trigger CI.

@radarhere radarhere changed the title Ensure cmake-compiled libraries aren't installed with an rpath. Ensure cmake-compiled libraries aren't installed with an rpath Oct 23, 2024
@mattip mattip merged commit fd84933 into multi-build:devel Oct 23, 2024
@mattip
Copy link
Collaborator

mattip commented Oct 23, 2024

Thanks @freakboy3742

@radarhere
Copy link
Collaborator

In addition, the CMAKE_INSTALL_LIBDIR value used for libjpeg-turbo is redundant, as the /lib suffix will be implied from the CMAKE_INSTALL_PREFIX value.

Could you link to something showing this theory? In practice, I find that this change does actually make a difference. See #537 for a demonstration and my suggestion to revert this.

@freakboy3742 freakboy3742 deleted the no-rpath branch October 23, 2024 22:24
@freakboy3742
Copy link
Contributor Author

@radarhere I'll take the conversation to #537 so the context of any revert isn't lost.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants