Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not link against several transitive dependencies of HDF5 #926

Merged
merged 2 commits into from
Dec 5, 2023

Conversation

paulromano
Copy link
Contributor

Description

As described in conda-forge/dagmc-feedstock#25, some weirdness in how FindHDF5.cmake works results in transitive dependencies getting linked against, which causes issues in conda-forge with those libraries getting hardcoded in the installed DAGMCTargets.cmake file, thereby breaking potentially downstream applications that are trying to link against DAGMC. The "best" fix would be to use the proper hdf5::hdf5 target provided by newer versions of CMake (3.19+), but I would hesitate to make that the required version. As such, the fix I'm proposed here is to manually remove libpthread, libdl, and libm from the list of HDF5 libraries. This should not cause any issues because:

  1. For shared libraries, everything gets pulled in transitively through libhdf5 anyway
  2. Nowadays, it is not required to link against libpthread or libdl at all (see explanation here)
  3. libm will be implicitly linked against for C++ applications

Motivation and Context

Described above

Changes

Described above

Behavior

Old behavior: All DAGMC libraries will be explicitly linked against HDF5 and its transitive dependencies
New behavior: All DAGMC libraries will be explicitly linked against HDF5 and several transitive dependencies (e.g., libcrypto, libcurl) but not libpthread, libdl, or libm

Changelog file

All pull requests are required to update the CHANGELOG file with the PR. Your update can take different forms including:

  • creating a new entry describing your change, including a reference to this pull request number
  • adding a reference to your pull request number to an exist entry if that entry can include your changes

Copy link
Member

@gonuke gonuke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for digging through this @paulromano

@gonuke gonuke merged commit 1186825 into svalinn:develop Dec 5, 2023
8 checks passed
@paulromano paulromano deleted the hdf5-transitive-dependencies branch December 5, 2023 19:21
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.

None yet

2 participants