CMake > 3.6.0 cannot configure with HDF5 libraries
Issue #731
resolved
The latest CMake tries to find the HDF5 C++ and Fortran interfaces, even though they are not required by DOLFIN. HDF5 is correctly configured with the --enable-parallel
flag, so the C++ and Fortran interfaces are not available. This results in the CMake configure process exiting before the compile.
Comments (6)
-
reporter -
I have CMake 3.6.2, and it works fine for me.
-
I need to apply the following patch to make it work with CMake 3.6.2:
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b1b11e..20341a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -553,7 +553,7 @@ if (DOLFIN_ENABLE_HDF5) set(ENV{HDF5_ROOT} "$ENV{HDF5_DIR}") endif() set(HDF5_PREFER_PARALLEL TRUE) - find_package(HDF5) + find_package(HDF5 COMPONENTS C) set_package_properties(HDF5 PROPERTIES TYPE OPTIONAL DESCRIPTION "Hierarchical Data Format 5 (HDF5)" URL "https://www.hdfgroup.org/HDF5")
CMake 3.5.1 did not work for me either.
-
@johannes_ring Does the patch work with older version of CMake? If yes we could just apply it.
-
@garth-wells - yes, I tested it now with CMake 2.8.12 and it worked fine. I will apply it.
-
- changed status to resolved
Fixed in 38b28c6.
- Log in to comment
The same environment compiles perfectly on downgrading CMake to 3.5.1.