diff --git a/netcdf-4.4.1.1.tar.gz b/netcdf-4.4.1.1.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..9eb7ee406f2886878dbadad694323c31e1b13247 Binary files /dev/null and b/netcdf-4.4.1.1.tar.gz differ diff --git a/netcdf.spec b/netcdf.spec new file mode 100644 index 0000000000000000000000000000000000000000..3058c150d9ce01adc764d4f147dd6aa0fe6b5a1d --- /dev/null +++ b/netcdf.spec @@ -0,0 +1,162 @@ +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 + +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} + +%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. + +%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} + +%description devel +This package contains the netCDF C header files, shared devel libs. + +%package help +Summary: Helpful information for netcdf + +%description help +Documents and helpful information for netcdf. + +%prep +%autosetup -n %{name}-c-%{version} +m4 libsrc/ncx.m4 > libsrc/ncx.c + + +%build +%global _configure ../configure +%global configure_opts \\\ + --enable-shared \\\ + --enable-netcdf-4 \\\ + --enable-dap \\\ + --enable-extra-example-tests \\\ + CPPFLAGS=-I%{_includedir}/hdf \\\ + LIBS="-ldf -ljpeg -ltirpc" \\\ + --enable-hdf4 \\\ + --disable-dap-remote-tests \\\ +%{nil} +export LDFLAGS="%{__global_ldflags} -L%{_libdir}/hdf" + +libtoolize --force + +mkdir build +cd build +ln -s ../configure . +%configure %{configure_opts} +make -j2 +cd ../ + +export CC=mpicc +for mpi in mpich openmpi +do + mkdir $mpi + cd $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 + module purge + cd ../ +done + + +%install +make -C build install DESTDIR=${RPM_BUILD_ROOT} +%delete_la +chrpath --delete ${RPM_BUILD_ROOT}/%{_bindir}/nc{copy,dump,gen,gen3} +rm -f ${RPM_BUILD_ROOT}%{_infodir}/dir +for mpi in mpich openmpi +do + module load mpi/$mpi-%{_arch} + make -C $mpi install DESTDIR=${RPM_BUILD_ROOT} + %delete_la + chrpath --delete ${RPM_BUILD_ROOT}/%{_libdir}/$mpi/bin/nc{copy,dump,gen,gen3} + module purge +done + +%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 + +%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* + +%files devel +%doc examples +%{_bindir}/nc-config +%{_includedir}/{netcdf.h,netcdf_meta.h,netcdf_mem.h} +%{_libdir}/libnetcdf.settings +%{_libdir}/*.so +%{_libdir}/pkgconfig/netcdf.pc +%{_libdir}/*.a +%{_libdir}/mpich/bin/nc-config +%{_includedir}/mpich-%{_arch} +%{_libdir}/mpich/lib/libnetcdf.settings +%{_libdir}/mpich/lib/*.so +%{_libdir}/mpich/lib/pkgconfig/%{name}.pc +%{_libdir}/mpich/lib/*.a +%{_libdir}/openmpi/bin/nc-config +%{_includedir}/openmpi-%{_arch} +%{_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* + +%changelog +* Mon Mar 9 2020 tangjing - 4.4.1.1-11 +- Package init