Skip to content

Commit c45adaf

Browse files
committed
fix dll copying on Windows
1 parent 7409521 commit c45adaf

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

tools/wheels/cibw_before_build.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,17 @@ 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+
46+
# Copy scipy-openblas DLL's to a fixed location so we can point delvewheel
47+
# at it in `repair_windows.sh` (needed only on Windows because of the lack
48+
# of RPATH support).
49+
if [[ $RUNNER_OS == "Windows" ]]; then
50+
python <<EOF
51+
import os, scipy_${OPENBLAS}, shutil
52+
srcdir = os.path.join(os.path.dirname(scipy_${OPENBLAS}.__file__), "lib")
53+
shutil.copytree(srcdir, os.path.join("$PKG_CONFIG_PATH", "lib"))
54+
EOF
55+
fi
4556
fi
4657

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

tools/wheels/repair_windows.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ DEST_DIR="$2"
66
cwd=$PWD
77
cd $DEST_DIR
88

9-
# the libopenblas.dll is placed into this directory in the cibw_before_build
10-
# script.
9+
# The libopenblas_scipy DLL and the other DLLs it may need are placed into this
10+
# directory in `cibw_before_build.sh`.
1111
delvewheel repair --add-path $cwd/.openblas/lib -w $DEST_DIR $WHEEL

0 commit comments

Comments
 (0)