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

Set HDF5_ROOT to avoid hardcoding library dependencies #25

Closed

Conversation

paulromano
Copy link
Contributor

@paulromano paulromano commented Dec 4, 2023

Currently, the DAGMC package on conda forge has hardcoded libraries in the exported DAGMCTargets.cmake file from a temporary build path which won't show up on a user's system, which breaks downstream dependencies (e.g., OpenMC). After a lot of digging, I've determined that it is the fault of HDF5. See here for a detailed explanation: InsightSoftwareConsortium/ITK#343.

The solution in the above linked ITK issue is to change how HDF5 is linked by using *_LIBRARY_NAMES rather than *_LIBRARIES. An easier workaround that requires no changes in the DAGMC source itself is to set HDF5_ROOT, which causes h5cc -show to fail which then triggers a fallback in FindHDF5.cmake whereby it only searches for libhdf5.so and not all the transitive dependencies.

I'm not sure there's a good proper fix short of 1) the HDF5 feedstock on conda-forge using CMake rather than autoconf, or 2) FindHDF5.cmake being fixed to not hardcode paths to system libraries.

Checklist

  • Used a personal fork of the feedstock to propose changes
  • Bumped the build number (if the version is unchanged)
  • Reset the build number to 0 (if the version changed)
  • Re-rendered with the latest conda-smithy (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering)
  • Ensured the license file is being packaged.

@paulromano
Copy link
Contributor Author

@conda-forge-admin, please rerender

@conda-forge-webservices
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

Copy link
Contributor

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

Do we need to leave the HDF5 find debug on?

@@ -32,6 +32,9 @@ cmake -DBUILD_MCNP5=OFF \
-DBUILD_PIC=OFF \
-DBUILD_RPATH=ON \
-DDOUBLE_DOWN=OFF \
-DCMAKE_POLICY_DEFAULT_CMP0074=NEW \
-DHDF5_ROOT="${PREFIX}" \
-DHDF5_FIND_DEBUG=ON \
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this have a continuing purpose? Or was it transient?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just debugging, although the fix I've proposed here didn't work as intended so I still have some digging to do 😞

@paulromano
Copy link
Contributor Author

Well, unfortunately my attempts to get around the HDF5 library linking issue appear to be unsuccessful. I'm going to submit a PR to DAGMC proper that can be incorporated in a future release.

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