summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b4c6af292176a94d8bc6ca2a4e2675542fbb94b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Maintainer: Hans-Nikolai Viessmann <hans AT viess.mn>
# Contributor: eolianoe <eolianoe At GoogleMAIL DoT com>
# Contributor: jedbrown

pkgname=papi-cuda
pkgver=6.0.0
pkgrel=1
pkgdesc='Performance Application Programming Interface (with CUDA componet)'
arch=('x86_64' 'i686')
url='http://icl.cs.utk.edu/papi/'
license=('BSD')
provides=("papi=${pkgver}")
conflicts=('papi' 'libpfm4')
depends=('python' 'gcc-fortran' 'cuda')
optdepends=('openmpi: for MPI applications')
source=("http://icl.cs.utk.edu/projects/papi/downloads/papi-${pkgver}.tar.gz"
        'cuda-component-build-targets.patch')
sha256sums=('3442709dae3405c2845b304c06a8b15395ecf4f3899a89ceb4d715103cb4055f'
            '0b93df095425fd5d5a9166bb4d62a71a9ab62708b9364cb9da4193d2b60a890f')

prepare() {
  cd "${srcdir}/papi-${pkgver}/src"

  # resolve issue with NVCC not understand `-Wl` flag
  patch -p1 < $srcdir/cuda-component-build-targets.patch
}

build() {
  cd "${srcdir}/papi-${pkgver}/src"

  export CFLAGS="-fPIC ${CFLAGS}"
  export CC=gcc # for systems with other CC installed
  export F77=gfortran # for systems with other FC installed
  export CUDA_DIR=/opt/cuda
  export CUPTI_DIR=/opt/cuda/extras/CUPTI
  ./configure \
    --prefix=/usr \
    --with-static-lib=yes --with-shared-lib=yes \
    --mandir=/usr/share/man \
    --with-perf-events \
    --with-components="cuda"

  make
}

check(){
  cd "${srcdir}/papi-${pkgver}/src"

  make test
}

package() {
  cd "${srcdir}/papi-${pkgver}/src"

  make DESTDIR="${pkgdir}" install
  chmod 644 $pkgdir/usr/share/papi/papi_events.csv
  install -Dm644 ${srcdir}/papi-${pkgver}/LICENSE.txt \
    ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
}