geospace-code / h5fortran

Lightweight HDF5 polymorphic Fortran: h5write() h5read()
https://geospace-code.github.io/h5fortran
BSD 3-Clause "New" or "Revised" License
99 stars 24 forks source link

CMake error related to URL_HASH #23

Closed jvdp1 closed 3 years ago

jvdp1 commented 3 years ago

I tried to build h5fortran with CMake on a Fedora 33 computer.

$ gfortran --version
GNU Fortran (GCC) 10.3.1 20210422 (Red Hat 10.3.1-1)
$ cmake --version
cmake version 3.19.7

CMake suite maintained and supported by Kitware (kitware.com/cmake).

With this setting I got the following error:

$cmake -B build
....

-- Performing Test HDF5_C_links - Success
-- Could NOT find HDF5 (missing: Fortran) 
CMake Error at /usr/share/cmake/Modules/ExternalProject.cmake:2647 (message):
  URL_HASH is set to

    SHA256=a437402f72c4c7825454018343c68af48e792ecbffc346bfaaefdc1b0fdb28cc;CONFIGURE_HANDLED_BY_BUILD;ON

  but must be ALGO=value where ALGO is

    MD5|SHA1|SHA224|SHA256|SHA384|SHA512|SHA3_224|SHA3_256|SHA3_384|SHA3_512

  and value is a hex string.
Call Stack (most recent call first):
  /usr/share/cmake/Modules/ExternalProject.cmake:3430 (_ep_add_download_command)
  cmake/build_zlib.cmake:37 (ExternalProject_Add)
  cmake/build_hdf5.cmake:34 (include)
  CMakeLists.txt:30 (include)

-- Configuring incomplete, errors occurred!
See also "/home/jvandenp/h5fortran/build/CMakeFiles/CMakeOutput.log".

I couldn't find what the problem is. Any idea? I could repeat the same issue on another computer (RedHat, cmake version 3.13)

scivision commented 3 years ago

Hi Jeremie, thanks for reporting this! fixed by 8ff15d7b515cd470a9dbdc22f23030cc0525ae11

This is due to CMake >= 3.20 options that help avoid HDF5 from going through configure/build on each h5fortran rebuild. Now it will again work with CMake < 3.20.

jvdp1 commented 3 years ago

Great! Thank you for fixing it and the explanation!