svn commit: r524711 - head/math/py-numpy/files
Steve Wills
swills at FreeBSD.org
Fri Jan 31 14:08:51 UTC 2020
Author: swills
Date: Fri Jan 31 14:08:51 2020
New Revision: 524711
URL: https://svnweb.freebsd.org/changeset/ports/524711
Log:
math/py-numpy: improve patch to fix build with OpenBlas
This patch adds openblas to the list of cblas compatible libs instead
PR: 243497
Submitted by: John Hein <jcfyecrayz at liamekaens.com>
Modified:
head/math/py-numpy/files/patch-numpy-distutils-system_info.py (contents, props changed)
Modified: head/math/py-numpy/files/patch-numpy-distutils-system_info.py
==============================================================================
--- head/math/py-numpy/files/patch-numpy-distutils-system_info.py Fri Jan 31 14:04:23 2020 (r524710)
+++ head/math/py-numpy/files/patch-numpy-distutils-system_info.py Fri Jan 31 14:08:51 2020 (r524711)
@@ -1,4 +1,4 @@
---- numpy/distutils/system_info.py.orig 2019-08-27 19:01:36 UTC
+--- numpy/distutils/system_info.py.orig 2019-08-27 21:01:36 UTC
+++ numpy/distutils/system_info.py
@@ -172,6 +172,8 @@ def _c_string_literal(s):
Convert a python string into a literal suitable for inclusion into C code
@@ -32,12 +32,33 @@
atlas_info = get_info('atlas_3_10_blas_threads')
if not atlas_info:
atlas_info = get_info('atlas_3_10_blas')
-@@ -1742,7 +1739,7 @@ class blas_info(system_info):
- library_dirs=info['library_dirs'],
- extra_postargs=info.get('extra_link_args', []))
- res = "blas"
-- except distutils.ccompiler.CompileError:
-+ except (distutils.ccompiler.CompileError, distutils.ccompiler.LinkError):
+@@ -1730,18 +1727,17 @@ class blas_info(system_info):
+ # check we can link (find library)
+ # some systems have separate cblas and blas libs. First
+ # check for cblas lib, and if not present check for blas lib.
+- try:
+- c.link_executable(obj, os.path.join(tmpdir, "a.out"),
+- libraries=["cblas"],
+- library_dirs=info['library_dirs'],
+- extra_postargs=info.get('extra_link_args', []))
+- res = "cblas"
+- except distutils.ccompiler.LinkError:
+- c.link_executable(obj, os.path.join(tmpdir, "a.out"),
+- libraries=["blas"],
+- library_dirs=info['library_dirs'],
+- extra_postargs=info.get('extra_link_args', []))
+- res = "blas"
++ res = None
++ for libname in ['cblas', 'blas', 'openblas']:
++ try:
++ c.link_executable(obj, os.path.join(tmpdir, "a.out"),
++ libraries=[libname],
++ library_dirs=info['library_dirs'],
++ extra_postargs=info.get('extra_link_args', []))
++ res = libname
++ break
++ except distutils.ccompiler.LinkError:
++ pass
+ except distutils.ccompiler.CompileError:
res = None
finally:
- shutil.rmtree(tmpdir)
More information about the svn-ports-all
mailing list