#----------------------------------------------------------------------------bh- # This RPM .spec file is part of the OpenHPC project. # # It may have been modified from the default version supplied by the underlying # release package (if available) in order to apply patches, perform customized # build/install configurations, and supply additional files to support # desired integration conventions. # #----------------------------------------------------------------------------eh- # Serial HDF5 library build that is dependent on compiler toolchain %define ohpc_compiler_dependent 1 %include %{_sourcedir}/OHPC_macros # Base package name %define pname hdf5 Summary: A general purpose library and file format for storing scientific data Name: %{pname}-%{compiler_family}%{PROJ_DELIM} Version: 1.10.5 Release: 1%{?dist} License: Hierarchical Data Format (HDF) Software Library and Utilities License Group: %{PROJ_NAME}/io-libs URL: http://www.hdfgroup.org/HDF5 Source0: https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/%{pname}-%{version}/src/%{pname}-%{version}.tar.bz2 Patch0: h5cc.patch Patch1: h5fc.patch Patch2: h5cxx.patch BuildRequires: zlib-devel Requires: zlib #!BuildIgnore: post-build-checks rpmlint-Factory # Default library install path %define install_path %{OHPC_LIBS}/%{compiler_family}/%{pname}/%version %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. %prep %setup -q -n %{pname}-%{version} %patch0 -p0 %patch1 -p0 %patch2 -p0 # Fix building with gcc8 (this should be a patch) sed "s/\(.*\)(void) HDF_NO_UBSAN/HDF_NO_UBSAN \1(void)/" -i src/H5detect.c %build # override with newer config.guess for aarch64 %ifarch aarch64 || ppc64le cp /usr/lib/rpm/config.guess bin %endif # OpenHPC compiler/mpi designation %ohpc_setup_compiler ./configure --prefix=%{install_path} \ --enable-fortran \ --enable-static=no \ --enable-shared \ --enable-cxx \ --enable-fortran2003 || { cat config.log && exit 1; } %if "%{compiler_family}" == "llvm" || "%{compiler_family}" == "arm" %{__sed} -i -e 's#wl=""#wl="-Wl,"#g' libtool %{__sed} -i -e 's#pic_flag=""#pic_flag=" -fPIC -DPIC"#g' libtool %endif make %{?_smp_mflags} %install # OpenHPC compiler designation %ohpc_setup_compiler export NO_BRP_CHECK_RPATH=true make %{?_smp_mflags} DESTDIR=$RPM_BUILD_ROOT install # Remove static libraries find "%buildroot" -type f -name "*.la" | xargs rm -f find "%buildroot" # OpenHPC module file %{__mkdir_p} %{buildroot}%{OHPC_MODULEDEPS}/%{compiler_family}/%{pname} %{__cat} << EOF > %{buildroot}/%{OHPC_MODULEDEPS}/%{compiler_family}/%{pname}/%{version} #%Module1.0##################################################################### proc ModulesHelp { } { puts stderr " " puts stderr "This module loads the %{PNAME} library built with the %{compiler_family} compiler toolchain." puts stderr "\nVersion %{version}\n" } module-whatis "Name: %{PNAME} built with %{compiler_family} toolchain" module-whatis "Version: %{version}" module-whatis "Category: runtime library" module-whatis "Description: %{summary}" module-whatis "%{url}" set version %{version} prepend-path PATH %{install_path}/bin prepend-path INCLUDE %{install_path}/include prepend-path LD_LIBRARY_PATH %{install_path}/lib setenv %{PNAME}_DIR %{install_path} setenv %{PNAME}_BIN %{install_path}/bin setenv %{PNAME}_LIB %{install_path}/lib setenv %{PNAME}_INC %{install_path}/include family "hdf5" EOF %{__cat} << EOF > %{buildroot}/%{OHPC_MODULEDEPS}/%{compiler_family}/%{pname}/.version.%{version} #%Module1.0##################################################################### ## ## version file for %{pname}-%{version} ## set ModulesVersion "%{version}" EOF %{__mkdir_p} ${RPM_BUILD_ROOT}/%{_docdir} %files %{OHPC_PUB} %doc COPYING %doc README.txt