package init

This commit is contained in:
jackie_wu123 2020-02-14 14:01:32 +08:00
parent ea7ecbdbe3
commit 4566b2f4da
5 changed files with 284 additions and 0 deletions

BIN
hdf5-1.8.20.tar.bz2 Normal file

Binary file not shown.

View File

@ -0,0 +1,21 @@
diff -up hdf5-1.8.13/src/Makefile.am.LD_LIBRARY_PATH hdf5-1.8.13/src/Makefile.am
--- hdf5-1.8.13/src/Makefile.am.LD_LIBRARY_PATH 2014-05-05 20:13:01.000000000 -0600
+++ hdf5-1.8.13/src/Makefile.am 2014-05-15 09:53:59.569476295 -0600
@@ -128,8 +128,6 @@ settings_DATA=libhdf5.settings
# 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)
@@ -140,8 +138,6 @@ H5Tinit.c: H5detect$(EXEEXT)
# 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)

View File

@ -0,0 +1,75 @@
diff -up hdf5-1.8.16/configure.ac.ldouble-ppc64le hdf5-1.8.16/configure.ac
--- hdf5-1.8.16/configure.ac.ldouble-ppc64le 2015-11-13 09:29:08.749125801 -0700
+++ hdf5-1.8.16/configure.ac 2015-11-13 09:47:02.705174991 -0700
@@ -2278,6 +2278,13 @@ else
unsigned char s2[8];
int ret = 1;
+#if defined __powerpc64__ && defined _LITTLE_ENDIAN
+ /* Don't bother checking on ppc64le, we know it'll work, and
+ * that what hdf5 calls 'special algorithm' simply is
+ * IBM ldouble 128 (i.e. two seperately scaled doubles).
+ * The check below assumes big endian. */
+ ret = 0;
+#endif
if(sizeof(long double) == 16 && sizeof(long) == 8) {
/*make sure the long double type has 16 bytes in size and
* 11 bits of exponent. If it is,
@@ -2355,6 +2362,13 @@ else
unsigned char s[16];
int flag=0, ret=1;
+#if defined __powerpc64__ && defined _LITTLE_ENDIAN
+ /* Don't bother checking on ppc64le, we know it'll work, and
+ * that what hdf5 calls 'special algorithm' simply is
+ * IBM ldouble 128 (i.e. two seperately scaled doubles).
+ * The check below assumes big endian. */
+ ret = 0;
+#endif
/*Determine if long double has 16 byte in size, 11 bit exponent, and
*the bias is 0x3ff */
if(sizeof(long double) == 16) {
diff -up hdf5-1.8.16/configure.ldouble-ppc64le hdf5-1.8.16/configure
diff -up hdf5-1.8.16/test/dt_arith.c.ldouble-ppc64le hdf5-1.8.16/test/dt_arith.c
--- hdf5-1.8.16/test/dt_arith.c.ldouble-ppc64le 2015-10-23 23:13:43.000000000 -0600
+++ hdf5-1.8.16/test/dt_arith.c 2015-11-13 09:29:08.765125707 -0700
@@ -3010,7 +3010,18 @@ test_conv_flt_1 (const char *name, int r
buf, saved, nelmts);
#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0
} else if(src_type == FLT_LDOUBLE) {
- INIT_FP_SPECIAL(src_size, src_nbits, sendian, LDBL_MANT_DIG, dst_size,
+ size_t mant_dig = LDBL_MANT_DIG;
+ if (mant_dig >= src_nbits) {
+ /* This happens for IBM long double in little endian.
+ The macro LDBL_MANT_DIG says 106 mantissa bits, but the
+ HDF5 detection code actually represents it as a normal 64bit
+ double (52 bit mantissa) with the upper double being
+ unspec bits (which is sort of okay as the testsuite
+ wouldn't deal with that format correctly anyway). So
+ override the mantissa size. */
+ mant_dig = 52;
+ }
+ INIT_FP_SPECIAL(src_size, src_nbits, sendian, mant_dig, dst_size,
buf, saved, nelmts);
#endif
} else
@@ -3663,7 +3674,18 @@ test_conv_int_fp(const char *name, int r
INIT_FP_DENORM(long double, LDBL_MANT_DIG, src_size, src_nbits, sendian, dst_size,
buf, saved, nelmts);
} else {
- INIT_FP_SPECIAL(src_size, src_nbits, sendian, LDBL_MANT_DIG, dst_size, buf, saved, nelmts);
+ size_t mant_dig = LDBL_MANT_DIG;
+ if (mant_dig >= src_nbits) {
+ /* This happens for IBM long double in little endian.
+ The macro LDBL_MANT_DIG says 106 mantissa bits, but the
+ HDF5 detection code actually represents it as a normal 64bit
+ double (52 bit mantissa) with the upper double being
+ unspec bits (which is sort of okay as the testsuite
+ wouldn't deal with that format correctly anyway). So
+ override the mantissa size. */
+ mant_dig = 52;
+ }
+ INIT_FP_SPECIAL(src_size, src_nbits, sendian, mant_dig, dst_size, buf, saved, nelmts);
}
#endif
} else

29
hdf5-mpi.patch Normal file
View File

@ -0,0 +1,29 @@
diff -up hdf5-1.8.16/testpar/t_pflush1.c.mpi hdf5-1.8.16/testpar/t_pflush1.c
--- hdf5-1.8.16/testpar/t_pflush1.c.mpi 2015-10-23 23:13:44.000000000 -0600
+++ hdf5-1.8.16/testpar/t_pflush1.c 2016-03-20 21:46:42.089409776 -0600
@@ -171,6 +171,7 @@ main(int argc, char* argv[])
* because MPI_File_close wants to modify the file-handle variable.
*/
+#if 0
/* close file1 */
if(H5Fget_vfd_handle(file1, fapl, (void **)&mpifh_p) < 0) {
printf("H5Fget_vfd_handle for file1 failed\n");
@@ -189,14 +190,17 @@ main(int argc, char* argv[])
printf("MPI_File_close for file2 failed\n");
goto error;
} /* end if */
+#endif
fflush(stdout);
fflush(stderr);
+ MPI_Finalize();
HD_exit(0);
error:
fflush(stdout);
fflush(stderr);
+ MPI_Finalize();
HD_exit(1);
}

