summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0b888dc1ac72c48c9e7bbda02fd4b455f4563a0f (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
#!/bin/bash

# Maintainer: PumpkinCheshire <me at pumpkincheshire dot com>
# Contributor: crl <crl18039102576 at 126 dot com>

pkgname=python-taichi
pkgver=1.7.3
pkgrel=1
pkgdesc='Productive & portable programming language for high-performance, sparse & differentiable computing on CPUs & GPUs'
url='https://github.com/taichi-dev/taichi'
arch=('x86_64')
license=('Apache-2.0')
depends=(
  'python'
  'python-rich'
  'python-numpy'
  'pybind11'
  'python-pillow'
  'python-colorama'
  'python-dill'
)
makedepends=(
  'git'
  'python-build'
  'python-installer'
  'python-setuptools'
  'clang'
  'ninja'
  'cmake'
  'cuda'
  'clang15'
  'llvm15')
_tag="v$pkgver"
source=("git+$url.git#tag=$_tag" "taichi.patch")
b2sums=('SKIP' 'SKIP')
options=(!debug)

prepare() {
    cd "$srcdir/taichi"
    git submodule update --init --recursive
    git apply ../taichi.patch
}

build() {
    cd "$srcdir/taichi"
    export TAICHI_CMAKE_ARGS="$TAICHI_CMAKE_ARGS -DTI_WITH_VULKAN=ON -DTI_WITH_METAL=OFF"
    export TAICHI_CMAKE_ARGS="$TAICHI_CMAKE_ARGS -DCMAKE_CXX_COMPILER=/usr/lib/llvm15/bin/clang++ -DCMAKE_C_COMPILER=/usr/lib/llvm15/bin/clang"
    export TAICHI_CMAKE_ARGS="$TAICHI_CMAKE_ARGS -DLLVM_DIR=/usr/lib/llvm15/lib/cmake/llvm"
    # Add CUDA include path
    export TAICHI_CMAKE_ARGS="$TAICHI_CMAKE_ARGS -DCMAKE_CXX_FLAGS=\"-I/opt/cuda/targets/x86_64-linux/include\""
    export TAICHI_CMAKE_ARGS="$TAICHI_CMAKE_ARGS -DCMAKE_C_FLAGS=\"-I/opt/cuda/targets/x86_64-linux/include\""
    python -m build --wheel --no-isolation --skip-dependency-check
}

package() {
    cd "$srcdir/taichi"
    python -m installer --destdir="$pkgdir" dist/*.whl
}