123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- fix issues in numpy distutils pkg w.r.t. detecting BLAS/LAPACK libraries
- by Pierre-Yves Barriat (UCLouvain)
- Remade against numpy-1.20.3
- diff -ru numpy-1.20.3.orig/numpy/distutils/fcompiler/__init__.py numpy-1.20.3/numpy/distutils/fcompiler/__init__.py
- --- numpy-1.20.3.orig/numpy/distutils/fcompiler/__init__.py 2021-05-09 12:38:00.000000000 +0200
- +++ numpy-1.20.3/numpy/distutils/fcompiler/__init__.py 2021-08-06 12:57:51.306766559 +0200
- @@ -631,7 +631,10 @@
- return options
-
- def library_option(self, lib):
- - return "-l" + lib
- + if lib[0]=='-':
- + return lib
- + else:
- + return "-l" + lib
- def library_dir_option(self, dir):
- return "-L" + dir
-
- diff -ru numpy-1.20.3.orig/numpy/distutils/system_info.py numpy-1.20.3/numpy/distutils/system_info.py
- --- numpy-1.20.3.orig/numpy/distutils/system_info.py 2021-05-09 12:38:00.000000000 +0200
- +++ numpy-1.20.3/numpy/distutils/system_info.py 2021-08-06 13:00:54.466820115 +0200
- @@ -947,7 +947,7 @@
- if is_string(default):
- return [default]
- return default
- - return [b for b in [a.strip() for a in libs.split(',')] if b]
- + return [b for b in [a.strip().replace(':',',') for a in libs.split(',')] if b]
-
- def get_libraries(self, key='libraries'):
- if hasattr(self, '_lib_names'):
- @@ -1037,6 +1037,9 @@
- # make sure we preserve the order of libs, as it can be important
- found_dirs, found_libs = [], []
- for lib in libs:
- + if lib[0] == '-':
- + found_libs.append(lib)
- + continue
- for lib_dir in lib_dirs:
- found_lib = self._find_lib(lib_dir, lib, exts)
- if found_lib:
- diff -ru numpy-1.20.3.orig/numpy/distutils/unixccompiler.py numpy-1.20.3/numpy/distutils/unixccompiler.py
- --- numpy-1.20.3.orig/numpy/distutils/unixccompiler.py 2021-05-09 12:38:00.000000000 +0200
- +++ numpy-1.20.3/numpy/distutils/unixccompiler.py 2021-08-06 13:02:27.719484364 +0200
- @@ -138,3 +138,12 @@
-
- replace_method(UnixCCompiler, 'create_static_lib',
- UnixCCompiler_create_static_lib)
- +
- +def UnixCCompiler_library_option(self, lib):
- + if lib[0]=='-':
- + return lib
- + else:
- + return "-l" + lib
- +
- +replace_method(UnixCCompiler, 'library_option',
- + UnixCCompiler_library_option)
|