summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8ddd1f71ac66737311ed11cc7e4bc7261399ce6c (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
# Maintainer: Leo Mao <leomaoyw at gmail dot com>
pkgname=python-cupy
_pkgname=cupy
pkgver=9.6.0
_cubver=1.8.0
_jitify_commit=60e9e7231fe7529ecfc76fa97b9c02b3033f4157
pkgrel=1
pkgdesc="NumPy-like API accelerated with CUDA"
_github="cupy/cupy"
url="https://cupy.dev"
arch=('x86_64')
license=('MIT')
depends=('cuda' 'cudnn' 'nccl' 'python-numpy' 'python-fastrlock')
makedepends=('python' 'python-setuptools' 'cython')
optdepends=('libcutensor')
source=("https://github.com/cupy/cupy/archive/v$pkgver.tar.gz"
        "https://github.com/NVIDIA/cub/archive/$_cubver.tar.gz"
        "https://github.com/NVIDIA/jitify/archive/$_jitify_commit.zip")
md5sums=('2f252190f770b5bf86c162a2cf7312e7'
         '9203ea2499b56782601fddf8a12e9b08'
         '73cf45dcb46f20e27d16b23243fe9efe')

prepare() {
  cd "$srcdir/$_pkgname-$pkgver"
  rmdir cupy/_core/include/cupy/cub
  ln -srfT "$srcdir/cub-$_cubver" cupy/_core/include/cupy/cub
  rmdir cupy/_core/include/cupy/jitify
  ln -srfT "$srcdir/jitify-$_jitify_commit" cupy/_core/include/cupy/jitify
  #ln -srf "$srcdir/cub-$_cubver" cupy/_core/include/cupy/cub
  export CC=/opt/cuda/bin/gcc
  export CXX=/opt/cuda/bin/g++
  # We can use c++14 if the cuda version is greater than 11.
  # See https://github.com/cupy/cupy/issues/3346 for more details.
  #cuda_ver=$(pacman -Q cuda | awk '{print $2}')
  #if [[ $(vercmp $cuda_ver 11) -ge 0 ]]; then
    #sed 's|c++11|c++14|g' -i cupy_setup_build.py
  #fi
}

build() {
  cd "$srcdir/$_pkgname-$pkgver"
  python setup.py build
}

package() {
  cd "$srcdir/$_pkgname-$pkgver"
  python setup.py install --skip-build --prefix=/usr --root="$pkgdir" --optimize=1
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}