diff --git a/var/spack/repos/builtin/packages/hdf5/hdf5_1.8_gcc10.patch b/var/spack/repos/builtin/packages/hdf5/hdf5_1.8_gcc10.patch new file mode 100644 index 0000000000..0de8c33c09 --- /dev/null +++ b/var/spack/repos/builtin/packages/hdf5/hdf5_1.8_gcc10.patch @@ -0,0 +1,12 @@ +diff -Naur hdf5.orig/fortran/test/tH5T_F03.f90 hdf5/fortran/test/tH5T_F03.f90 +--- hdf5.orig/fortran/test/tH5T_F03.f90 2021-01-19 13:23:11.298000000 +0100 ++++ hdf5/fortran/test/tH5T_F03.f90 2021-01-19 13:19:17.637000000 +0100 +@@ -1541,7 +1541,7 @@ + INTEGER :: A, B, C, D + INTEGER :: Aw, Bw, Cw, Dw + INTEGER :: i, j +- INTEGER, PARAMETER :: hex = Z'00000003' ++ INTEGER, PARAMETER :: hex = INT(Z'00000003') + TYPE(C_PTR) :: f_ptr + INTEGER :: error ! Error flag + ! diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py index 01c1428766..59e2f98600 100644 --- a/var/spack/repos/builtin/packages/hdf5/package.py +++ b/var/spack/repos/builtin/packages/hdf5/package.py @@ -139,6 +139,11 @@ class Hdf5(AutotoolsPackage): patch('h5public-skip-mpicxx.patch', when='@:1.8.21,1.10.0:1.10.5+mpi~cxx', sha256='b61e2f058964ad85be6ee5ecea10080bf79e73f83ff88d1fa4b602d00209da9c') + # Fixes BOZ literal constant error when compiled with GCC 10. + # The issue is described here: https://github.com/spack/spack/issues/18625 + patch('hdf5_1.8_gcc10.patch', when='@:1.8.21', + sha256='0e20187cda3980a4fdff410da92358b63de7ebef2df1d7a425371af78e50f666') + # The argument 'buf_size' of the C function 'h5fget_file_image_c' is # declared as intent(in) though it is modified by the invocation. As a # result, aggressive compilers such as Fujitsu's may do a wrong