MFC icon indicating copy to clipboard operation
MFC copied to clipboard

Remove HDF5 Build Hacks

Open henryleberre opened this issue 1 year ago • 2 comments

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:

https://github.com/MFlowCode/MFC/blob/63c79cbf041c71985b4123aa9652a7df83604b44/toolchain/dependencies/Silo.patch#L10-L19

https://github.com/MFlowCode/MFC/blob/63c79cbf041c71985b4123aa9652a7df83604b44/toolchain/dependencies/CMakeLists.txt#L80

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.

henryleberre avatar Sep 10 '24 23:09 henryleberre

Thanks for documenting this well, @henryleberre

sbryngelson avatar Sep 11 '24 01:09 sbryngelson

Gotta overtake this. ig robust SiloFindHDF5.cmake ought to be in place. Silo seems to be actively maintained still, so if figured out, I will PR changes to LLNL/Silo repo.

Error w/o Injecting FindHDF5.cmake

CMake Error at CMake/SiloFindHDF5.cmake:92 (message):
  An explicit request for HDF5 was made but HDF5 was not found.  You may want
  to try setting SILO_HDF5_DIR
Call Stack (most recent call first):
  CMakeLists.txt:202 (include)

Malmahrouqi3 avatar Nov 10 '25 17:11 Malmahrouqi3