Skip to content

Commit 0f9690c

Browse files
committed
add DYLD_LIBRARY_PATH for arm64, specify python3.11 arch type
1 parent 28d38d7 commit 0f9690c

File tree

3 files changed

+24
-16
lines changed

3 files changed

+24
-16
lines changed

tools/build_steps.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@ MB_PYTHON_VERSION=3.9
99
function before_build {
1010
# Manylinux Python version set in build_lib
1111
if [ -n "$IS_OSX" ]; then
12-
sudo mkdir -p /usr/local/lib
13-
sudo chmod 777 /usr/local/lib
14-
touch /usr/local/lib/.dir_exists
15-
sudo mkdir -p /usr/local/include
16-
sudo chmod 777 /usr/local/include
17-
touch /usr/local/include/.dir_exists
12+
if [ ! -e /usr/local/lib ]; then
13+
sudo mkdir -p /usr/local/lib
14+
sudo chmod 777 /usr/local/lib
15+
touch /usr/local/lib/.dir_exists
16+
fi
17+
if [ ! -e /usr/local/include ]; then
18+
sudo mkdir -p /usr/local/include
19+
sudo chmod 777 /usr/local/include
20+
touch /usr/local/include/.dir_exists
21+
fi
1822
source ${ROOT_DIR}/multibuild/osx_utils.sh
1923
get_macpython_environment ${MB_PYTHON_VERSION} venv
2024
# Since install_fortran uses `uname -a` to determine arch,
@@ -179,6 +183,7 @@ function do_build_lib {
179183
CFLAGS="$CFLAGS -ftrapping-math -mmacos-version-min=11.0"
180184
MACOSX_DEPLOYMENT_TARGET="11.0"
181185
export SDKROOT=${SDKROOT:-$(xcrun --show-sdk-path)}
186+
export DYLD_LIBRARY_PATH=/usr/local/lib:$DYLD_LIBRARY_PATH
182187
;;
183188
*-s390x)
184189
local bitness=64

tools/build_wheel.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,15 @@ if [ "${PLAT}" == "arm64" ]; then
101101
exit 0
102102
fi
103103
# Test that the wheel works with a different python
104+
PYTHON=python3.11
105+
if [ $(uname) == "Darwin" ] -a [ "${PLAT}" == "x86_64" ]; then
106+
which python3.11
107+
PYTHON="arch -x86_64 python3.11"
108+
fi
104109
if [ "${INTERFACE64}" != "1" ]; then
105-
python3.11 -m pip install --no-index --find-links dist scipy_openblas32
106-
python3.11 -m scipy_openblas32
110+
$PYTHON -m pip install --no-index --find-links dist scipy_openblas32
111+
$PYTHON -m scipy_openblas32
107112
else
108-
python3.11 -m pip install --no-index --find-links dist scipy_openblas64
109-
python3.11 -m scipy_openblas64
113+
$PYTHON -m pip install --no-index --find-links dist scipy_openblas64
114+
$PYTHON -m scipy_openblas64
110115
fi

tools/local_build.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
set -e
55

66
# Set extra env
7-
if [[ $(uname -m) == "x86_64" ]]; then
7+
if [[ $(uname) == "Darwin" ]]; then
8+
# Force x86_64
9+
export PLAT=x86_64
10+
elif [[ $(uname -m) == "x86_64" ]]; then
811
echo got x86_64
912
export TRAVIS_OS_NAME=ubuntu-latest
1013
export PLAT=x86_64
@@ -64,11 +67,6 @@ function build_openblas {
6467
fi
6568
# Build OpenBLAS
6669
set -xeo pipefail
67-
if [ "$PLAT" == "arm64" ]; then
68-
sudo xcode-select -switch /Applications/Xcode_12.5.1.app
69-
export SDKROOT=/Applications/Xcode_12.5.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk
70-
clang --version
71-
fi
7270
source tools/build_steps.sh
7371
echo "------ BEFORE BUILD ---------"
7472
before_build

0 commit comments

Comments
 (0)