svalinn / DAGMC

Direct Accelerated Geometry Monte Carlo Toolkit
https://svalinn.github.io/DAGMC
Other
96 stars 61 forks source link

Do not link against several transitive dependencies of HDF5 #926

Closed paulromano closed 7 months ago

paulromano commented 7 months ago

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: