Skip to content

Commit 4040b7a

Browse files
committed
MAINT: clean up the messing around with DYLD_LIBRARY_PATH
Also clean up PKG_CONFIG_PATH handling for macOS.
1 parent f4b276d commit 4040b7a

File tree

3 files changed

+5
-32
lines changed

3 files changed

+5
-32
lines changed

.github/workflows/wheels.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,22 +112,16 @@ jobs:
112112
echo "FC=gfortran-13" >> "$GITHUB_ENV"
113113
echo "F77=gfortran-13" >> "$GITHUB_ENV"
114114
echo "F90=gfortran-13" >> "$GITHUB_ENV"
115+
115116
if [[ ${{ matrix.buildplat[2] }} == 'accelerate' ]]; then
116-
# macosx_arm64 and macosx_x86_64 with accelerate
117-
# only target Sonoma onwards
118-
CIBW="MACOSX_DEPLOYMENT_TARGET=14.0 INSTALL_OPENBLAS=false RUNNER_OS=macOS"
119-
echo "CIBW_ENVIRONMENT_MACOS=$CIBW" >> "$GITHUB_ENV"
117+
# Builds with Accelerate only target macOS>=14.0
118+
echo "CIBW_ENVIRONMENT_MACOS=MACOSX_DEPLOYMENT_TARGET=14.0 INSTALL_OPENBLAS=false" >> "$GITHUB_ENV"
120119
121120
# the macos-13 image that's used for building the x86_64 wheel can't test
122121
# a wheel with deployment target >= 14 without further work
123122
echo "CIBW_TEST_SKIP=*-macosx_x86_64" >> "$GITHUB_ENV"
124123
else
125-
# macosx_x86_64 with OpenBLAS
126-
# if INSTALL_OPENBLAS isn't specified then scipy-openblas is automatically installed
127-
CIBW="RUNNER_OS=macOS"
128-
PKG_CONFIG_PATH="$PWD/.openblas"
129-
DYLD="$DYLD_LIBRARY_PATH:/$PWD/.openblas/lib"
130-
echo "CIBW_ENVIRONMENT_MACOS=$CIBW PKG_CONFIG_PATH=$PKG_CONFIG_PATH DYLD_LIBRARY_PATH=$DYLD" >> "$GITHUB_ENV"
124+
echo "CIBW_ENVIRONMENT_MACOS=PKG_CONFIG_PATH=$PWD/.openblas" >> "$GITHUB_ENV"
131125
fi
132126
133127
# Used to run cibuildwheel

cibuildwheel.toml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[tool.cibuildwheel]
22
# Note: the below skip command doesn't do much currently, the platforms to
33
# build wheels for in CI are controlled in `.github/workflows/wheels.yml`.
4+
# universal2 wheels are not supported (see gh-21233), use `delocate-fuse` if you need them
45
skip = ["*_i686", "*_ppc64le", "*_s390x", "*_universal2"]
56
before-build = "bash {project}/tools/wheels/cibw_before_build.sh {project}"
67
before-test = "pip install -r {project}/requirements/wheel_test_requirements.txt"
@@ -24,16 +25,6 @@ musllinux-aarch64-image = "musllinux_1_2"
2425
RUNNER_OS="Linux"
2526
# /project will be the $PWD equivalent inside the Docker container used to build the wheel
2627
PKG_CONFIG_PATH="/project/.openblas"
27-
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/project/.openblas/lib"
28-
29-
[tool.cibuildwheel.macos]
30-
# universal2 wheels are not supported (see gh-21233), use `delocate-fuse` if you need them
31-
# Not clear why the DYLD_LIBRARY_PATH is not passed through from the environment
32-
repair-wheel-command = [
33-
"export DYLD_LIBRARY_PATH=$PWD/.openblas/lib",
34-
"echo DYLD_LIBRARY_PATH $DYLD_LIBRARY_PATH",
35-
"delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}",
36-
]
3728

3829
[tool.cibuildwheel.windows]
3930
config-settings = {setup-args = ["--vsenv", "-Dallow-noblas=false"], build-dir="build"}

tools/wheels/cibw_before_build.sh

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,6 @@ if [[ "$INSTALL_OPENBLAS" = "true" ]] ; then
4242
mkdir -p $PKG_CONFIG_PATH
4343
python -m pip install -r $PROJECT_DIR/requirements/openblas_requirements.txt
4444
python -c "import scipy_${OPENBLAS}; print(scipy_${OPENBLAS}.get_pkg_config())" > $PKG_CONFIG_PATH/scipy-openblas.pc
45-
# Copy the shared objects to a path under $PKG_CONFIG_PATH, the build
46-
# will point $LD_LIBRARY_PATH there and then auditwheel/delocate will
47-
# pull these into the wheel. Use python to avoid windows/posix problems
48-
python <<EOF
49-
import os, scipy_${OPENBLAS}, shutil
50-
srcdir = os.path.join(os.path.dirname(scipy_${OPENBLAS}.__file__), "lib")
51-
shutil.copytree(srcdir, os.path.join("$PKG_CONFIG_PATH", "lib"))
52-
srcdir = os.path.join(os.path.dirname(scipy_${OPENBLAS}.__file__), ".dylibs")
53-
if os.path.exists(srcdir): # macosx delocate
54-
shutil.copytree(srcdir, os.path.join("$PKG_CONFIG_PATH", ".dylibs"))
55-
EOF
56-
# pkg-config scipy-openblas --print-provides
5745
fi
5846

5947
# cibuildwheel doesn't install delvewheel by default (it does install

0 commit comments

Comments
 (0)