!2 upgrade netcdf from 4.4.1 to 4.7.3

From: @caodongxia
Reviewed-by: @overweight
Signed-off-by: @overweight
This commit is contained in:
openeuler-ci-bot 2021-05-17 16:21:43 +08:00 committed by Gitee
commit 0d08d49b67
3 changed files with 228 additions and 89 deletions

View File

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