diff --git a/hdf5-1.12.1.tar.bz2 b/hdf5-1.12.1.tar.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..2c3ea6d95ea967ba90b8ee2a9979b67b8bcdf1e9 Binary files /dev/null and b/hdf5-1.12.1.tar.bz2 differ diff --git a/hdf5-LD_LIBRARY_PATH.patch b/hdf5-LD_LIBRARY_PATH.patch new file mode 100644 index 0000000000000000000000000000000000000000..f1852e7cb17a6f2a885f31faa21aea31fb8d8fb5 --- /dev/null +++ b/hdf5-LD_LIBRARY_PATH.patch @@ -0,0 +1,20 @@ +--- hdf5-1.12.0/src/Makefile.am~ 2020-02-29 00:29:58.000000000 +0100 ++++ hdf5-1.12.0/src/Makefile.am 2021-02-26 16:10:03.612252484 +0100 +@@ -156,8 +156,6 @@ + # Remove the generated .c file if errors occur unless HDF5_Make_Ignore + # is set to ignore the error. + H5Tinit.c: H5detect$(EXEEXT) +- LD_LIBRARY_PATH="$$LD_LIBRARY_PATH`echo $(LDFLAGS) | \ +- sed -e 's/-L/:/g' -e 's/ //g'`" \ + $(RUNSERIAL) ./H5detect$(EXEEXT) $@ || \ + (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \ + ($(RM) $@ ; exit 1) +@@ -168,8 +166,6 @@ + # Remove the generated .c file if errors occur unless HDF5_Make_Ignore + # is set to ignore the error. + H5lib_settings.c: H5make_libsettings$(EXEEXT) libhdf5.settings +- LD_LIBRARY_PATH="$$LD_LIBRARY_PATH`echo $(LDFLAGS) | \ +- sed -e 's/-L/:/g' -e 's/ //g'`" \ + $(RUNSERIAL) ./H5make_libsettings$(EXEEXT) $@ || \ + (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \ + ($(RM) $@ ; exit 1) diff --git a/hdf5-build.patch b/hdf5-build.patch new file mode 100644 index 0000000000000000000000000000000000000000..cc08c02cd00b9d722d4af47ac08f459654d49fc0 --- /dev/null +++ b/hdf5-build.patch @@ -0,0 +1,145 @@ +diff --git a/java/examples/datasets/JavaDatasetExample.sh.in b/java/examples/datasets/JavaDatasetExample.sh.in +index f29739a..fc9cddb 100644 +--- a/java/examples/datasets/JavaDatasetExample.sh.in ++++ b/java/examples/datasets/JavaDatasetExample.sh.in +@@ -39,7 +39,7 @@ HDFLIB_HOME="$top_srcdir/java/lib" + BLDDIR="." + BLDLIBDIR="$BLDDIR/testlibs" + HDFTEST_HOME="$top_srcdir/java/examples/datasets" +-JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar ++JARFILE=@PACKAGE_TARNAME@.jar + TESTJARFILE=jar@PACKAGE_TARNAME@datasets.jar + test -d $BLDLIBDIR || mkdir -p $BLDLIBDIR + +diff --git a/java/examples/datasets/Makefile.am b/java/examples/datasets/Makefile.am +index 41a914b..195201a 100644 +--- a/java/examples/datasets/Makefile.am ++++ b/java/examples/datasets/Makefile.am +@@ -26,7 +26,7 @@ classes: + test -d $(@D)/$(JAVAROOT) || $(MKDIR_P) $(@D)/$(JAVAROOT) + + pkgpath = examples/datasets +-hdfjarfile = jar$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).jar ++hdfjarfile = $(PACKAGE_TARNAME).jar + CLASSPATH_ENV=CLASSPATH=.:$(JAVAROOT):$(top_builddir)/java/src/$(hdfjarfile):$(top_srcdir)/java/lib/slf4j-api-1.7.25.jar:$(top_srcdir)/java/lib/ext/slf4j-simple-1.7.25.jar:$$CLASSPATH + + jarfile = jar$(PACKAGE_TARNAME)datasets.jar +diff --git a/java/examples/datatypes/JavaDatatypeExample.sh.in b/java/examples/datatypes/JavaDatatypeExample.sh.in +index e26d8c0..f6a9d87 100644 +--- a/java/examples/datatypes/JavaDatatypeExample.sh.in ++++ b/java/examples/datatypes/JavaDatatypeExample.sh.in +@@ -36,7 +36,7 @@ HDFLIB_HOME="$top_srcdir/java/lib" + BLDDIR="." + BLDLIBDIR="$BLDDIR/testlibs" + HDFTEST_HOME="$top_srcdir/java/examples/datatypes" +-JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar ++JARFILE=@PACKAGE_TARNAME@.jar + TESTJARFILE=jar@PACKAGE_TARNAME@datatypes.jar + test -d $BLDLIBDIR || mkdir -p $BLDLIBDIR + +diff --git a/java/examples/datatypes/Makefile.am b/java/examples/datatypes/Makefile.am +index 90790f7..450edef 100644 +--- a/java/examples/datatypes/Makefile.am ++++ b/java/examples/datatypes/Makefile.am +@@ -26,7 +26,7 @@ classes: + test -d $(@D)/$(JAVAROOT) || $(MKDIR_P) $(@D)/$(JAVAROOT) + + pkgpath = examples/datatypes +-hdfjarfile = jar$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).jar ++hdfjarfile = $(PACKAGE_TARNAME).jar + CLASSPATH_ENV=CLASSPATH=.:$(JAVAROOT):$(top_builddir)/java/src/$(hdfjarfile):$(top_srcdir)/java/lib/slf4j-api-1.7.25.jar:$(top_srcdir)/java/lib/ext/slf4j-simple-1.7.25.jar:$$CLASSPATH + + jarfile = jar$(PACKAGE_TARNAME)datatypes.jar +diff --git a/java/examples/groups/JavaGroupExample.sh.in b/java/examples/groups/JavaGroupExample.sh.in +index 3b0e9d1..416c69f 100644 +--- a/java/examples/groups/JavaGroupExample.sh.in ++++ b/java/examples/groups/JavaGroupExample.sh.in +@@ -37,7 +37,7 @@ BLDDIR="." + BLDLIBDIR="$BLDDIR/testlibs" + BLDITERDIR="./groups" + HDFTEST_HOME="$top_srcdir/java/examples/groups" +-JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar ++JARFILE=@PACKAGE_TARNAME@.jar + TESTJARFILE=jar@PACKAGE_TARNAME@groups.jar + test -d $BLDLIBDIR || mkdir -p $BLDLIBDIR + test -d $BLDITERDIR || mkdir -p $BLDITERDIR +diff --git a/java/examples/groups/Makefile.am b/java/examples/groups/Makefile.am +index bfde9ae..f48a5b9 100644 +--- a/java/examples/groups/Makefile.am ++++ b/java/examples/groups/Makefile.am +@@ -26,7 +26,7 @@ classes: + test -d $(@D)/$(JAVAROOT) || $(MKDIR_P) $(@D)/$(JAVAROOT) + + pkgpath = examples/groups +-hdfjarfile = jar$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).jar ++hdfjarfile = $(PACKAGE_TARNAME).jar + CLASSPATH_ENV=CLASSPATH=.:$(JAVAROOT):$(top_builddir)/java/src/$(hdfjarfile):$(top_srcdir)/java/lib/slf4j-api-1.7.25.jar:$(top_srcdir)/java/lib/ext/slf4j-simple-1.7.25.jar:$$CLASSPATH + + jarfile = jar$(PACKAGE_TARNAME)groups.jar +diff --git a/java/examples/intro/JavaIntroExample.sh.in b/java/examples/intro/JavaIntroExample.sh.in +index db741e5..d0ba65d 100644 +--- a/java/examples/intro/JavaIntroExample.sh.in ++++ b/java/examples/intro/JavaIntroExample.sh.in +@@ -36,7 +36,7 @@ HDFLIB_HOME="$top_srcdir/java/lib" + BLDDIR="." + BLDLIBDIR="$BLDDIR/testlibs" + HDFTEST_HOME="$top_srcdir/java/examples/intro" +-JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar ++JARFILE=@PACKAGE_TARNAME@.jar + TESTJARFILE=jar@PACKAGE_TARNAME@intro.jar + test -d $BLDLIBDIR || mkdir -p $BLDLIBDIR + +diff --git a/java/examples/intro/Makefile.am b/java/examples/intro/Makefile.am +index 7d1aeab..01a10c9 100644 +--- a/java/examples/intro/Makefile.am ++++ b/java/examples/intro/Makefile.am +@@ -26,7 +26,7 @@ classes: + test -d $(@D)/$(JAVAROOT) || $(MKDIR_P) $(@D)/$(JAVAROOT) + + pkgpath = examples/intro +-hdfjarfile = jar$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).jar ++hdfjarfile = $(PACKAGE_TARNAME).jar + CLASSPATH_ENV=CLASSPATH=.:$(JAVAROOT):$(top_builddir)/java/src/$(hdfjarfile):$(top_srcdir)/java/lib/slf4j-api-1.7.25.jar:$(top_srcdir)/java/lib/ext/slf4j-simple-1.7.25.jar:$$CLASSPATH + + jarfile = jar$(PACKAGE_TARNAME)intro.jar +diff --git a/java/src/Makefile.am b/java/src/Makefile.am +index 98630e6..fd8d057 100644 +--- a/java/src/Makefile.am ++++ b/java/src/Makefile.am +@@ -32,8 +32,8 @@ JAVAROOT = .classes + classes: + test -d $(@D)/$(JAVAROOT) || $(MKDIR_P) $(@D)/$(JAVAROOT) + +-jarfile = jar$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).jar +-hdf5_javadir = $(libdir) ++jarfile = $(PACKAGE_TARNAME).jar ++hdf5_javadir = $(prefix)/lib/java + + pkgpath = hdf/hdf5lib + CLASSPATH_ENV=CLASSPATH=.:$(top_srcdir)/java/lib/slf4j-api-1.7.25.jar:$$CLASSPATH +diff --git a/java/test/Makefile.am b/java/test/Makefile.am +index 08e79e3..b336c2f 100644 +--- a/java/test/Makefile.am ++++ b/java/test/Makefile.am +@@ -26,7 +26,7 @@ classes: + test -d $(@D)/$(JAVAROOT) || $(MKDIR_P) $(@D)/$(JAVAROOT) + + pkgpath = test +-hdfjarfile = jar$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).jar ++hdfjarfile = $(PACKAGE_TARNAME).jar + CLASSPATH_ENV=CLASSPATH=.:$(JAVAROOT):$(top_builddir)/java/src/$(hdfjarfile):$(top_srcdir)/java/lib/junit.jar:$(top_srcdir)/java/lib/hamcrest-core.jar:$(top_srcdir)/java/lib/slf4j-api-1.7.25.jar:$(top_srcdir)/java/lib/ext/slf4j-simple-1.7.25.jar:$$CLASSPATH + + jarfile = jar$(PACKAGE_TARNAME)test.jar +diff --git a/java/test/junit.sh.in b/java/test/junit.sh.in +index 39db296..83d6c7c 100644 +--- a/java/test/junit.sh.in ++++ b/java/test/junit.sh.in +@@ -47,7 +47,7 @@ BLDLIBDIR="$BLDDIR/testlibs" + HDFTEST_HOME="$top_srcdir/java/test" + TOOLS_TESTFILES="$top_srcdir/tools/testfiles" + +-JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar ++JARFILE=@PACKAGE_TARNAME@.jar + TESTJARFILE=jar@PACKAGE_TARNAME@test.jar + test -d $BLDLIBDIR || mkdir -p $BLDLIBDIR + diff --git a/hdf5-configure-c99.patch b/hdf5-configure-c99.patch new file mode 100644 index 0000000000000000000000000000000000000000..456e59c544359b57529cef3892080e9a91777b09 --- /dev/null +++ b/hdf5-configure-c99.patch @@ -0,0 +1,31 @@ +commit 9dd36f016a4316b94f5df15856d228de01d304c6 +Author: Ryan Schmidt +Date: Thu Nov 17 16:28:44 2022 -0600 + + Simplify & fix check for szlib encoder (#2263) + + Return the result rather than setting the exit code. "return" is a + language keyword whereas "exit" is a function for which the + header has to be included which it wasn't in this test, therefore the + test would previously fail to identify that the encoder was enabled if + "-Werror=implicit-function-declaration" was used, which it is by default + with clang from Xcode 12 and later. + + Fixes #2262 + +diff --git a/configure.ac b/configure.ac +index 7a0d043369..a7d11293b3 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1737,10 +1737,7 @@ if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then + #include "szlib.h" + ],[[ + /* SZ_encoder_enabled returns 1 if encoder is present */ +- if(SZ_encoder_enabled() == 1) +- exit(0); +- else +- exit(1); ++ return SZ_encoder_enabled() != 1; + ]])] + , [hdf5_cv_szlib_can_encode=yes], [hdf5_cv_szlib_can_encode=no],)] + ) diff --git a/hdf5-gfortran12.patch b/hdf5-gfortran12.patch new file mode 100644 index 0000000000000000000000000000000000000000..97fc27610814fcc41d8e9f3470e04128dd7d7f71 --- /dev/null +++ b/hdf5-gfortran12.patch @@ -0,0 +1,37 @@ +commit 3ea6f8c17228d2629e419563138a6180bc4a5a6a +Author: Orion Poplawski +Date: Sun Jan 30 15:21:08 2022 -0700 + + Mark minusone as a PARAMETER in tH5A_1_8.F90. + +diff --git a/fortran/test/tH5A_1_8.F90 b/fortran/test/tH5A_1_8.F90 +index 4e02c58a39..c2f8e9984a 100644 +--- a/fortran/test/tH5A_1_8.F90 ++++ b/fortran/test/tH5A_1_8.F90 +@@ -776,7 +776,7 @@ SUBROUTINE test_attr_info_by_idx(new_format, fcpl, fapl, total_error) + + INTEGER :: Input1 + INTEGER(HSIZE_T) :: hzero = 0_HSIZE_T +- INTEGER :: minusone = -1 ++ INTEGER, PARAMETER :: minusone = -1 + INTEGER(HSIZE_T) :: htmp + + data_dims = 0 +@@ -1427,7 +1427,7 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) + INTEGER :: u ! Local index variable + INTEGER :: Input1 + INTEGER(HSIZE_T) :: hzero = 0_HSIZE_T +- INTEGER :: minusone = -1 ++ INTEGER, PARAMETER :: minusone = -1 + + data_dims = 0 + +@@ -2268,7 +2268,7 @@ SUBROUTINE test_attr_corder_create_basic( fcpl, fapl, total_error ) + INTEGER :: error + + INTEGER :: crt_order_flags +- INTEGER :: minusone = -1 ++ INTEGER, PARAMETER :: minusone = -1 + + ! Output message about test being performed + ! WRITE(*,*) " - Testing Basic Code for Attributes with Creation Order Info" diff --git a/hdf5-wrappers.patch b/hdf5-wrappers.patch new file mode 100644 index 0000000000000000000000000000000000000000..ff721bb34a62801c74686d14d406f37930570245 --- /dev/null +++ b/hdf5-wrappers.patch @@ -0,0 +1,109 @@ +diff -up hdf5-1.10.7/bin/h5cc.in.wrappers hdf5-1.10.7/bin/h5cc.in +--- hdf5-1.10.7/bin/h5cc.in.wrappers 2020-10-07 20:24:29.127283333 -0600 ++++ hdf5-1.10.7/bin/h5cc.in 2020-10-07 20:27:05.289536904 -0600 +@@ -89,10 +89,10 @@ CLINKERBASE="@CC@" + # paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in + # from the hdf5 build. The order of the flags is intended to give precedence + # to the user's flags. +-H5BLD_CFLAGS="@AM_CFLAGS@ @CFLAGS@" ++H5BLD_CFLAGS= + H5BLD_CPPFLAGS="@AM_CPPFLAGS@ @CPPFLAGS@" +-H5BLD_LDFLAGS="@AM_LDFLAGS@ @LDFLAGS@" +-H5BLD_LIBS="@LIBS@" ++H5BLD_LDFLAGS= ++H5BLD_LIBS= + + CC="${HDF5_CC:-$CCBASE}" + CLINKER="${HDF5_CLINKER:-$CLINKERBASE}" +@@ -105,7 +105,8 @@ LIBS="${HDF5_LIBS:-$LIBSBASE}" + # available library is shared, it will be used by default. The user can + # override either default, although choosing an unavailable library will result + # in link errors. +-STATIC_AVAILABLE="@enable_static@" ++# Fedora prefers shared libraries ++STATIC_AVAILABLE=no + if test "${STATIC_AVAILABLE}" = "yes"; then + USE_SHARED_LIB="${HDF5_USE_SHLIB:-no}" + else +@@ -385,7 +386,7 @@ if test "x$do_link" = "xyes"; then + # paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in + # from the hdf5 build. The order of the flags is intended to give precedence + # to the user's flags. +- $SHOW $CLINKER $H5BLD_CPPFLAGS $CPPFLAGS $H5BLD_CFLAGS $CFLAGS $LDFLAGS $clibpath $link_objs $LIBS $link_args $shared_link ++ $SHOW $CLINKER $H5BLD_CPPFLAGS $CPPFLAGS $H5BLD_CFLAGS $CFLAGS $LDFLAGS $clibpath $link_objs $LIBS $link_args + status=$? + fi + +diff -up hdf5-1.10.7/c++/src/h5c++.in.wrappers hdf5-1.10.7/c++/src/h5c++.in +--- hdf5-1.10.7/c++/src/h5c++.in.wrappers 2020-08-27 21:38:23.000000000 -0600 ++++ hdf5-1.10.7/c++/src/h5c++.in 2020-10-07 20:24:29.126283325 -0600 +@@ -87,10 +87,10 @@ CXXLINKERBASE="@CXX@" + # paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in + # from the hdf5 build. The order of the flags is intended to give precedence + # to the user's flags. +-H5BLD_CXXFLAGS="@AM_CXXFLAGS@ @CXXFLAGS@" ++H5BLD_CXXFLAGS= + H5BLD_CPPFLAGS="@AM_CPPFLAGS@ @CPPFLAGS@" +-H5BLD_LDFLAGS="@AM_LDFLAGS@ @LDFLAGS@" +-H5BLD_LIBS="@LIBS@" ++H5BLD_LDFLAGS= ++H5BLD_LIBS= + + CXX="${HDF5_CXX:-$CXXBASE}" + CXXLINKER="${HDF5_CLINKER:-$CXXLINKERBASE}" +@@ -103,7 +103,8 @@ LIBS="${HDF5_LIBS:-$LIBSBASE}" + # available library is shared, it will be used by default. The user can + # override either default, although choosing an unavailable library will result + # in link errors. +-STATIC_AVAILABLE="@enable_static@" ++# Fedora prefers shared libraries ++STATIC_AVAILABLE=no + if test "${STATIC_AVAILABLE}" = "yes"; then + USE_SHARED_LIB="${HDF5_USE_SHLIB:-no}" + else +@@ -385,7 +386,7 @@ if test "x$do_link" = "xyes"; then + # from the hdf5 build. The order of the flags is intended to give precedence + # to the user's flags. + +- $SHOW $CXXLINKER $H5BLD_CPPFLAGS $CPPFLAGS $H5BLD_CXXFLAGS $CXXFLAGS $LDFLAGS $clibpath $link_objs $LIBS $link_args $shared_link ++ $SHOW $CXXLINKER $H5BLD_CPPFLAGS $CPPFLAGS $H5BLD_CXXFLAGS $CXXFLAGS $LDFLAGS $clibpath $link_objs $LIBS $link_args + + status=$? + fi +diff -up hdf5-1.10.7/fortran/src/h5fc.in.wrappers hdf5-1.10.7/fortran/src/h5fc.in +--- hdf5-1.10.7/fortran/src/h5fc.in.wrappers 2020-08-27 21:38:23.000000000 -0600 ++++ hdf5-1.10.7/fortran/src/h5fc.in 2020-10-07 20:25:53.793962985 -0600 +@@ -83,11 +83,11 @@ FLINKERBASE="@FC@" + # libraries in $link_args, followed by any external library paths and libraries + # from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in from the hdf5 build. + # The order of the flags is intended to give precedence to the user's flags. +-H5BLD_FCFLAGS="@AM_FCFLAGS@ @FCFLAGS@" ++H5BLD_FCFLAGS= + F9XMODFLAG="@F9XMODFLAG@" + F9XSUFFIXFLAG="@F9XSUFFIXFLAG@" +-H5BLD_LDFLAGS="@AM_LDFLAGS@ @LDFLAGS@" +-H5BLD_LIBS="@LIBS@" ++H5BLD_LDFLAGS= ++H5BLD_LIBS= + + FC="${HDF5_FC:-$FCBASE}" + FLINKER="${HDF5_FLINKER:-$FLINKERBASE}" +@@ -99,7 +99,8 @@ LIBS="${HDF5_LIBS:-$LIBSBASE}" + # available library is shared, it will be used by default. The user can + # override either default, although choosing an unavailable library will result + # in link errors. +-STATIC_AVAILABLE="@enable_static@" ++# Fedora prefers shared libraries ++STATIC_AVAILABLE=no + if test "${STATIC_AVAILABLE}" = "yes"; then + USE_SHARED_LIB="${HDF5_USE_SHLIB:-no}" + else +@@ -363,7 +364,7 @@ if test "x$do_link" = "xyes"; then + # libraries in $link_args, followed by any external library paths and libraries + # from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in from the hdf5 build. + # The order of the flags is intended to give precedence to the user's flags. +- $SHOW $FLINKER $FCFLAGS $H5BLD_FCFLAGS $F9XSUFFIXFLAG $LDFLAGS $fmodules $link_objs $LIBS $link_args $shared_link ++ $SHOW $FLINKER $FCFLAGS $H5BLD_FCFLAGS $F9XSUFFIXFLAG $LDFLAGS $fmodules $link_objs $LIBS $link_args + status=$? + fi + diff --git a/hdf5.spec b/hdf5.spec new file mode 100644 index 0000000000000000000000000000000000000000..f2af7c697501a3695993a562909cf458ac8c4399 --- /dev/null +++ b/hdf5.spec @@ -0,0 +1,467 @@ +%define anolis_release 1 + +%global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d) +%global so_version 200 + +%ifarch %{java_arches} +%bcond_without java +%else +%bcond_with java +%endif + +Name: hdf5 +Version: 1.12.1 +Release: %{anolis_release}%{?dist} +Summary: A general purpose library and file format for storing scientific data +License: BSD +URL: https://portal.hdfgroup.org/display/HDF5/HDF5 + +%global version_main %(echo %version | cut -d. -f-2) +Source0: https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-%{version_main}/hdf5-%{version}/src/hdf5-%{version}.tar.bz2 +Source1: http://ftp.us.debian.org/debian/pool/main/h/hdf5/hdf5_1.12.0+repack-1~exp2.debian.tar.xz +Patch0: hdf5-LD_LIBRARY_PATH.patch +Patch1: hdf5-gfortran12.patch +Patch2: hdf5-build.patch +Patch3: hdf5-wrappers.patch +Patch4: hdf5-configure-c99.patch + +BuildRequires: gcc-gfortran +%if %{with java} +BuildRequires: java-devel +BuildRequires: javapackages-tools +BuildRequires: hamcrest +BuildRequires: junit +BuildRequires: slf4j +%else +Obsoletes: java-hdf5 < %{version}-%{release} +%endif +BuildRequires: krb5-devel +BuildRequires: openssl-devel +BuildRequires: time +BuildRequires: zlib-devel +BuildRequires: hostname +BuildRequires: automake +BuildRequires: libtool +BuildRequires: openssh-clients +BuildRequires: libaec-devel +BuildRequires: gcc, gcc-c++ + +%global with_mpich 1 +%global with_openmpi 1 + +%if %{with_mpich} +%global mpi_list mpich +%endif +%if %{with_openmpi} +%global mpi_list %{?mpi_list} openmpi +%endif + +%description +HDF5 is a general purpose library and file format for storing scientific data. +HDF5 can store two primary objects: datasets and groups. A dataset is +essentially a multidimensional array of data elements, and a group is a +structure for organizing objects in an HDF5 file. Using these two basic +objects, one can create and store almost any kind of scientific data +structure, such as images, arrays of vectors, and structured and unstructured +grids. You can also mix and match them in HDF5 files according to your needs. + + +%package devel +Summary: HDF5 development files +Requires: %{name} = %{version}-%{release} +Requires: libaec-devel +Requires: zlib-devel +Requires: gcc-gfortran + +%description devel +HDF5 development headers and libraries. + +%if %{with java} +%package -n java-hdf5 +Summary: HDF5 java library +Requires: slf4j +Obsoletes: jhdf5 < 3.3.2^ + +%description -n java-hdf5 +HDF5 java library +%endif + +%package static +Summary: HDF5 static libraries +Requires: %{name}-devel = %{version}-%{release} + +%description static +HDF5 static libraries. + + +%if %{with_mpich} +%package mpich +Summary: HDF5 mpich libraries +BuildRequires: mpich-devel +Provides: %{name}-mpich2 = %{version}-%{release} +Obsoletes: %{name}-mpich2 < 1.8.11 + +%description mpich +HDF5 parallel mpich libraries + + +%package mpich-devel +Summary: HDF5 mpich development files +Requires: %{name}-mpich = %{version}-%{release} +Requires: libaec-devel +Requires: zlib-devel +Requires: mpich-devel +Provides: %{name}-mpich2-devel = %{version}-%{release} +Obsoletes: %{name}-mpich2-devel < 1.8.11 + +%description mpich-devel +HDF5 parallel mpich development files + + +%package mpich-static +Summary: HDF5 mpich static libraries +Requires: %{name}-mpich-devel = %{version}-%{release} +Provides: %{name}-mpich2-static = %{version}-%{release} +Obsoletes: %{name}-mpich2-static < 1.8.11 + +%description mpich-static +HDF5 parallel mpich static libraries +%endif + + +%if %{with_openmpi} +%package openmpi +Summary: HDF5 openmpi libraries +BuildRequires: openmpi-devel +BuildRequires: make + +%description openmpi +HDF5 parallel openmpi libraries + + +%package openmpi-devel +Summary: HDF5 openmpi development files +Requires: %{name}-openmpi = %{version}-%{release} +Requires: libaec-devel +Requires: zlib-devel +Requires: openmpi-devel + +%description openmpi-devel +HDF5 parallel openmpi development files + + +%package openmpi-static +Summary: HDF5 openmpi static libraries +Requires: %{name}-openmpi-devel = %{version}-%{release} + +%description openmpi-static +HDF5 parallel openmpi static libraries +%endif + + +%prep +%autosetup -a 1 -n %{name}-%{version}%{?snaprel} -p1 + +%if %{with java} +find . ! -name junit.jar -name "*.jar" -delete +ln -s %{_javadir}/hamcrest/hamcrest.jar java/lib/hamcrest-core.jar +ln -s %{_javadir}/slf4j/api.jar java/lib/slf4j-api-1.7.25.jar +ln -s %{_javadir}/slf4j/nop.jar java/lib/ext/slf4j-nop-1.7.25.jar +ln -s %{_javadir}/slf4j/simple.jar java/lib/ext/slf4j-simple-1.7.25.jar +%endif + +# Force shared by default for compiler wrappers +sed -i -e '/^STATIC_AVAILABLE=/s/=.*/=no/' */*/h5[cf]*.in +autoreconf -f -i + +# Modify low optimization level for gnu compilers +sed -e 's|-O -finline-functions|-O3 -finline-functions|g' -i config/gnu-flags + +%build +%global _configure ../configure +%global configure_opts \\\ + --disable-silent-rules \\\ + --enable-fortran \\\ + --enable-hl \\\ + --enable-shared \\\ + --with-szlib \\\ +%{nil} + +export CC=gcc +export CXX=g++ +export F9X=gfortran +export LDFLAGS="%{__global_ldflags} -fPIC -Wl,-z,now -Wl,--as-needed" +mkdir build +pushd build +ln -s ../configure . +%configure \ + %{configure_opts} \ + --enable-cxx \ +%if %{with java} + --enable-java \ +%endif + --with-default-plugindir=%{_libdir}/hdf5/plugin +sed -i -e 's| -shared | -Wl,--as-needed\0|g' libtool +sed -r -i 's|^prefix=/usr|prefix=%{buildroot}/usr|' java/test/junit.sh +%make_build LDFLAGS="%{__global_ldflags} -fPIC -Wl,-z,now -Wl,--as-needed" +popd + +#MPI builds +export LDFLAGS="%{__global_ldflags} -fPIC -Wl,-z,now -Wl,--as-needed" +for mpi in %{?mpi_list} +do + mkdir $mpi + pushd $mpi + module load mpi/$mpi-%{_arch} + ln -s ../configure . + %configure \ + %{configure_opts} \ + CC=mpicc CXX=mpicxx F9X=mpif90 \ + FCFLAGS="$FCFLAGS -I$MPI_FORTRAN_MOD_DIR" \ + --enable-parallel \ + --exec-prefix=%{_libdir}/$mpi \ + --libdir=%{_libdir}/$mpi/lib \ + --bindir=%{_libdir}/$mpi/bin \ + --sbindir=%{_libdir}/$mpi/sbin \ + --includedir=%{_includedir}/$mpi-%{_arch} \ + --datarootdir=%{_libdir}/$mpi/share \ + --mandir=%{_libdir}/$mpi/share/man \ + --with-default-plugindir=%{_libdir}/$mpi/hdf5/plugin + sed -i -e 's! -shared ! -Wl,--as-needed\0!g' libtool + %make_build LDFLAGS="%{__global_ldflags} -fPIC -Wl,-z,now -Wl,--as-needed" + module purge + popd +done + + +%install +%make_install -C build +rm %{buildroot}%{_libdir}/*.la +mkdir -p %{buildroot}%{_fmoddir} +mv %{buildroot}%{_includedir}/*.mod %{buildroot}%{_fmoddir} +sed -i -e 's,%{_includedir},%{_fmoddir},' %{buildroot}%{_bindir}/h5fc +mkdir -p %{buildroot}%{_libdir}/hdf5/plugin +for mpi in %{?mpi_list} +do + module load mpi/$mpi-%{_arch} + %make_install -C $mpi + rm %{buildroot}/%{_libdir}/$mpi/lib/*.la + mkdir -p %{buildroot}${MPI_FORTRAN_MOD_DIR} + mv %{buildroot}%{_includedir}/${mpi}-%{_arch}/*.mod %{buildroot}${MPI_FORTRAN_MOD_DIR}/ + sed -i -e "s,%{_includedir},${MPI_FORTRAN_MOD_DIR}," %{buildroot}%{_libdir}/$mpi/bin/h5pfc + mkdir -p %{buildroot}%{_libdir}/$mpi/hdf5/plugin + module purge +done +find %{buildroot}%{_datadir} \( -name '*.[ch]*' -o -name '*.f90' \) -exec chmod -x {} + + +# rpm macro for version checking +mkdir -p %{buildroot}%{macrosdir} +cat > %{buildroot}%{macrosdir}/macros.hdf5 < - 1.12.1-1 +- init from upstream diff --git a/hdf5_1.12.0+repack-1~exp2.debian.tar.xz b/hdf5_1.12.0+repack-1~exp2.debian.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..3c2cc3c63814fc001d8bf9b70a7ab6e016c9a3d0 Binary files /dev/null and b/hdf5_1.12.0+repack-1~exp2.debian.tar.xz differ