Skip to content

Commit 5b62e95

Browse files
committed
MAINT: Ignore 16 bit avx512 for old versions of binutils.
Update numpy/core/setup.py to avoid the use of instructions that are unrecognized in binutils < 2.38. This should fix CI failures on gcc-7.
1 parent 55a343a commit 5b62e95

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

numpy/core/setup.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ def can_link_svml():
7979
and "linux" in platform
8080
and sys.maxsize > 2**31)
8181

82+
def can_link_svml_fp16():
83+
"""SVML FP16 requires binutils >= 2.38 for an updated assembler
84+
"""
85+
if can_link_svml():
86+
binutils_ver = os.popen("ld -v").readlines()[0].strip()[-4:]
87+
return float(binutils_ver) >= 2.38
88+
8289
def check_git_submodules():
8390
out = os.popen("git submodule status")
8491
modules = out.readlines()
@@ -1009,6 +1016,8 @@ def generate_umath_doc_header(ext, build_dir):
10091016
# The ordering of names returned by glob is undefined, so we sort
10101017
# to make builds reproducible.
10111018
svml_objs.sort()
1019+
if not can_link_svml_fp16():
1020+
svml_objs = [o for o in svml_objs if not o.endswith('_h_la.s')]
10121021

10131022
config.add_extension('_multiarray_umath',
10141023
sources=multiarray_src + umath_src +

0 commit comments

Comments
 (0)