summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: dcab5b4add05afa5a0d88a676994024ba0b9524f (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
# Maintainer: Daniel Bershatsky <bepshatsky@yandex.ru>

pkgname=python-jaxlib
pkgver=0.5.3
pkgrel=1
pkgdesc='XLA library for JAX'
arch=('x86_64')
url='https://github.com/jax-ml/jax/'
license=('Apache-2.0')
groups=('jax')
depends=('python-absl'
         'python-ml-dtypes>=0.4.0'
         'python-numpy'
         'python-scipy')
makedepends=('clang18' 'python-build' 'python-installer' 'python-setuptools' 'python-wheel')
_bazel_ver=7.4.1
source=("jax-${pkgver}.tar.gz::$url/archive/refs/tags/jax-v${pkgver}.tar.gz"
        "bazel-${_bazel_ver}-linux-x86_64::https://github.com/bazelbuild/bazel/releases/download/${_bazel_ver}/bazel-${_bazel_ver}-linux-x86_64")
sha256sums=('1094581a30ec069965f4e3e67d60262570cc3dd016adc62073bc24347b14270c'
            'c97f02133adce63f0c28678ac1f21d65fa8255c80429b588aeeba8a1fac6202b')

prepare() {
    ln -sf $(readlink bazel-${_bazel_ver}-linux-x86_64) $srcdir/jax-jax-v${pkgver}/build
    chmod +x $srcdir/bazel-${_bazel_ver}-linux-x86_64
}

build() {
    # Override default version.
    export JAXLIB_RELEASE=$pkgver

    cd $srcdir/jax-jax-v$pkgver
    python build/build.py build \
        --wheels=jaxlib \
        --bazel_path="$srcdir/bazel-${_bazel_ver}-linux-x86_64" \
        --bazel_startup_options="--output_user_root=$srcdir/bazel"\
        --bazel_options='--action_env=JAXLIB_RELEASE' \
        --use_clang --clang_path='/usr/lib/llvm18/bin/clang' \
        --target_cpu_features=release \
        --verbose
}

package() {
    cd jax-jax-v$pkgver
    install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
    python -m installer --compile-bytecode=1 --destdir=$pkgdir \
        dist/jaxlib-$pkgver-*.whl
}