1 # Maintainer: Bruno Pagani <archange@archlinux.org>
2 # Contributor: Ronald van Haren <ronald.archlinux.org>
3 # Contributor: damir <damir@archlinux.org>
7 pkgname=${_pkg}-${_mpi}
10 pkgdesc="NetCDF fortran bindings with parallel support (${_mpi} version)"
12 url="https://github.com/Unidata/netcdf-fortran"
14 depends=(gcc-libs netcdf-openmpi curl)
15 makedepends=(cmake gcc-fortran doxygen)
16 checkdepends=(valgrind inetutils)
19 options=(!makeflags staticlibs)
20 source=(${url}/archive/v${pkgver}/${_pkg}-${pkgver}.tar.gz)
21 sha256sums=('8194aa70e400c0adfc456127c1d97af2c6489207171d13b10cd754a16da8b0ca')
24 export CC=mpicc FC=mpifort
25 cmake -B build -S ${_pkg}-${pkgver} \
26 -DCMAKE_INSTALL_PREFIX=/usr \
27 -DCMAKE_BUILD_TYPE=Release \
28 -DENABLE_FILTER_TEST=ON \
29 -DENABLE_LARGE_FILE_TESTS=ON \
30 -DENABLE_PARALLEL_TESTS=ON \
31 -DTEST_WITH_VALGRIND=ON
36 export OMPI_MCA_opal_warn_on_missing_libcuda=0
37 # This is required starting with OpenMPI 3.0 when trying to run more
38 # processes than the number of available cores
39 export OMPI_MCA_rmaps_base_oversubscribe=yes
45 make -C build DESTDIR="${pkgdir}" install
46 install -Dm644 ${_pkg}-${pkgver}/COPYRIGHT -t "${pkgdir}"/usr/share/licenses/${_pkg}/
47 # Remove unwanted artifacts https://github.com/Unidata/netcdf-fortran/issues/338
48 rmdir "${pkgdir}"/usr/include/CMakeFiles/{netcdff{,_c}.dir,}
49 rm "${pkgdir}"/usr/lib/objects-RelWithDebInfo/{nf_,f}test_c/f03lib.c.o
50 rmdir "${pkgdir}"/usr/lib/objects-RelWithDebInfo/{{nf_,f}test_c,}
51 rm "${pkgdir}"/usr/lib/objects-Release/netcdff_c/nf_{lib,v2compat}.c.o
52 rmdir "${pkgdir}"/usr/lib/objects-Release/{netcdff_c,}