From 3e34b72c41a19f0705aec837a1791712cefe1bb3 Mon Sep 17 00:00:00 2001 From: Juro Bystricky Date: Thu, 26 Mar 2020 14:49:26 -0700 Subject: [PATCH] netcdf: also build openmpi package Build an additional netcdf MPI (parallel) package netcdf-openmpi. --- configure_misses | 30 ++++++++++++++++++ configure_openmpi | 8 +++++ netcdf.spec | 81 +++++++++++++++++++++++++++++++++++++++++++++-- options.conf | 3 ++ release | 2 +- testresults | 4 +-- used_libs | 2 ++ 7 files changed, 124 insertions(+), 6 deletions(-) create mode 100644 configure_openmpi diff --git a/configure_misses b/configure_misses index 82ae469..0ad2e10 100644 --- a/configure_misses +++ b/configure_misses @@ -31,4 +31,34 @@ Configure miss: whether szlib was used when building HDF5 Configure miss: whether parallel I/O is enabled for netcdf-4 Configure miss: whether parallel I/O for classic files is to be enabled Configure miss: if libtool needs -no-undefined flag to build shared libraries +Configure miss: If compilation is for use with JNA +Configure miss: valgrind +Configure miss: if fsync support is enabled +Configure miss: if jna bug workaround is enabled +Configure miss: whether reading of HDF4 SD files is to be enabled +Configure miss: whether to fetch some sample HDF4 files from Unidata ftp site to test HDF4 reading (requires wget) +Configure miss: whether we should attempt to install netcdf-fortran (EXPERIMENTAL) +Configure miss: whether netCDF-4 logging is enabled +Configure miss: mpicc option to accept ISO C89 +Configure miss: whether dap remote testing should be enabled (default on) +Configure miss: whether dap remote authorization testing should be enabled (default off) +Configure miss: whether the time-consuming dap tests should be enabled (default off) +Configure miss: whether to enable strict null-byte header padding when reading (default off) +Configure miss: whether FFIO will be used +Configure miss: whether STDIO will be used +Configure miss: whether large file (> 2GB) tests should be run +Configure miss: whether benchmarks should be run +Configure miss: if mpicc supports -fno-rtti -fno-exceptions +Configure miss: if mpicc static flag -static works +Configure miss: whether mmap is enabled for in-memory files +Configure miss: whether byte range support is enabled +Configure miss: schar +Configure miss: uchar +Configure miss: longlong +Configure miss: int64 +Configure miss: uint64 +Configure miss: H5Z_SZIP +Configure miss: whether szlib was used when building HDF5 +Configure miss: whether parallel I/O for classic files is to be enabled +Configure miss: if libtool needs -no-undefined flag to build shared libraries Configure miss: If compilation is for use with JNA \ No newline at end of file diff --git a/configure_openmpi b/configure_openmpi new file mode 100644 index 0000000..1128389 --- /dev/null +++ b/configure_openmpi @@ -0,0 +1,8 @@ +--enable-shared +--enable-netcdf-4 +--enable-dap +--disable-dap-remote-tests +--with-pic +--disable-doxygen +--enable-parallel-tests +--with-mpiexec="mpiexec -x LD_LIBRARY_PATH " diff --git a/netcdf.spec b/netcdf.spec index cf596a3..98a9fca 100644 --- a/netcdf.spec +++ b/netcdf.spec @@ -4,7 +4,7 @@ # Name : netcdf Version : 4.7.3 -Release : 10 +Release : 11 URL : https://github.com/Unidata/netcdf-c/archive/v4.7.3/netcdf-c-4.7.3.tar.gz Source0 : https://github.com/Unidata/netcdf-c/archive/v4.7.3/netcdf-c-4.7.3.tar.gz Summary : NetCDF Client Library for C @@ -14,11 +14,15 @@ Requires: netcdf-bin = %{version}-%{release} Requires: netcdf-lib = %{version}-%{release} Requires: netcdf-license = %{version}-%{release} Requires: netcdf-man = %{version}-%{release} +Requires: netcdf-openmpi = %{version}-%{release} BuildRequires : buildreq-cmake BuildRequires : chrpath BuildRequires : curl-dev BuildRequires : graphviz BuildRequires : hdf5-dev +BuildRequires : modules +BuildRequires : openmpi-dev +BuildRequires : openssh BuildRequires : util-linux BuildRequires : zlib-dev @@ -43,6 +47,7 @@ Summary: dev components for the netcdf package. Group: Development Requires: netcdf-lib = %{version}-%{release} Requires: netcdf-bin = %{version}-%{release} +Requires: netcdf-openmpi = %{version}-%{release} Provides: netcdf-devel = %{version}-%{release} Requires: netcdf = %{version}-%{release} @@ -75,16 +80,27 @@ Group: Default man components for the netcdf package. +%package openmpi +Summary: openmpi components for the netcdf package. +Group: Default + +%description openmpi +openmpi components for the netcdf package. + + %prep %setup -q -n netcdf-c-4.7.3 cd %{_builddir}/netcdf-c-4.7.3 +pushd .. +cp -a netcdf-c-4.7.3 build-openmpi +popd %build export http_proxy=http://127.0.0.1:9/ export https_proxy=http://127.0.0.1:9/ export no_proxy=localhost,127.0.0.1,0.0.0.0 export LANG=C.UTF-8 -export SOURCE_DATE_EPOCH=1574701635 +export SOURCE_DATE_EPOCH=1585259355 export GCC_IGNORE_WERROR=1 export CFLAGS="$CFLAGS -fno-lto " export FCFLAGS="$CFLAGS -fno-lto " @@ -98,18 +114,51 @@ export CXXFLAGS="$CXXFLAGS -fno-lto " --disable-doxygen make %{?_smp_mflags} +pushd ../build-openmpi/ +. /usr/share/defaults/etc/profile.d/modules.sh +module load openmpi +export CFLAGS="$CFLAGS -m64 -march=haswell" +export CXXFLAGS="$CXXFLAGS -m64 -march=haswell" +export FCFLAGS="$FCFLAGS -m64 -march=haswell" +export FFLAGS="$FFLAGS -m64 -march=haswell" +export LDFLAGS="$LDFLAGS -m64 -march=haswell" +./configure --program-prefix= --exec-prefix=$MPI_ROOT \ +--libdir=$MPI_LIB --bindir=$MPI_BIN --sbindir=$MPI_BIN --includedir=$MPI_INCLUDE \ +--datarootdir=$MPI_ROOT/share --mandir=$MPI_MAN -exec-prefix=$MPI_ROOT --sysconfdir=$MPI_SYSCONFIG \ +--build=x86_64-generic-linux-gnu --host=x86_64-generic-linux-gnu --target=x86_64-clr-linux-gnu \ +--disable-static --enable-shared \ +--enable-netcdf-4 \ +--enable-dap \ +--disable-dap-remote-tests \ +--with-pic \ +--disable-doxygen \ +--enable-parallel-tests \ +--with-mpiexec="mpiexec -x LD_LIBRARY_PATH " +make %{?_smp_mflags} +module unload openmpi +popd %check export LANG=C.UTF-8 export http_proxy=http://127.0.0.1:9/ export https_proxy=http://127.0.0.1:9/ export no_proxy=localhost,127.0.0.1,0.0.0.0 make VERBOSE=1 V=1 %{?_smp_mflags} check +cd ../build-openmpi; +module load openmpi +export OMPI_MCA_rmaps_base_oversubscribe=1 +make VERBOSE=1 V=1 %{?_smp_mflags} check +module unload openmpi %install -export SOURCE_DATE_EPOCH=1574701635 +export SOURCE_DATE_EPOCH=1585259355 rm -rf %{buildroot} mkdir -p %{buildroot}/usr/share/package-licenses/netcdf cp %{_builddir}/netcdf-c-4.7.3/COPYRIGHT %{buildroot}/usr/share/package-licenses/netcdf/1b45343da188e7ec176d9443c8c3312798532bfc +pushd ../build-openmpi/ +module load openmpi +%make_install_openmpi +module unload openmpi +popd %make_install %files @@ -134,6 +183,17 @@ cp %{_builddir}/netcdf-c-4.7.3/COPYRIGHT %{buildroot}/usr/share/package-licenses /usr/include/netcdf_meta.h /usr/lib64/libh5bzip2.so /usr/lib64/libnetcdf.so +/usr/lib64/openmpi/include/netcdf.h +/usr/lib64/openmpi/include/netcdf_aux.h +/usr/lib64/openmpi/include/netcdf_dispatch.h +/usr/lib64/openmpi/include/netcdf_filter.h +/usr/lib64/openmpi/include/netcdf_mem.h +/usr/lib64/openmpi/include/netcdf_meta.h +/usr/lib64/openmpi/include/netcdf_par.h +/usr/lib64/openmpi/lib/libh5bzip2.so +/usr/lib64/openmpi/lib/libnetcdf.settings +/usr/lib64/openmpi/lib/libnetcdf.so +/usr/lib64/openmpi/lib/pkgconfig/netcdf.pc /usr/lib64/pkgconfig/netcdf.pc /usr/share/man/man3/netcdf.3 @@ -152,3 +212,18 @@ cp %{_builddir}/netcdf-c-4.7.3/COPYRIGHT %{buildroot}/usr/share/package-licenses /usr/share/man/man1/ncdump.1 /usr/share/man/man1/ncgen.1 /usr/share/man/man1/ncgen3.1 + +%files openmpi +%defattr(-,root,root,-) +/usr/lib64/openmpi/bin/nc-config +/usr/lib64/openmpi/bin/nccopy +/usr/lib64/openmpi/bin/ncdump +/usr/lib64/openmpi/bin/ncgen +/usr/lib64/openmpi/bin/ncgen3 +/usr/lib64/openmpi/lib/libnetcdf.so.15 +/usr/lib64/openmpi/lib/libnetcdf.so.15.2.1 +/usr/lib64/openmpi/share/man/man1/nccopy.1 +/usr/lib64/openmpi/share/man/man1/ncdump.1 +/usr/lib64/openmpi/share/man/man1/ncgen.1 +/usr/lib64/openmpi/share/man/man1/ncgen3.1 +/usr/lib64/openmpi/share/man/man3/netcdf.3 diff --git a/options.conf b/options.conf index b89abf0..599a49c 100644 --- a/options.conf +++ b/options.conf @@ -4,6 +4,7 @@ url = https://github.com/Unidata/netcdf-c/archive/v4.7.3/netcdf-c-4.7.3.tar.gz archives = giturl = https://github.com/Unidata/netcdf-c.git domain = +alias = [autospec] # build 32 bit libraries @@ -38,6 +39,8 @@ no_autostart = false nodebug = false # disable stripping binaries nostrip = false +# configure build also for openmpi +openmpi = true # optimize build for size over speed optimize_size = false # set profile for pgo diff --git a/release b/release index f599e28..b4de394 100644 --- a/release +++ b/release @@ -1 +1 @@ -10 +11 diff --git a/testresults b/testresults index 400b791..c23f64b 100644 --- a/testresults +++ b/testresults @@ -1,5 +1,5 @@ -Total : 192 -Pass : 192 +Total : 386 +Pass : 386 Fail : 0 Skip : 0 XFail : 0 diff --git a/used_libs b/used_libs index 6972b30..6ccd35a 100644 --- a/used_libs +++ b/used_libs @@ -3,3 +3,5 @@ libcurl.so.4 libhdf5.so.103 libhdf5_hl.so.100 libm.so.6 +libmpi.so.40 +libpthread.so.0