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

Remove HDF5 Build Hacks #621

Open
henryleberre opened this issue Sep 10, 2024 · 1 comment
Open

Remove HDF5 Build Hacks #621

henryleberre opened this issue Sep 10, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@henryleberre
Copy link
Member

henryleberre commented Sep 10, 2024

While CMake ships its own FindHDF5, we had to create our own toolchain/cmake/FindHDF5.cmake to accommodate non-cooperative systems and compilers (afaik only Cray CCE). This issue arises again when we attempt to build the LLNL Silo dependency because it uses the built-in (CMake-provided) FindHDF5. To work around this, we patch
Silo to allow us to inject our toolchain/cmake/FindHDF5.cmake. This is terrible. See:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 111eb42..9e460f7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -68,7 +68,7 @@ project(Silo VERSION ${SILO_VERSION} LANGUAGES CXX C)
###-----------------------------------------------------------------------------
# location for Silo CMake includes
###-----------------------------------------------------------------------------
-set(CMAKE_MODULE_PATH ${Silo_SOURCE_DIR}/CMake)
+list(APPEND CMAKE_MODULE_PATH "${Silo_SOURCE_DIR}/CMake")

"$<$<STREQUAL:${CMAKE_Fortran_COMPILER_ID},Cray>:-DCMAKE_MODULE_PATH=${CMAKE_SOURCE_DIR}/../cmake>"

As a result of this, HDF5 is the last of our dependencies that we always build even when a compatible version is present on the system. This is also why the --sys-hdf5 command-line argument is still supported by ./mfc.sh but --sys-fftw and --sys-silo are no longer accepted.

Good luck to whoever is tasked with resolving this in the future. I do not think this will ever be fixed but I would like to be proven wrong.

@sbryngelson
Copy link
Member

Thanks for documenting this well, @henryleberre

@sbryngelson sbryngelson added the enhancement New feature or request label Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants