8000 BLD: put openblas library in local directory on windows by mattip · Pull Request #16101 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

BLD: put openblas library in local directory on windows #16101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions azure-steps-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,21 @@ steps:
- script: python -m pip install -r test_requirements.txt
displayName: 'Install dependencies; some are optional to avoid test skips'
- powershell: |
$pyversion = python -c "import sys; print(sys.version.split()[0])"
Write-Host "Python Version: $pyversion"
$targe 8000 t = "C:\\hostedtoolcache\\windows\\Python\\$pyversion\\$(PYTHON_ARCH)\\lib\\openblas$env:OPENBLAS_SUFFIX.a"
Write-Host "target path: $target"
python -mpip install urllib3
$openblas = python tools/openblas_support.py
cp $openblas $target
$ErrorActionPreference = "Stop"
# Download and get the path to "openblas.a". We cannot copy it
# to $PYTHON_EXE's directory since that is on a different drive which
# mingw does not like. Instead copy it to a directory and set OPENBLAS,
# since OPENBLAS will be picked up by the openblas discovery
python -m pip install urllib3
$target = $(python tools/openblas_support.py)
mkdir openblas
echo Copying $target to openblas/openblas$env:OPENBLAS_SUFFIX.a
cp $target openblas/openblas$env:OPENBLAS_SUFFIX.a
If ( Test-Path env:NPY_USE_BLAS_ILP64 ){
echo "##vso[task.setvariable variable=OPENBLAS64_]$pwd\openblas"
} else {
echo "##vso[task.setvariable variable=OPENBLAS]$pwd\openblas"
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The need to add OPENBLAS_SUFFIX (line 20, 21) seems to me to be a bug in the packaging of the openblas-lib. It knows about 64bit builds, and should package the library appropriately.

displayName: 'Download / Install OpenBLAS'

- powershell: |
Expand All @@ -32,15 +40,15 @@ steps:
refreshenv
}
python -c "from tools import openblas_support; openblas_support.make_init('numpy')"
pip wheel -v -v -v --wheel-dir=dist .
pip wheel -v -v -v --no-build-isolation --no-use-pep517 --wheel-dir=dist .
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While not really part of the openblas handling, this will disable all the fancy "copy to tmp directory, exec(setup.py)" things that pip now does when calling pip wheel. The former slows things down, the latter breaks our setup.py (it cannot find parse_setuppy_commands)


ls dist -r | Foreach-Object {
pip install $_.FullName
}
displayName: 'Build NumPy'
- bash: |
pushd . && cd .. && target=$(python -c "import numpy, os; print(os.path.abspath(os.path.join(os.path.dirname(numpy.__file__), '.libs')))") && popd
pip download -d destination --only-binary --no-deps numpy==1.14
pip download -d destination --only-binary :all: --no-deps numpy==1.14
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was broken

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, why download numpy==1.14?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I recall correctly, this was added to test that numpy will still load properly even if there are two fortran dlls in the .lib directory on windows. The real test is in the next step

cd destination && unzip numpy*.whl && cp numpy/.libs/*.dll $target
ls $target
displayName: 'Add extraneous & older DLL to numpy/.libs to probe DLL handling robustness'
Expand Down
0