159
hdf5.spec Normal file
View File

@ -0,0 +1,159 @@
Name: hdf5
Version: 1.8.20
Release: 7
Summary: A data model, library, and file format for storing and managing data
License: BSD
URL: https://portal.hdfgroup.org/display/HDF5/HDF5
Source0: https://support.hdfgroup.org/ftp/HDF5/current18/src/hdf5-%{version}.tar.bz2
Patch0: hdf5-LD_LIBRARY_PATH.patch
Patch1: hdf5-mpi.patch
Patch2: hdf5-ldouble-ppc64le.patch
BuildRequires: gcc, gcc-c++
BuildRequires: krb5-devel, openssl-devel, zlib-devel, gcc-gfortran, time
BuildRequires: automake libtool
BuildRequires: openssh-clients
BuildRequires: libaec-devel
%description
HDF5 is a data model, library, and file format for storing and managing data. It supports an unlimited variety of datatypes, and is designed for flexible and efficient I/O and for high volume and complex data. HDF5 is portable and is extensible, allowing applications to evolve in their use of HDF5. The HDF5 Technology suite includes tools and applications for managing, manipulating, viewing, and analyzing data in the HDF5 format.
%package devel
Summary: HDF5 development files
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: libaec-devel%{?_isa}
Requires: zlib-devel%{?_isa}
Requires: gcc-gfortran%{?_isa}
%description devel
HDF5 development headers and libraries.
%prep
%setup -q -n %{name}-%{version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
sed -i -e '/^STATIC_AVAILABLE=/s/=.*/=no/' */*/h5[cf]*.in
autoreconf -f -i
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-fortran2003 \\\
--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
sed -i -e 's! -shared ! -Wl,--as-needed\0!g' libtool
make LDFLAGS="%{__global_ldflags} -fPIC -Wl,-z,now -Wl,--as-needed"
popd
%install
%make_install -C build
%delete_la
cat >h5comp <<EOF
#!/bin/bash
ARCH=$(uname -m)
case $ARCH in
x86_64 ) BITS=64;;
* ) BITS=32;;
esac
exec $0-${BITS} "$@"
EOF
mkdir -p ${RPM_BUILD_ROOT}%{_fmoddir}
mv ${RPM_BUILD_ROOT}%{_includedir}/*.mod ${RPM_BUILD_ROOT}%{_fmoddir}
find ${RPM_BUILD_ROOT}%{_datadir} \( -name '*.[ch]*' -o -name '*.f90' \) -exec chmod -x {} +
%ifarch x86_64
sed -i -e s/H5pubconf.h/H5pubconf-64.h/ ${RPM_BUILD_ROOT}%{_includedir}/H5public.h
mv ${RPM_BUILD_ROOT}%{_includedir}/H5pubconf.h \
${RPM_BUILD_ROOT}%{_includedir}/H5pubconf-64.h
for x in h5c++ h5cc h5fc
do
mv ${RPM_BUILD_ROOT}%{_bindir}/${x} \
${RPM_BUILD_ROOT}%{_bindir}/${x}-64
install -m 0755 h5comp ${RPM_BUILD_ROOT}%{_bindir}/${x}
done
%else
sed -i -e s/H5pubconf.h/H5pubconf-32.h/ ${RPM_BUILD_ROOT}%{_includedir}/H5public.h
mv ${RPM_BUILD_ROOT}%{_includedir}/H5pubconf.h \
${RPM_BUILD_ROOT}%{_includedir}/H5pubconf-32.h
for x in h5c++ h5cc h5fc
do
mv ${RPM_BUILD_ROOT}%{_bindir}/${x} \
${RPM_BUILD_ROOT}%{_bindir}/${x}-32
install -m 0755 h5comp ${RPM_BUILD_ROOT}%{_bindir}/${x}
done
%endif
mkdir -p ${RPM_BUILD_ROOT}/%{_rpmmacrodir}
cat > ${RPM_BUILD_ROOT}/%{_rpmmacrodir}/macros.hdf5 <<EOF
# HDF5 version is
%%_hdf5_version %{version}
EOF
%check
make -C build check
%ldconfig_scriptlets
%files
%license COPYING
%doc MANIFEST README.txt release_docs/RELEASE.txt
%doc release_docs/HISTORY*.txt
%{_bindir}/gif2h5
%{_bindir}/h52gif
%{_bindir}/h5copy
%{_bindir}/h5debug
%{_bindir}/h5diff
%{_bindir}/h5dump
%{_bindir}/h5import
%{_bindir}/h5jam
%{_bindir}/h5ls
%{_bindir}/h5mkgrp
%{_bindir}/h5perf_serial
%{_bindir}/h5repack
%{_bindir}/h5repart
%{_bindir}/h5stat
%{_bindir}/h5unjam
%{_libdir}/*.so.10*
%{_libdir}/libhdf5_cpp.so.15*
%{_libdir}/libhdf5_hl_cpp.so.11*
%files devel
%{_bindir}/h5c++*
%{_bindir}/h5cc*
%{_bindir}/h5fc*
%{_bindir}/h5redeploy
%{_includedir}/*.h
%{_libdir}/*.so
%{_libdir}/*.settings
%{_fmoddir}/*.mod
%{_datadir}/hdf5_examples/
%{_libdir}/*.a
%{_rpmmacrodir}/macros.hdf5
%changelog
* Tue Oct 22 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.8.20-7
- Package init