%global releaseno 2 # default build for openmpi3, run with --define='mpivariant openmpi' # for building for openmpi1 %if ! 0%{?mpivariant:1} %global mpivariant openmpi %endif %define mpivariant_clean %(echo %{mpivariant}|sed -e 's/[-.]/_/g') %global _mpi_load %{_%{mpivariant_clean}_load} %global _mpi_unload %{_%{mpivariant_clean}_unload} Name: pnetcdf Version: 1.11.1 Release: %{releaseno}%{dist} URL: https://parallel-netcdf.github.io/ Source0: https://parallel-netcdf.github.io/Release/%{name}-%{version}.tar.gz License: Northwestern University and Argonne National Laboratory Buildrequires: m4 Buildrequires: %{mpivariant}-devel # see also https://fedoraproject.org/wiki/Packaging:MPI Summary: Parallel I/O library for accessing NetCDF files in CDF-1, 2, and 5 formats. %description PnetCDF (Parallel netCDF), a collaborative work of Argonne National Laboratory and Northwestern University, is a parallel I/O library for accessing NetCDF files in CDF-1, 2, and 5 formats. %package -n pnetcdf-%{mpivariant} Summary: Parallel I/O library for accessing NetCDF files in CDF-1, 2, and 5 formats. %description -n pnetcdf-%{mpivariant} PnetCDF (Parallel netCDF), a collaborative work of Argonne National Laboratory and Northwestern University, is a parallel I/O library for accessing NetCDF files in CDF-1, 2, and 5 formats. This package contains PnetCDF runtime library and executables. %package -n pnetcdf-%{mpivariant}-devel Summary: Development files for PnetCDF. Requires: pnetcdf-%{mpivariant} = %{version}-%{release} %description -n pnetcdf-%{mpivariant}-devel This package contains development files and headers for PnetCDF (Parallel netCDF) library. %prep %setup -q %build # TODO mpi-versionise also debuginfo package to avoid conflicts %define debug_package %{nil} %{_mpi_load} # TODO improve use of configure macro CFLAGS="${CFLAGS:--O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic}" ; export CFLAGS ; CXXFLAGS="${CXXFLAGS:--O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic}" ; export CXXFLAGS ; FFLAGS="${FFLAGS:--O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -I/usr/lib64/gfortran/modules}" ; export FFLAGS ; FCFLAGS="${FCFLAGS:--O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -I/usr/lib64/gfortran/modules}" ; export FCFLAGS ; LDFLAGS="${LDFLAGS:--Wl,-z,relro }"; export LDFLAGS; ./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu \ --program-prefix= \ --disable-dependency-tracking \ --prefix=/usr \ --exec-prefix=/usr \ --bindir=$MPI_BIN \ --sbindir=/usr/sbin \ --sysconfdir=$MPI_SYSCONFIG \ --datadir=/usr/share \ --includedir=$MPI_INCLUDE \ --libdir=$MPI_LIB \ --libexecdir=/usr/libexec \ --localstatedir=/var \ --sharedstatedir=/var/lib \ --mandir=$MPI_MAN \ --infodir=/usr/share/info \ --enable-shared --disable-static --enable-doxygen %define make /usr/bin/make %make %{_mpi_unload} %check %{_mpi_load} %define make /usr/bin/make # TODO fix tests #make check %{_mpi_unload} %install [ "%{buildroot}" != / ] && rm -rf %{buildroot} %{_mpi_load} %define make /usr/bin/make make install DESTDIR=%{buildroot} # keep copyright %__mkdir_p %{buildroot}$MPI_HOME/share/%{name} %__cp AUTHORS COPYING COPYRIGHT CREDITS README RELEASE_NOTES \ %{buildroot}$MPI_HOME/share/%{name} # create file lists with variables from mpi module cat > $RPM_BUILD_DIR/%{name}-%{version}/files.list << EOF %defattr(-,root,root) $MPI_BIN/ncmpidiff $MPI_BIN/ncmpidump $MPI_BIN/ncmpigen $MPI_BIN/ncoffsets $MPI_BIN/ncvalidator $MPI_BIN/pnetcdf-config $MPI_BIN/pnetcdf_version $MPI_LIB/pkgconfig/pnetcdf.pc $MPI_LIB/libpnetcdf.so.* %doc $MPI_MAN/man1/nc* %doc $MPI_MAN/man1/pnetcdf* %doc $MPI_MAN/man3/pnetcdf* %dir $MPI_HOME/share/%{name} %doc $MPI_HOME/share/%{name}/* EOF cat > $RPM_BUILD_DIR/%{name}-%{version}/files-devel.list << EOF %defattr(-,root,root) $MPI_INCLUDE/pnetcdf* %exclude $MPI_LIB/libpnetcdf.la $MPI_LIB/libpnetcdf.so EOF %{_mpi_unload} %files -n pnetcdf-%{mpivariant} -f files.list %files -n pnetcdf-%{mpivariant}-devel -f files-devel.list %changelog * Mon Jul 29 2019 Davide Cesari - 1.11.1-2 - Install in mpi-specific directories * Mon Apr 15 2019 Daniele Branchini - 1.11.1-1 - First build