View | Details | Raw Unified | Return to bug 243497 | Differences between
and this patch

Collapse All | Expand All

(-)files/patch-numpy-distutils-system_info.py (-8 / +29 lines)
Lines 1-4 Link Here
1
--- numpy/distutils/system_info.py.orig	2019-08-27 19:01:36 UTC
1
--- numpy/distutils/system_info.py.orig	2019-08-27 21:01:36 UTC
2
+++ numpy/distutils/system_info.py
2
+++ numpy/distutils/system_info.py
3
@@ -172,6 +172,8 @@ def _c_string_literal(s):
3
@@ -172,6 +172,8 @@ def _c_string_literal(s):
4
     Convert a python string into a literal suitable for inclusion into C code
4
     Convert a python string into a literal suitable for inclusion into C code
Lines 32-43 Link Here
32
         atlas_info = get_info('atlas_3_10_blas_threads')
32
         atlas_info = get_info('atlas_3_10_blas_threads')
33
         if not atlas_info:
33
         if not atlas_info:
34
             atlas_info = get_info('atlas_3_10_blas')
34
             atlas_info = get_info('atlas_3_10_blas')
35
@@ -1742,7 +1739,7 @@ class blas_info(system_info):
35
@@ -1730,18 +1727,17 @@ class blas_info(system_info):
36
                                       library_dirs=info['library_dirs'],
36
                 # check we can link (find library)
37
                                       extra_postargs=info.get('extra_link_args', []))
37
                 # some systems have separate cblas and blas libs. First
38
                     res = "blas"
38
                 # check for cblas lib, and if not present check for blas lib.
39
-            except distutils.ccompiler.CompileError:
39
-                try:
40
+            except (distutils.ccompiler.CompileError, distutils.ccompiler.LinkError):
40
-                    c.link_executable(obj, os.path.join(tmpdir, "a.out"),
41
-                                      libraries=["cblas"],
42
-                                      library_dirs=info['library_dirs'],
43
-                                      extra_postargs=info.get('extra_link_args', []))
44
-                    res = "cblas"
45
-                except distutils.ccompiler.LinkError:
46
-                    c.link_executable(obj, os.path.join(tmpdir, "a.out"),
47
-                                      libraries=["blas"],
48
-                                      library_dirs=info['library_dirs'],
49
-                                      extra_postargs=info.get('extra_link_args', []))
50
-                    res = "blas"
51
+                res = None
52
+                for libname in ['cblas', 'blas', 'openblas']:
53
+                    try:
54
+                        c.link_executable(obj, os.path.join(tmpdir, "a.out"),
55
+                                          libraries=[libname],
56
+                                          library_dirs=info['library_dirs'],
57
+                                          extra_postargs=info.get('extra_link_args', []))
58
+                        res = libname
59
+                        break
60
+                    except distutils.ccompiler.LinkError:
61
+                        pass
62
             except distutils.ccompiler.CompileError:
41
                 res = None
63
                 res = None
42
         finally:
64
         finally:
43
             shutil.rmtree(tmpdir)

Return to bug 243497