Skip to content

Commit 2be06b8

Browse files
committed
hack numpy.distutils to use the openblas wheel not the openblas lib
1 parent db7414b commit 2be06b8

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

numpy/core/setup.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
from numpy.compat import npy_load_module
1616
from setup_common import * # noqa: F403
1717

18+
try:
19+
import openblas
20+
importable_openblas = True
21+
except ModuleNotFoundError:
22+
importable_openblas = False
23+
1824
# Set to True to enable relaxed strides checking. This (mostly) means
1925
# that `strides[dim]` is ignored if `shape[dim] == 1` when setting flags.
2026
NPY_RELAXED_STRIDES_CHECKING = (os.environ.get('NPY_RELAXED_STRIDES_CHECKING', "1") != "0")
@@ -849,6 +855,10 @@ def get_mathlib_info(*args):
849855
])
850856
else:
851857
extra_info = {}
858+
if importable_openblas:
859+
# TODO: use a better API for importable openblas
860+
extra_info.pop('libraries', None)
861+
extra_info.pop('runtime_library_dirs', None)
852862

853863
#######################################################################
854864
# _multiarray_umath module - multiarray part #

numpy/distutils/ccompiler_opt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2361,7 +2361,7 @@ def generate_dispatch_header(self, header_path):
23612361
if not os.path.exists(header_dir):
23622362
self.dist_log(
23632363
f"dispatch header dir {header_dir} does not exist, creating it",
2364-
stderr=True
2364+
stderr=False
23652365
)
23662366
os.makedirs(header_dir)
23672367

0 commit comments

Comments
 (0)