Skip to content

Do not link against several transitive dependencies of HDF5#926

Merged
gonuke merged 2 commits into
svalinn:developfrom
paulromano:hdf5-transitive-dependencies
Dec 5, 2023
Merged

Do not link against several transitive dependencies of HDF5#926
gonuke merged 2 commits into
svalinn:developfrom
paulromano:hdf5-transitive-dependencies

Conversation

@paulromano

Copy link
Copy Markdown
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

@gonuke gonuke left a comment

Copy link
Copy Markdown
Member

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
@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.

2 participants