-
Notifications
You must be signed in to change notification settings - Fork 41
/
build.sh
executable file
·77 lines (69 loc) · 2.13 KB
/
build.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/usr/bin/env bash
VERSION=
DEBUG=
PROFILE=
KUAFU=1
while [[ "$#" -gt 0 ]]; do
case $1 in
--debug) DEBUG=1;;
--profile) PROFILE=1;;
--no-kuafu) KUAFU=;;
35) VERSION="35";;
36) VERSION="36";;
37) VERSION="37";;
38) VERSION="38";;
39) VERSION="39";;
310) VERSION="310";;
311) VERSION="311";;
esac
shift
done
[ -z $VERSION ] && echo "Version not specified" && exit || echo "Compile for Python ${VERSION}"
[ $DEBUG ] && echo "Debug Mode" || [ $PROFILE ] && echo "Profile Mode" || echo "Release Mode"
KUAFU_ARG=
[ ! $KUAFU ] && echo "Kuafu disabled" && KUAFU_ARG="--no-kuafu"
function build_manylinux14_wheel() {
PY_VERSION=$1
if [ "$PY_VERSION" -eq 35 ]; then
PY_DOT=3.5
EXT="m"
elif [ "$PY_VERSION" -eq 36 ]; then
PY_DOT=3.6
EXT="m"
elif [ "$PY_VERSION" -eq 37 ]; then
PY_DOT=3.7
EXT="m"
elif [ "$PY_VERSION" -eq 38 ]; then
PY_DOT=3.8
EXT=""
elif [ "$PY_VERSION" -eq 39 ]; then
PY_DOT=3.9
EXT=""
elif [ "$PY_VERSION" -eq 310 ]; then
PY_DOT=3.10
EXT=""
elif [ "$PY_VERSION" -eq 311 ]; then
PY_DOT=3.11
EXT=""
else
echo "Error, python version not found!"
fi
INCLUDE_PATH=/opt/python/cp${PY_VERSION}-cp${PY_VERSION}${EXT}/include/python${PY_DOT}${EXT}
BIN=/opt/python/cp${PY_VERSION}-cp${PY_VERSION}${EXT}/bin/python
echo "Using bin path ${BIN}"
echo "Using include path ${INCLUDE_PATH}"
export CPLUS_INCLUDE_PATH=$INCLUDE_PATH
COMMAND="${BIN} setup.py bdist_wheel ${KUAFU_ARG}"
[ $PROFILE ] && COMMAND="${BIN} setup.py bdist_wheel --profile ${KUAFU_ARG}"
[ $DEBUG ] && COMMAND="${BIN} setup.py bdist_wheel --debug ${KUAFU_ARG}"
echo "Running command ${COMMAND}"
eval "$COMMAND"
PACKAGE_VERSION=$(<./python/VERSION)
echo "SAPIEN version ${PACKAGE_VERSION}"
WHEEL_NAME="./dist/sapien-${PACKAGE_VERSION}-cp${PY_VERSION}-cp${PY_VERSION}${EXT}-linux_x86_64.whl"
if test -f "$WHEEL_NAME"; then
echo "$FILE exist, begin audit and repair"
fi
auditwheel repair ${WHEEL_NAME} --exclude libvulkan --internal libsapien
}
build_manylinux14_wheel $VERSION