Skip to content

HDF5 does not build on macOS Monterey with GCC 11.2 #1157

@eschnett

Description

@eschnett

I want to build HDF5 1.10.7 with GCC 11.2 on macOS Monterey. This used
to work fine on the previous version of macOS. It currently fails
because the autodetection of the Fortran kind variables fails. I tried
HDF5 1.10.6 and 1.12.1 as well, with the same result.

I found that the problem is that the output file is not closed by the
Fortran program that is run at configuration time. The enclosed patch
corrects the issue by adding respective "close" statements that are
present in all other, similar Fortran programs.

--- a/config/cmake/HDF5UseFortran.cmake
+++ a/config/cmake/HDF5UseFortran.cmake
@@ -181,6 +181,7 @@
          WRITE(8,'(I0)') max_decimal_prec
          WRITE(8,'(I0)') num_ikinds
          WRITE(8,'(I0)') num_rkinds
+         CLOSE(8)
       END PROGRAM FC_AVAIL_KINDS
   "
 )
--- a/m4/aclocal_fc.f90
+++ b/m4/aclocal_fc.f90
@@ -151,6 +151,7 @@
      WRITE(8,'(I0)') max_decimal_prec
      WRITE(8,'(I0)') num_ikinds
      WRITE(8,'(I0)') num_rkinds
+     CLOSE(8)
 END PROGRAM FC_AVAIL_KINDS
 !---- END ----- Determine the available KINDs for REALs and INTEGERs
 

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions