Thanks to visit codestin.com
Credit goes to github.com

Skip to content

MAINT: Backport openblas_support from master. #17652

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 1 commit into from
Oct 27, 2020
Merged
Show file tree
Hide file tree
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
25 changes: 16 additions & 9 deletions azure-steps-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@ steps:
versionSpec: $(PYTHON_VERSION)
addToPath: true
architecture: $(PYTHON_ARCH)
- script: python -m pip install --upgrade pip

- script: python -m pip install --upgrade pip wheel
displayName: 'Install tools'

- script: python -m pip install -r test_requirements.txt
displayName: 'Install dependencies; some are optional to avoid test skips'

- powershell: |
$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
$target = $(python tools/openblas_support.py)
mkdir openblas
echo Copying $target to openblas/openblas$env:OPENBLAS_SUFFIX.a
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"
Expand All @@ -27,36 +29,41 @@ steps:
displayName: 'Download / Install OpenBLAS'

- powershell: |
choco install -y mingw --forcex86 --force --version=5.3.0
choco install -y mingw --forcex86 --force --version=7.3.0
refreshenv
displayName: 'Install 32-bit mingw for 32-bit builds'
condition: eq(variables['BITS'], 32)
# NOTE: for Windows builds it seems much more tractable to use runtests.py
# vs. manual setup.py and then runtests.py for testing only

- powershell: |
If ($(BITS) -eq 32) {
$env:CFLAGS = "-m32"
$env:LDFLAGS = "-m32"
$env:PATH = "C:\\tools\\mingw32\\bin;" + $env:PATH
refreshenv
$env:PATH = "C:\\ProgramData\\chocolatey\\lib\\mingw\\tools\\install\\mingw$(BITS)\\bin;" + $env:PATH
}
python -c "from tools import openblas_support; openblas_support.make_init('numpy')"
pip wheel -v -v -v --no-build-isolation --no-use-pep517 --wheel-dir=dist .
python -m pip wheel -v -v -v --no-build-isolation --no-use-pep517 --wheel-dir=dist .

ls dist -r | Foreach-Object {
pip install $_.FullName
python -m 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 :all: --no-deps numpy==1.14
python -m pip download -d destination --only-binary :all: --no-deps numpy==1.14
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'
condition: eq(variables['PYTHON_VERSION'], '3.6')
- script: pushd . && cd .. && python -c "from ctypes import windll; windll.kernel32.SetDefaultDllDirectories(0x00000800); import numpy" && popd
displayName: 'For gh-12667; Windows DLL resolution'
condition: eq(variables['PYTHON_VERSION'], '3.6')

- script: python runtests.py -n --show-build-log --mode=$(TEST_MODE) -- -rsx --junitxml=junit/test-results.xml
displayName: 'Run NumPy Test Suite'

- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
Expand Down
Loading