This commit is contained in:
caodongxia 2021-05-17 11:36:49 +08:00
parent dbc8658913
commit 68859ef707
3 changed files with 228 additions and 89 deletions

View File

@ -1,162 +1,297 @@
Name: netcdf
Version: 4.4.1.1
Release: 11
Summary: Unidata network Common Data Format Libraries
License: NetCDF
URL: http://www.unidata.ucar.edu/software/netcdf/
Source0: https://github.com/Unidata/netcdf-c/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Version: 4.7.3
Release: 1
Summary: Libraries for the Unidata network Common Data Form
BuildRequires: libtool chrpath doxygen hdf-static hdf5-devel gawk libcurl-devel
BuildRequires: m4 zlib-devel openssh-clients mpich-devel hdf5-mpich-devel >= 1.8.4
BuildRequires: openssh-clients openmpi-devel hdf5-openmpi-devel >= 1.8.4
Requires: hdf5 = %{_hdf5_version} hdf5-mpich = %{_hdf5_version} hdf5-openmpi = %{_hdf5_version}
Provides: %{name}-mpich2 = %{version}-%{release} %{name}-mpich = %{version}-%{release}
Provides: %{name}-openmpi = %{version}-%{release}
Obsoletes: %{name}-mpich2 < 4.3.0-4 %{name}-mpich < %{version}-%{release}
Obsoletes: %{name}-openmpi < %{version}-%{release}
License: NetCDF
URL: https://github.com/Unidata/netcdf-c
Source0: https://github.com/Unidata/netcdf-c/archive/v%{version}/%{name}-%{version}.tar.gz
BuildRequires: make
BuildRequires: environment-modules
BuildRequires: libtool
BuildRequires: chrpath
BuildRequires: doxygen
BuildRequires: hdf-static
BuildRequires: hdf5-devel
BuildRequires: gawk
BuildRequires: libcurl-devel
BuildRequires: m4
BuildRequires: zlib-devel
%ifarch %{valgrind_arches}
BuildRequires: valgrind
%endif
BuildRequires: openssh-clients
Requires: hdf5%{?_isa} = %{_hdf5_version}
%global with_mpich 1
%global with_openmpi 1
%if %{with_mpich}
%global mpi_list mpich
%endif
%if %{with_openmpi}
%global mpi_list %{?mpi_list} openmpi
%endif
%description
NetCDF (Network Common Data Form) is a set of software libraries and machine-independent data formats
that support the creation, accessand sharing of array-oriented scientific data.
It is also a community standard for sharing scientific data.
The Unidata Program Center supports and maintains netCDF programming interfaces for C, C++, Java and Fortran.
Programming interfaces are also available for Python, IDL, MATLAB, R, Ruby and Perl.
NetCDF (network Common Data Form) is an interface for array-oriented
data access and a freely-distributed collection of software libraries
for C, Fortran, C++, and perl that provides an implementation of the
interface. The NetCDF library also defines a machine-independent
format for representing scientific data. Together, the interface,
library, and format support the creation, access, and sharing of
scientific data. The NetCDF software was developed at the Unidata
Program Center in Boulder, Colorado.
%package devel
Summary: Development files for netcdf
Requires: %{name} = %{version}-%{release} pkgconfig hdf5-devel libcurl-devel
Requires: %{name}-mpich-devel = %{version}-%{release} %{name}-openmpi = %{version}-%{release} openmpi-devel hdf5-openmpi-devel
Requires: %{name}-openmpi-devel = %{version}-%{release}
Provides: %{name}-static = %{version}-%{release} %{name}-mpich-devel = %{version}-%{release} %{name}-mpich-static = %{version}-%{release}
Provides: %{name}-mpich2-devel = %{version}-%{release} %{name}-mpich2-static = %{version}-%{release}
Provides: %{name}-openmpi-devel = %{version}-%{release} %{name}-openmpi-static = %{version}-%{release}
Obsoletes: %{name}-static < %{version}-%{release} %{name}-mpich-devel < %{version}-%{release} %{name}-mpich-static < %{version}-%{release}
Obsoletes: %{name}-mpich2-devel < 4.3.0-4 %{name}-mpich2-static < 4.3.0-4
Obsoletes: %{name}-openmpi-devel < %{version}-%{release} %{name}-openmpi-static < %{version}-%{release}
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: pkgconfig%{?_isa}
Requires: hdf5-devel%{?_isa}
Requires: libcurl-devel%{?_isa}
%description devel
This package contains the netCDF C header files, shared devel libs.
This package contains the netCDF C header files, shared devel libs, and
man pages.
%package help
Summary: Helpful information for netcdf
%description help
Documents and helpful information for netcdf.
%package static
Summary: Static libs for netcdf
Requires: %{name}%{?_isa} = %{version}-%{release}
%description static
This package contains the netCDF C static libs.
%if %{with_mpich}
%package mpich
Summary: NetCDF mpich libraries
Requires: hdf5-mpich%{?_isa} = %{_hdf5_version}
BuildRequires: mpich-devel
BuildRequires: hdf5-mpich-devel >= 1.8.4
Provides: %{name}-mpich2 = %{version}-%{release}
Obsoletes: %{name}-mpich2 < 4.3.0-4
%description mpich
NetCDF parallel mpich libraries
%package mpich-devel
Summary: NetCDF mpich development files
Requires: %{name}-mpich%{?_isa} = %{version}-%{release}
Requires: pkgconfig%{?_isa}
Requires: hdf5-mpich-devel%{?_isa}
Requires: libcurl-devel%{?_isa}
Provides: %{name}-mpich2-devel = %{version}-%{release}
Obsoletes: %{name}-mpich2-devel < 4.3.0-4
%description mpich-devel
NetCDF parallel mpich development files
%package mpich-static
Summary: NetCDF mpich static libraries
Requires: %{name}-mpich-devel%{?_isa} = %{version}-%{release}
Provides: %{name}-mpich2-static = %{version}-%{release}
Obsoletes: %{name}-mpich2-static < 4.3.0-4
%description mpich-static
NetCDF parallel mpich static libraries
%endif
%if %{with_openmpi}
%package openmpi
Summary: NetCDF openmpi libraries
Requires: hdf5-openmpi%{?_isa} = %{_hdf5_version}
BuildRequires: openmpi-devel
BuildRequires: hdf5-openmpi-devel >= 1.8.4
%description openmpi
NetCDF parallel openmpi libraries
%package openmpi-devel
Summary: NetCDF openmpi development files
Requires: %{name}-openmpi%{_isa} = %{version}-%{release}
Requires: openmpi-devel%{?_isa}
Requires: pkgconfig%{?_isa}
Requires: hdf5-openmpi-devel%{?_isa}
Requires: libcurl-devel%{?_isa}
%description openmpi-devel
NetCDF parallel openmpi development files
%package openmpi-static
Summary: NetCDF openmpi static libraries
Requires: %{name}-openmpi-devel%{?_isa} = %{version}-%{release}
%description openmpi-static
NetCDF parallel openmpi static libraries
%endif
%prep
%autosetup -n %{name}-c-%{version}
m4 libsrc/ncx.m4 > libsrc/ncx.c
%autosetup -p1 -n %{name}-c-%{version}
%build
%global _configure ../configure
export LDFLAGS="%{__global_ldflags} -L%{_libdir}/hdf"
export CFLAGS="%{optflags} -fno-strict-aliasing"
%global configure_opts \\\
--enable-shared \\\
--enable-netcdf-4 \\\
--enable-dap \\\
--enable-extra-example-tests \\\
CPPFLAGS=-I%{_includedir}/hdf \\\
LIBS="-ldf -ljpeg -ltirpc" \\\
LIBS="-ltirpc" \\\
--enable-hdf4 \\\
--disable-dap-remote-tests \\\
%{nil}
export LDFLAGS="%{__global_ldflags} -L%{_libdir}/hdf"
libtoolize --force
# Serial build
mkdir build
cd build
pushd build
ln -s ../configure .
%configure %{configure_opts}
make -j2
cd ../
%make_build
popd
export CC=mpicc
for mpi in mpich openmpi
# MPI builds
%if %{with_mpich}
for mpi in %{mpi_list}
do
mkdir $mpi
cd $mpi
pushd $mpi
module load mpi/$mpi-%{_arch}
ln -s ../configure .
%configure %{configure_opts} --libdir=%{_libdir}/$mpi/lib \
--bindir=%{_libdir}/$mpi/bin --sbindir=%{_libdir}/$mpi/sbin --includedir=%{_includedir}/$mpi-%{_arch} \
--datarootdir=%{_libdir}/$mpi/share --mandir=%{_libdir}/$mpi/share/man \
%{nil}
make -j2
# parallel tests hang on s390(x)
%configure %{configure_opts} \
CC=mpicc \
--libdir=%{_libdir}/$mpi/lib \
--bindir=%{_libdir}/$mpi/bin \
--sbindir=%{_libdir}/$mpi/sbin \
--includedir=%{_includedir}/$mpi-%{_arch} \
--datarootdir=%{_libdir}/$mpi/share \
--mandir=%{_libdir}/$mpi/share/man \
--enable-parallel-tests
%make_build
module purge
cd ../
popd
done
%endif
%install
make -C build install DESTDIR=${RPM_BUILD_ROOT}
%delete_la
/bin/rm -f ${RPM_BUILD_ROOT}%{_libdir}/*.la
chrpath --delete ${RPM_BUILD_ROOT}/%{_bindir}/nc{copy,dump,gen,gen3}
rm -f ${RPM_BUILD_ROOT}%{_infodir}/dir
for mpi in mpich openmpi
/bin/rm -f ${RPM_BUILD_ROOT}%{_infodir}/dir
%if %{with_mpich}
for mpi in %{mpi_list}
do
module load mpi/$mpi-%{_arch}
make -C $mpi install DESTDIR=${RPM_BUILD_ROOT}
%delete_la
rm $RPM_BUILD_ROOT/%{_libdir}/$mpi/lib/*.la
chrpath --delete ${RPM_BUILD_ROOT}/%{_libdir}/$mpi/bin/nc{copy,dump,gen,gen3}
module purge
done
%endif
%check
# Set to 1 to fail if tests fail
fail=1
make -C build check || ( cat build/*/test-suite.log && exit $fail )
for mpi in mpich openmpi
do
module load mpi/$mpi-%{_arch}
make -C $mpi check || ( cat $mpi/*/test-suite.log && exit $fail )
module purge
done
%post
/sbin/ldconfig
%postun
/sbin/ldconfig
make %{?_smp_mflags} -C build check
%ldconfig_scriptlets
%files
%doc COPYRIGHT README.md RELEASE_NOTES.md
%{_bindir}/{nccopy,ncdump,ncgen,ncgen3}
%{_libdir}/*.so.11*
%{_libdir}/mpich/bin/{nccopy,ncdump,ncgen,ncgen3}
%{_libdir}/mpich/lib/*.so.11*
%{_libdir}/openmpi/bin/{nccopy,ncdump,ncgen,ncgen3}
%{_libdir}/openmpi/lib/*.so.11*
%license COPYRIGHT
%doc README.md RELEASE_NOTES.md
%{_bindir}/nccopy
%{_bindir}/ncdump
%{_bindir}/ncgen
%{_bindir}/ncgen3
%{_libdir}/*.so.15*
%{_mandir}/man1/*
%files devel
%doc examples
%{_bindir}/nc-config
%{_includedir}/{netcdf.h,netcdf_meta.h,netcdf_mem.h}
%{_includedir}/netcdf.h
%{_includedir}/netcdf_aux.h
%{_includedir}/netcdf_dispatch.h
%{_includedir}/netcdf_filter.h
%{_includedir}/netcdf_meta.h
%{_includedir}/netcdf_mem.h
%{_libdir}/libnetcdf.settings
%{_libdir}/*.so
%{_libdir}/pkgconfig/netcdf.pc
%{_mandir}/man3/*
%files static
%{_libdir}/*.a
%if %{with_mpich}
%files mpich
%license COPYRIGHT
%doc README.md RELEASE_NOTES.md
%{_libdir}/mpich/bin/nccopy
%{_libdir}/mpich/bin/ncdump
%{_libdir}/mpich/bin/ncgen
%{_libdir}/mpich/bin/ncgen3
%{_libdir}/mpich/lib/*.so.15*
%doc %{_libdir}/mpich/share/man/man1/*.1*
%files mpich-devel
%{_libdir}/mpich/bin/nc-config
%{_includedir}/mpich-%{_arch}
%{_includedir}/mpich-%{_arch}/netcdf.h
%{_includedir}/mpich-%{_arch}/netcdf_aux.h
%{_includedir}/mpich-%{_arch}/netcdf_dispatch.h
%{_includedir}/mpich-%{_arch}/netcdf_filter.h
%{_includedir}/mpich-%{_arch}/netcdf_meta.h
%{_includedir}/mpich-%{_arch}/netcdf_mem.h
%{_includedir}/mpich-%{_arch}/netcdf_par.h
%{_libdir}/mpich/lib/libnetcdf.settings
%{_libdir}/mpich/lib/*.so
%{_libdir}/mpich/lib/pkgconfig/%{name}.pc
%doc %{_libdir}/mpich/share/man/man3/*.3*
%files mpich-static
%{_libdir}/mpich/lib/*.a
%endif
%if %{with_openmpi}
%files openmpi
%license COPYRIGHT
%doc README.md RELEASE_NOTES.md
%{_libdir}/openmpi/bin/nccopy
%{_libdir}/openmpi/bin/ncdump
%{_libdir}/openmpi/bin/ncgen
%{_libdir}/openmpi/bin/ncgen3
%{_libdir}/openmpi/lib/*.so.15*
%doc %{_libdir}/openmpi/share/man/man1/*.1*
%files openmpi-devel
%{_libdir}/openmpi/bin/nc-config
%{_includedir}/openmpi-%{_arch}
%{_includedir}/openmpi-%{_arch}/netcdf.h
%{_includedir}/openmpi-%{_arch}/netcdf_aux.h
%{_includedir}/openmpi-%{_arch}/netcdf_dispatch.h
%{_includedir}/openmpi-%{_arch}/netcdf_filter.h
%{_includedir}/openmpi-%{_arch}/netcdf_meta.h
%{_includedir}/openmpi-%{_arch}/netcdf_mem.h
%{_includedir}/openmpi-%{_arch}/netcdf_par.h
%{_libdir}/openmpi/lib/libnetcdf.settings
%{_libdir}/openmpi/lib/*.so
%{_libdir}/openmpi/lib/pkgconfig/%{name}.pc
%{_libdir}/openmpi/lib/*.a
%files help
%{_mandir}/man1/*
%{_mandir}/man3/*
%doc %{_libdir}/mpich/share/man/man1/*.1*
%doc %{_libdir}/mpich/share/man/man3/*.3*
%doc %{_libdir}/openmpi/share/man/man1/*.1*
%doc %{_libdir}/openmpi/share/man/man3/*.3*
%files openmpi-static
%{_libdir}/openmpi/lib/*.a
%endif
%changelog
* Fri Tue 30 2021 caodongxia <caodongxia@huawei.com> - 4.7.3-1
- Upgrade to 4.7.3
* Mon Mar 9 2020 tangjing <tangjing30@huawei.com> - 4.4.1.1-11
- Package init

4
netcdf.yaml Normal file
View File

@ -0,0 +1,4 @@
version_control: github
src_repo: Unidata/netcdf-c
tag_prefix: "v^"
separator: "."