forked from scipy/scipy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-variants.sh
More file actions
executable file
·51 lines (42 loc) · 1.21 KB
/
build-variants.sh
File metadata and controls
executable file
·51 lines (42 loc) · 1.21 KB
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
#!/bin/sh
set -ex
pip config set global.extra-index-url https://pypi.anaconda.org/mgorny/simple
LABEL=${BLAS:-openblas}
case ${BLAS:-openblas} in
openblas)
bash tools/wheels/cibw_before_build_linux.sh "${PWD}"
export PKG_CONFIG_PATH=${PWD}
;;
mkl)
pip install mkl-devel
export LDFLAGS="$LDFLAGS -Wl,-rpath,\$ORIGIN/../../../.."
;;
esac
if [ -n "${X8664}" ]; then
LABEL=x8664v4_${LABEL}
set -- "${@}" "-Cvariant=x86_64::level::${X8664}"
fi
set -- "${@}" "-Cvariant-label=${LABEL}"
if ! grep -q Ubuntu /etc/os-release; then
sudo xcode-select -s /Applications/Xcode_15.2.app
ln -s $(which gfortran-13) gfortran
export PATH=$PWD:$PATH
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
export PKG_CONFIG_PATH=${PWD}
fi
export PKG_CONFIG_PATH
pip install build auditwheel delocate
python -m build -w "${@}"
mkdir wheelhouse
# tag updating needs to be updated for variants
set -- dist/*.whl
old_name=${1#*/}
# strip variant label to avoid issues with auditwheel
mv "${1}" "${1%-*}.whl"
if grep -q Ubuntu /etc/os-release; then
auditwheel repair --exclude 'libmkl*' dist/*.whl
mv wheelhouse/*.whl "wheelhouse/${old_name}"
else
delocate-wheel -w wheelhouse dist/*.whl
mv wheelhouse/*.whl "wheelhouse/${old_name}"
fi