[netcdf-fortran] Initial import

Orion Poplawski orion at fedoraproject.org
Fri Mar 9 17:23:52 UTC 2012


commit f3a9ff24f525ea55696651fd3a55909c6789417b
Author: Orion Poplawski <orion at cora.nwra.com>
Date:   Fri Mar 9 10:23:51 2012 -0700

    Initial import

 .gitignore             |    1 +
 netcdf-fflags.patch    |   12 ++
 netcdf-fortran.spec    |  302 ++++++++++++++++++++++++++++++++++++++++++++++++
 netcdf-pkgconfig.patch |   35 ++++++
 netcdf-postdeps.patch  |   17 +++
 sources                |    1 +
 6 files changed, 368 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..b963d30 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/netcdf-fortran-4.2.tar.gz
diff --git a/netcdf-fflags.patch b/netcdf-fflags.patch
new file mode 100644
index 0000000..cc8c916
--- /dev/null
+++ b/netcdf-fflags.patch
@@ -0,0 +1,12 @@
+diff -up netcdf-fortran-4.2-beta4/nf-config.in.fflags netcdf-fortran-4.2-beta4/nf-config.in
+--- netcdf-fortran-4.2-beta4/nf-config.in.fflags	2011-09-20 11:59:38.000000000 -0600
++++ netcdf-fortran-4.2-beta4/nf-config.in	2011-09-20 12:00:34.754484776 -0600
+@@ -11,7 +11,7 @@ includedir=${prefix}/include
+ cc="@CC@"
+ fc="@FC@"
+ cflags=" -I${includedir} @CPPFLAGS@" 
+-fflags="@FFLAGS@ @MOD_FLAG@${includedir}"
++fflags="@MOD_FLAG@${includedir}"
+ libs=`pkgconfig netcdf-fortran --libs`
+ flibs=`pkgconfig netcdf-fortran --flibs`
+ has_dap="@HAS_DAP@"
diff --git a/netcdf-fortran.spec b/netcdf-fortran.spec
new file mode 100644
index 0000000..5b18515
--- /dev/null
+++ b/netcdf-fortran.spec
@@ -0,0 +1,302 @@
+Name:           netcdf-fortran
+Version:        4.2
+Release:        3%{?dist}
+Summary:        Fortran libraries for NetCDF-4
+
+Group:          Applications/Engineering
+License:        NetCDF
+URL:            http://www.unidata.ucar.edu/software/netcdf/
+Source0:        http://www.unidata.ucar.edu/downloads/netcdf/ftp/%{name}-%{version}.tar.gz
+#Use pkgconfig in nc-config to avoid multi-lib issues
+Patch0:         netcdf-pkgconfig.patch
+#Strip FFLAGS from nc-config
+Patch1:         netcdf-fflags.patch
+# Fix issue parsing mpif90 output
+Patch2:         netcdf-postdeps.patch
+BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+BuildRequires:  gcc-gfortran
+BuildRequires:  netcdf-devel
+#mpiexec segfaults if ssh is not present
+#https://trac.mcs.anl.gov/projects/mpich2/ticket/1576
+BuildRequires:  openssh-clients
+
+%global with_mpich2 1
+%global with_openmpi 1
+%if 0%{?rhel}
+%ifarch ppc64
+# No mpich2 on ppc64 in EL
+%global with_mpich2 0
+%endif
+%endif
+%ifarch s390 s390x
+# No openmpi on s390(x)
+%global with_openmpi 0
+%endif
+
+%if %{with_mpich2}
+%global mpi_list mpich2
+%endif
+%if %{with_openmpi}
+%global mpi_list %{?mpi_list} openmpi
+%endif
+
+%description
+Fortran libraries for NetCDF-4.
+
+
+%package devel
+Summary:        Development files for Fortran NetCDF API
+Group:          Development/Libraries
+Requires:       %{name}%{?_isa} = %{version}-%{release}
+Requires:       gcc-gfortran%{?_isa}
+Requires:       pkgconfig
+Requires:       netcdf-devel%{?_isa}
+
+%description devel
+This package contains the NetCDF Fortran header files, shared devel libraries,
+and man pages.
+
+
+%package static
+Summary:        Static library for Fortran NetCDF API
+Group:          Development/Libraries
+Requires:       %{name}-devel%{?_isa} = %{version}-%{release}
+
+%description static
+This package contains the NetCDF Fortran static library.
+
+
+%if %{with_mpich2}
+%package mpich2
+Summary: NetCDF Fortran mpich2 libraries
+Group: Development/Libraries
+Requires: mpich2
+BuildRequires: mpich2-devel
+BuildRequires: netcdf-mpich2-devel
+
+%description mpich2
+NetCDF Fortran parallel mpich2 libraries
+
+
+%package mpich2-devel
+Summary: NetCDF Fortran mpich2 development files
+Group: Development/Libraries
+Requires: %{name}-mpich2%{?_isa} = %{version}-%{release}
+Requires: mpich2
+Requires: gcc-gfortran%{_isa}
+Requires: pkgconfig
+Requires: netcdf-mpich2-devel
+Requires: libcurl-devel
+
+%description mpich2-devel
+NetCDF Fortran parallel mpich2 development files
+
+
+%package mpich2-static
+Summary: NetCDF Fortran mpich2 static libraries
+Group: Development/Libraries
+Requires: %{name}-mpich2-devel%{?_isa} = %{version}-%{release}
+
+%description mpich2-static
+NetCDF Fortran parallel mpich2 static libraries
+%endif
+
+
+%if %{with_openmpi}
+%package openmpi
+Summary: NetCDF Fortran openmpi libraries
+Group: Development/Libraries
+Requires: openmpi
+BuildRequires: openmpi-devel
+BuildRequires: netcdf-openmpi-devel
+
+%description openmpi
+NetCDF Fortran parallel openmpi libraries
+
+
+%package openmpi-devel
+Summary: NetCDF Fortran openmpi development files
+Group: Development/Libraries
+Requires: %{name}-openmpi%{_isa} = %{version}-%{release}
+Requires: openmpi-devel
+Requires: gcc-gfortran%{_isa}
+Requires: pkgconfig
+Requires: netcdf-openmpi-devel
+Requires: libcurl-devel
+
+%description openmpi-devel
+NetCDF Fortran parallel openmpi development files
+
+
+%package openmpi-static
+Summary: NetCDF Fortran openmpi static libraries
+Group: Development/Libraries
+Requires: %{name}-openmpi-devel%{?_isa} = %{version}-%{release}
+
+%description openmpi-static
+NetCDF Fortran parallel openmpi static libraries
+%endif
+
+
+%prep
+%setup -q
+%patch0 -p1 -b .pkgconfig
+%patch1 -p1 -b .fflags
+%patch2 -p1 -b .postdeps
+sed -i -e '1i#!/bin/sh' examples/F90/run_f90_par_examples.sh
+
+
+%build
+#Do out of tree builds
+%global _configure ../configure
+
+# Serial build
+mkdir build
+pushd build
+ln -s ../configure .
+export F77="gfortran"
+export FC="gfortran"
+export FCFLAGS="$RPM_OPT_FLAGS"
+%configure --enable-extra-example-tests
+make %{?_smp_mflags}
+popd
+
+# MPI builds
+export CC=mpicc
+# netcdf gets confused about Fortran type
+export CPPFLAGS=-DpgiFortran
+export F77=mpif90
+export FC=mpif90
+for mpi in %{mpi_list}
+do
+  mkdir $mpi
+  pushd $mpi
+  module load $mpi-%{_arch}
+  ln -s ../configure .
+  %configure \
+    --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 \
+    --enable-parallel-tests
+  make %{?_smp_mflags}
+  module purge
+  popd
+done
+
+
+%install
+make -C build install DESTDIR=${RPM_BUILD_ROOT}
+mkdir -p ${RPM_BUILD_ROOT}%{_fmoddir}
+/bin/mv ${RPM_BUILD_ROOT}%{_includedir}/*.mod  \
+  ${RPM_BUILD_ROOT}%{_fmoddir}
+/bin/rm -f ${RPM_BUILD_ROOT}%{_libdir}/*.la
+for mpi in %{mpi_list}
+do
+  module load $mpi-%{_arch}
+  make -C $mpi install DESTDIR=${RPM_BUILD_ROOT}
+  rm $RPM_BUILD_ROOT/%{_libdir}/$mpi/lib/*.la
+  gzip $RPM_BUILD_ROOT/%{_libdir}/$mpi/share/man/man3/*.3
+  module purge
+done
+/bin/rm -f ${RPM_BUILD_ROOT}%{_infodir}/dir
+
+
+%check
+make -C build check
+for mpi in mpich2 openmpi
+do
+  module load $mpi-%{_arch}
+  make -C $mpi check
+  module purge
+done
+
+
+%clean
+rm -rf ${RPM_BUILD_ROOT}
+
+
+%post
+/sbin/ldconfig
+/sbin/install-info %{_infodir}/netcdf-f77.info \
+    %{_infodir}/dir 2>/dev/null || :
+/sbin/install-info %{_infodir}/netcdf-f90.info \
+    %{_infodir}/dir 2>/dev/null || :
+
+%postun
+/sbin/ldconfig
+if [ "$1" = 0 ]; then
+  /sbin/install-info --delete %{_infodir}/netcdf-f77.info \
+    %{_infodir}/dir 2>/dev/null || :
+  /sbin/install-info --delete %{_infodir}/netcdf-f90.info \
+    %{_infodir}/dir 2>/dev/null || :
+fi
+
+
+%files
+%doc COPYRIGHT README
+%{_libdir}/*.so.*
+%{_infodir}/netcdf-f*
+
+%files devel
+%doc examples
+%{_bindir}/nf-config
+%{_includedir}/netcdf.inc
+%{_fmoddir}/*.mod
+%{_libdir}/*.so
+%{_libdir}/pkgconfig/netcdf-fortran.pc
+%{_mandir}/man3/*
+
+%files static
+%{_libdir}/*.a
+
+
+%if %{with_mpich2}
+%files mpich2
+%doc COPYRIGHT
+%{_libdir}/mpich2/lib/*.so.*
+
+%files mpich2-devel
+%{_libdir}/mpich2/bin/nf-config
+%{_includedir}/mpich2-%{_arch}/*
+%{_libdir}/mpich2/lib/*.so
+%{_libdir}/mpich2/lib/pkgconfig/%{name}.pc
+%{_libdir}/mpich2/share/man/man3/*
+
+%files mpich2-static
+%{_libdir}/mpich2/lib/*.a
+%endif
+
+%if %{with_openmpi}
+%files openmpi
+%doc COPYRIGHT
+%{_libdir}/openmpi/lib/*.so.*
+
+%files openmpi-devel
+%{_libdir}/openmpi/bin/nf-config
+%{_includedir}/openmpi-%{_arch}/*
+%{_libdir}/openmpi/lib/*.so
+%{_libdir}/openmpi/lib/pkgconfig/%{name}.pc
+%{_libdir}/openmpi/share/man/man3/*
+
+%files openmpi-static
+%{_libdir}/openmpi/lib/*.a
+%endif
+
+
+%changelog
+* Wed Mar 7 2012 Orion Poplawski <orion at cora.nwra.com> - 4.2-3
+- Don't ship info/dir file
+- Add needed shbangs
+- Compress mpi package man pages
+
+* Wed Mar 7 2012 Orion Poplawski <orion at cora.nwra.com> - 4.2-2
+- Build parallel versions
+- Ship examples with -devel
+
+* Fri Oct 7 2011 Orion Poplawski <orion at cora.nwra.com> - 4.2-1
+- Initial package
diff --git a/netcdf-pkgconfig.patch b/netcdf-pkgconfig.patch
new file mode 100644
index 0000000..5422445
--- /dev/null
+++ b/netcdf-pkgconfig.patch
@@ -0,0 +1,35 @@
+--- netcdf-fortran-4.2-beta2/nf-config.in.pkgconfig	2011-08-18 10:17:58.000000000 -0600
++++ netcdf-fortran-4.2-beta2/nf-config.in	2011-08-29 10:46:20.890471535 -0600
+@@ -8,7 +8,6 @@
+ 
+ prefix=@prefix@
+ exec_prefix=${prefix}
+-libdir=${exec_prefix}/lib
+ includedir=${prefix}/include
+ 
+ cc="@CC@"
+@@ -16,8 +15,8 @@
+ fc="@FC@"
+ cflags=" -I${includedir} @CPPFLAGS@" 
+ fflags="@FFLAGS@ @MOD_FLAG@${includedir}"
+-libs="-L${libdir} @NC_LIBS@"
+-flibs="-L${libdir} @NC_FLIBS@"
++libs=`pkgconfig netcdf-fortran --libs`
++flibs=`pkgconfig netcdf-fortran --flibs`
+ has_dap="@HAS_DAP@"
+ has_nc2="@HAS_NC2@"
+ has_nc4="@HAS_NC4@"
+@@ -141,11 +140,11 @@
+ 	;;
+ 
+      --libs)
+-       	echo $libs
++       	pkgconfig netcdf-fortran --libs
+        	;;
+ 
+     --flibs)
+-       	echo $flibs
++       	pkgconfig netcdf-fortran --flibs
+        	;;
+ 
+     --has-dap)
diff --git a/netcdf-postdeps.patch b/netcdf-postdeps.patch
new file mode 100644
index 0000000..a02fcbb
--- /dev/null
+++ b/netcdf-postdeps.patch
@@ -0,0 +1,17 @@
+diff -up netcdf-fortran-4.2/configure.postdeps netcdf-fortran-4.2/configure
+--- netcdf-fortran-4.2/configure.postdeps	2011-10-03 08:10:43.000000000 -0600
++++ netcdf-fortran-4.2/configure	2012-03-07 12:23:14.387532317 -0700
+@@ -14790,10 +14790,11 @@ if { { eval echo "\"\$as_me\":${as_linen
+     case $p in
+ 
+     -L* | -R* | -l*)
+-       # Some compilers place space between "-{L,R}" and the path.
++       # Some compilers place space between "-{L,R,l}" and the path.
+        # Remove the space.
+        if test $p = "-L" ||
+-          test $p = "-R"; then
++          test $p = "-R" ||
++          test $p = "-l"; then
+ 	 prev=$p
+ 	 continue
+        else
diff --git a/sources b/sources
index e69de29..3148a00 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+cc3bf530223e8f4aff93793b9f197bf3  netcdf-fortran-4.2.tar.gz


More information about the scm-commits mailing list