Skip to content

Commit

Permalink
BUILD: use openblas_support.py from numpy-wheels to create _distribut…
Browse files Browse the repository at this point in the history
…or_init.py
  • Loading branch information
mattip committed Jun 16, 2019
1 parent 90ee555 commit 9fe7fec
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 27 deletions.
15 changes: 11 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ jobs:
architecture: $(PYTHON_ARCH)
- script: python -m pip install --upgrade pip setuptools wheel
displayName: 'Install tools'
- script: python -m pip install cython nose pytz pytest
displayName: 'Install dependencies; some are optional to avoid test skips'
- script: if [%INSTALL_PICKLE5%]==[1] python -m pip install pickle5
displayName: 'Install optional pickle5 backport (only for python3.6 and 3.7)'
- powershell: |
$wc = New-Object net.webclient
$wc.Downloadfile("$(OPENBLAS)", "openblas.zip")
Expand All @@ -187,12 +191,15 @@ jobs:
choco install -y mingw --forcex86 --force --version=5.3.0
displayName: 'Install 32-bit mingw for 32-bit builds'
condition: eq(variables['BITS'], 32)
- script: python -m pip install cython nose pytz pytest
displayName: 'Install dependencies; some are optional to avoid test skips'
- powershell: |
$wc = New-Object net.webclient
$gh_base = "https://raw.githubusercontent.com/MacPython/numpy-wheels/master/"
$wc.Downloadfile($gh_base + "openblas_support.py", "$pwd\openblas_support.py")
python -c "import openblas_support; openblas_support.make_init('numpy')"
del openblas_support.py
displayName: 'Create _distributor_init.py for OpenBlas'
# NOTE: for Windows builds it seems much more tractable to use runtests.py
# vs. manual setup.py and then runtests.py for testing only
- script: if [%INSTALL_PICKLE5%]==[1] python -m pip install pickle5
displayName: 'Install optional pickle5 backport (only for python3.6 and 3.7)'
- powershell: |
If ($(BITS) -eq 32) {
$env:NPY_DISTUTILS_APPEND_FLAGS = 1
Expand Down
23 changes: 0 additions & 23 deletions numpy/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,6 @@

import os

# on Windows NumPy loads an important OpenBLAS-related DLL
# and the code below aims to alleviate issues with DLL
# path resolution portability with an absolute path DLL load
if os.name == 'nt':
from ctypes import WinDLL
import glob
# convention for storing / loading the DLL from
# numpy/.libs/, if present
libs_path = os.path.abspath(os.path.join(os.path.dirname(__file__),
'..', '.libs'))
DLL_filenames = []
if os.path.isdir(libs_path):
for filename in glob.glob(os.path.join(libs_path, '*openblas*dll')):
# NOTE: would it change behavior to load ALL
# DLLs at this path vs. the name restriction?
WinDLL(os.path.abspath(filename))
DLL_filenames.append(filename)
if len(DLL_filenames) > 1:
import warnings
warnings.warn("loaded more than 1 DLL from .libs:\n%s" %
"\n".join(DLL_filenames),
stacklevel=1)

# disables OpenBLAS affinity setting of the main thread that limits
# python threads or processes to one core
env_added = []
Expand Down

0 comments on commit 9fe7fec

Please sign in to comment.