-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-wheel.sh
executable file
·38 lines (34 loc) · 1.19 KB
/
build-wheel.sh
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
#!/bin/bash
set -euo pipefail
SOURCE=package/source
WORKDIR=package/workdir
DESTDIR=package/install
ARCHLIST=${ARCHLIST:-$(uname -m)}
export CIBW_BUILD_FRONTEND='build'
export CIBW_BUILD='cp313-*'
export CIBW_SKIP='*musllinux*'
export CIBW_ARCHS=$ARCHLIST
export CIBW_BEFORE_ALL='bash {project}/cibw-build-mpi.sh'
export CIBW_TEST_COMMAND='bash {project}/cibw-check-mpi.sh'
export CIBW_ENVIRONMENT_PASS='MPINAME RELEASE SOURCE WORKDIR DESTDIR'
export CIBW_REPAIR_WHEEL_COMMAND_MACOS='delocate-wheel --ignore-missing-dependencies --exclude libmpi --exclude libpmpi --require-archs {delocate_archs -w {dest_dir} -v {wheel}'
if test "$(uname)" = Linux; then
containerengine=$(basename "$(command -v podman || command -v docker)")
export CIBW_CONTAINER_ENGINE=$containerengine
export SOURCE="/project/$SOURCE"
export WORKDIR="/host/$PWD/$WORKDIR"
export DESTDIR="/host/$PWD/$DESTDIR"
platform=linux
fi
if test "$(uname)" = Darwin; then
export SOURCE="$PWD/$SOURCE"
export WORKDIR="$PWD/$WORKDIR"
export DESTDIR="$PWD/$DESTDIR"
export CIBW_BUILD='pp310-*'
platform=macos
fi
python -m pipx run \
cibuildwheel \
--platform "$platform" \
--output-dir "${1:-dist}" \
package