23 lines
1.1 KiB
Bash
Executable File
23 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Build the release artifacts into dist/:
|
|
# simurgarray-<v>-py3-none-any.whl + simurgarray-<v>.tar.gz (pure Python)
|
|
# simurgarray_core-<v>-cp312-abi3-manylinux_2_28_{aarch64,x86_64}.whl (compiled kernels, Python >= 3.12)
|
|
# Portable Linux wheels are linked against glibc 2.28 with `maturin --zig` (cross-compiles the other architecture).
|
|
# Needs: uv, a Rust toolchain (rustup), ~60 MB for zig on first use.
|
|
# bash scripts/build_dist.sh [aarch64|x86_64|all] (default: all)
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
export PATH="$HOME/.cargo/bin:$PATH"
|
|
WHICH=${1:-all}
|
|
mkdir -p dist
|
|
uv build -o dist # sdist + pure wheel of simurgarray
|
|
MATURIN="uvx --from maturin[zig]>=1.7,<2 maturin"
|
|
for arch in aarch64 x86_64; do
|
|
[[ $WHICH == all || $WHICH == "$arch" ]] || continue
|
|
rustup target add "$arch-unknown-linux-gnu" > /dev/null
|
|
$MATURIN build --release --zig --compatibility manylinux_2_28 --target "$arch-unknown-linux-gnu" \
|
|
-m rust/simurg-core/Cargo.toml -o dist
|
|
done
|
|
( cd dist && sha256sum ./*.whl ./*.tar.gz > SHA256SUMS )
|
|
ls -la dist
|