CMake > 3.6.0 cannot configure with HDF5 libraries

Issue #731 resolved
Jack Hale created an issue

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)

  1. Johannes Ring

    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.

  2. Prof Garth Wells

    @johannes_ring Does the patch work with older version of CMake? If yes we could just apply it.

  3. Log in to comment