-
Notifications
You must be signed in to change notification settings - Fork 21
/
dockcross-manylinux-build-module-wheels.sh
executable file
·43 lines (37 loc) · 1.27 KB
/
dockcross-manylinux-build-module-wheels.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
39
40
41
42
43
#!/bin/bash
# Run this script to build the Python wheel packages for Linux for an ITK
# external module.
#
# Versions can be restricted by passing them in as arguments to the script
# For example,
#
# scripts/dockcross-manylinux-build-module-wheels.sh cp39
#
# Shared libraries can be included in the wheel by exporting them to LD_LIBRARY_PATH before
# running this script.
#
# For example,
#
# export LD_LIBRARY_PATH="/path/to/OpenCL.so:/path/to/OpenCL.so.1.2"
# scripts/dockcross-manylinux-build-module-wheels.sh cp39
#
MANYLINUX_VERSION=_2_28
IMAGE_TAG=20221128-2024e4b
# Generate dockcross scripts
docker run --rm dockcross/manylinux${MANYLINUX_VERSION}-x64:${IMAGE_TAG} > /tmp/dockcross-manylinux-x64
chmod u+x /tmp/dockcross-manylinux-x64
script_dir=$(cd $(dirname $0) || exit 1; pwd)
mkdir -p $(pwd)/tools
chmod 777 $(pwd)/tools
# Build wheels
mkdir -p dist
DOCKER_ARGS="-v $(pwd)/dist:/work/dist/ -v $script_dir/..:/ITKPythonPackage -v $(pwd)/tools:/tools"
# Mount any shared libraries
if [[ -n ${LD_LIBRARY_PATH} ]]; then
for libpath in ${LD_LIBRARY_PATH//:/ }; do
DOCKER_ARGS+=" -v ${libpath}:/usr/lib64/$(basename -- ${libpath})"
done
fi
/tmp/dockcross-manylinux-x64 \
-a "$DOCKER_ARGS" \
"/ITKPythonPackage/scripts/internal/manylinux-build-module-wheels.sh" "$@"