Skip to content

Commit f3edb9f

Browse files
committed
improve runner arch detection logic [wheel build]
1 parent 0ae2447 commit f3edb9f

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

requirements/ci_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
spin==0.13
22
# Keep this in sync with ci32_requirements.txt
33
scipy-openblas32==0.3.29.265.0
4-
scipy-openblas64==0.3.29.265.0 ; sys_platform != 'win32' or platform_machine != 'arm64'
4+
scipy-openblas64==0.3.29.265.0 ; sys_platform != 'win32' or platform_machine != 'ARM64'

tools/wheels/cibw_before_build.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,23 @@ fi
3131
if [[ "$INSTALL_OPENBLAS" = "true" ]] ; then
3232
# by default, use scipy-openblas64
3333
OPENBLAS=openblas64
34-
if [[ $RUNNER_ARCH != "X64" ]] ; then
35-
# Possible values in github are X86, X64, ARM, or ARM64
36-
# On macos-arm64 and win32 we do not use OpenBLAS
37-
# On win-arm64 we use # 32-bit interfaces (scipy_openblas32)
34+
# Possible values for RUNNER_ARCH in github are
35+
# X86, X64, ARM, or ARM64
36+
# TODO: should we detect a missing RUNNER_ARCH and use platform.machine()
37+
# when wheel build is run outside github?
38+
# On 32-bit platforms, use scipy_openblas32
39+
# On win-arm64 use scipy_openblas32
40+
if [[ $RUNNER_ARCH == "X86" || $RUNNER_ARCH == "ARM" ]] ; then
41+
OPENBLAS=openblas32
42+
elif [[ $RUNNER_ARCH == "ARM64" && $RUNNER_OS == "Windows" ]] ; then
3843
OPENBLAS=openblas32
3944
fi
4045
echo PKG_CONFIG_PATH is $PKG_CONFIG_PATH, OPENBLAS is ${OPENBLAS}
4146
PKG_CONFIG_PATH=$PROJECT_DIR/.openblas
4247
rm -rf $PKG_CONFIG_PATH
4348
mkdir -p $PKG_CONFIG_PATH
4449
python -m pip install -r requirements/ci_requirements.txt
45-
python -c "import scipy_openblas64; print(scipy_${OPENBLAS}.get_pkg_config())" > $PKG_CONFIG_PATH/scipy-openblas.pc
50+
python -c "import scipy_${OPENBLAS}; print(scipy_${OPENBLAS}.get_pkg_config())" > $PKG_CONFIG_PATH/scipy-openblas.pc
4651
# Copy the shared objects to a path under $PKG_CONFIG_PATH, the build
4752
# will point $LD_LIBRARY_PATH there and then auditwheel/delocate-wheel will
4853
# pull these into the wheel. Use python to avoid windows/posix problems

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy