# Copyright (c) 2014 Dave Love, Liverpool University # Licence: MIT, per Fedora policy %global packname pbdNCDF4 %global rlibdir %{_libdir}/R/library %global github 1 %global commit 9b59aaef205518d52c3e4d3a5065a57c57999823 %global shortcommit %(c=%{commit}; echo ${c:0:7}) Name: R-%{packname} Version: 0.1.6 Release: 1%{?dist} Summary: Programming with Big Data -- Parallel NetCDF4 Interface License: GPLv3+ URL: http://cran.r-project.org/web/packages/%{packname}/index.html %if 0%{?github} Source0: https://github.com/RBigData/pbdNCDF4//archive/%commit/pbdNCDF4-%shortcommit.tar.gz %else Source0: http://cran.r-project.org/src/contrib/%{packname}_0.1-4.tar.gz %endif # configure uses `nc-config --prefix`/include/netcdf_par.h when it should # use --includedir, but then the parallel nc-config incorrectly returns # /usr/include for that anyway. We always want to include etcdf_par.h. Patch1: pdbncdf4-mpi.patch BuildRequires: R-devel tex(latex) BuildRequires: netcdf-openmpi-devel R-pbdMPI netcdf-devel Requires: openmpi%{_isa} %description This package adds collective parallel read and write capability to the R package ncdf4 version 1.8. Typical use is as a parallel NetCDF4 file reader in SPMD style programming. Each R process reads and writes its own data in a synchronized collective mode, resulting in faster parallel performance. Performance improvement is conditional on a parallel file %prep %setup -q -c -n %{packname} #%patch1 -p1 %{?github:mv pbdNCDF4-* pbdNCDF4} %build # Have to build before install to get DESCRIPTION right. This has to # be done with serial netcdf. %_openmpi_load #export PKG_CONFIG_PATH="$MPI_LIB/pkgconfig:$PKG_CONFIG_PATH" R CMD build %{packname}* tar fx %{packname}*.tar.gz %install mkdir -p %{buildroot}%{rlibdir} %_openmpi_load # configure looks for a header in %_prefix/include sed -i -e "s|^NETCDF_HEADER=.*|NETCDF_HEADER=$MPI_INCLUDE/netcdf_par.h|" pbdNCDF4/configure # Without --no-test-load, it fails, claiming there's no pbdMPI package, # but the built result works. OMPI_MCA_orte_allocation_required=0 \ %{_bindir}/R CMD INSTALL --no-test-load \ "--configure-args=--enable-parallel --with-nc-config=$MPI_BIN/nc-config" \ -l %{buildroot}%{rlibdir} %{packname} test -d %{packname}/src && (cd %{packname}/src; rm -f *.o *.so) rm -f %{buildroot}%{rlibdir}/R.css %check %_openmpi_load OMPI_MCA_orte_allocation_required=0 \ %{_bindir}/R CMD check --no-install %{packname} %files %dir %{rlibdir}/%{packname} %doc %{rlibdir}/%{packname}/doc %doc %{rlibdir}/%{packname}/html %doc %{rlibdir}/%{packname}/DESCRIPTION %doc %{rlibdir}/%{packname}/CITATION %{rlibdir}/%{packname}/INDEX %{rlibdir}/%{packname}/NAMESPACE %{rlibdir}/%{packname}/Meta %{rlibdir}/%{packname}/R %{rlibdir}/%{packname}/help %{rlibdir}/%{packname}/R.* %{rlibdir}/%{packname}/demo %{rlibdir}/%{packname}/etc %{rlibdir}/%{packname}/libs %changelog * Tue May 25 2021 Dave Love - 0.1.6-1 - New version - Fetch from github - Remove el6 conditionals * Sat Aug 20 2016 Dave Love - 0.1.4-3 - Avoid parallel version on el6 (no netcdf-openmpi) - Replace patch with one to use netcdf_par.h * Wed Aug 17 2016 Dave Love - 0.1.4-2 - Clean spec for el6+ * Sat Nov 22 2014 Dave Love - 0.1.4-1 - initial package for Fedora - Patch for mpi build error