archrelease: copy trunk to community-x86_64
[ArchLinux/community.git] / netcdf-fortran-openmpi / trunk / PKGBUILD
blob5ff61e293bcef7de05208ff25bd1422c3624dbba
1 # Maintainer: Bruno Pagani <archange@archlinux.org>
2 # Contributor: Ronald van Haren <ronald.archlinux.org>
3 # Contributor: damir <damir@archlinux.org>
5 _pkg=netcdf-fortran
6 _mpi=openmpi
7 pkgname=${_pkg}-${_mpi}
8 pkgver=4.6.0
9 pkgrel=1
10 pkgdesc="NetCDF fortran bindings with parallel support (${_mpi} version)"
11 arch=(x86_64)
12 url="https://github.com/Unidata/netcdf-fortran"
13 license=(custom)
14 depends=(gcc-libs netcdf-openmpi curl)
15 makedepends=(cmake gcc-fortran doxygen)
16 checkdepends=(valgrind inetutils)
17 provides=("${_pkg}")
18 conflicts=("${_pkg}")
19 options=(!makeflags staticlibs)
20 source=(${url}/archive/v${pkgver}/${_pkg}-${pkgver}.tar.gz)
21 sha256sums=('8194aa70e400c0adfc456127c1d97af2c6489207171d13b10cd754a16da8b0ca')
23 build() {
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
32   make -C build
35 check() {
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
41   make -C build test
44 package() {
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,}