Skip to content

Commit

Permalink
netcdf: also build openmpi package
Browse files Browse the repository at this point in the history
Build an additional netcdf MPI (parallel) package netcdf-openmpi.
  • Loading branch information
jurobystricky committed Mar 26, 2020
1 parent effaa42 commit 3e34b72
Show file tree
Hide file tree
Showing 7 changed files with 124 additions and 6 deletions.
30 changes: 30 additions & 0 deletions configure_misses
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 8 additions & 0 deletions configure_openmpi
Original file line number Diff line number Diff line change
@@ -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 "
81 changes: 78 additions & 3 deletions netcdf.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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}

Expand Down Expand Up @@ -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 "
Expand All @@ -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
Expand All @@ -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

Expand All @@ -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
3 changes: 3 additions & 0 deletions options.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10
11
4 changes: 2 additions & 2 deletions testresults
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Total : 192
Pass : 192
Total : 386
Pass : 386
Fail : 0
Skip : 0
XFail : 0
2 changes: 2 additions & 0 deletions used_libs
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ libcurl.so.4
libhdf5.so.103
libhdf5_hl.so.100
libm.so.6
libmpi.so.40
libpthread.so.0

0 comments on commit 3e34b72

Please sign in to comment.