summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 01c268a550d1f52c1d570af6297623955a928890 (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
# Maintainer: Daniel Bershatsky <bepshatsky@yandex.ru>
pkgname=nntile
pkgver=1.0.0
pkgrel=1
pkgdesc='A neural network training framework within a task-based parallel programming paradigm'
arch=('x86_64')
url='https://github.com/skolai/nntile'
license=('MIT')
groups=()
depends=('openblas' 'openmpi')
makedepends=('cmake' 'clang' 'ninja' 'hwloc' 'python-build' 'python-installer' 'python-wheel' 'python-setuptools')
optdepends=()
source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/$pkgver.tar.gz"
        'python-nntile.diff')
sha256sums=('78ca839f60326984c95e14e2efbedeb03933f0c5f66210a5c5446bd1da23a0fd'
            'SKIP')

prepare() {
    cd NNTile-$pkgver
    patch -p0 -i../python-nntile.diff
}

build() {
    cd $srcdir/NNTile-$pkgver
    export MPICH_CXX=clang++
    cmake -B build/relwithdebinfo -S . -G Ninja \
        -DCMAKE_BUILD_TYPE=RelWithDebInfo \
        -DCMAKE_CXX_COMPILER=clang++ \
        -DCMAKE_CUDA_ARCHITECTURES=80
    cmake --build build/relwithdebinfo

    # Build python bindings.
    cd build/relwithdebinfo/wrappers/python
    python -m build -nw .
}

package() {
    # Install nntile's binaries.
    cd $srcdir/NNTile-$pkgver
    cmake --install build/relwithdebinfo --prefix $pkgdir/usr

    # Install missing files manually.
    cd $srcdir/NNTile-$pkgver
    install -m 755 -D -t $pkgdir/usr/lib build/relwithdebinfo/libnntile.so

    # Install nntile's python bindings.
    cd $srcdir/NNTile-$pkgver/build/relwithdebinfo/wrappers/python
    python -m installer \
        --compile-bytecode=1 \
        --destdir=$pkgdir \
        dist/nntile-0.0.0-*-*-*.whl
}