1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- fix issues in numpy distutils pkg w.r.t. detecting BLAS/LAPACK libraries
- by Pierre-Yves Barriat (UCLouvain)
- diff -ru numpy-1.21.2.orig/numpy/distutils/fcompiler/__init__.py numpy-1.21.2/numpy/distutils/fcompiler/__init__.py
- --- numpy-1.21.2.orig/numpy/distutils/fcompiler/__init__.py 2021-08-11 11:10:44.000000000 +0200
- +++ numpy-1.21.2/numpy/distutils/fcompiler/__init__.py 2021-09-14 10:40:01.042550564 +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.21.2.orig/numpy/distutils/system_info.py numpy-1.21.2/numpy/distutils/system_info.py
- --- numpy-1.21.2.orig/numpy/distutils/system_info.py 2021-08-15 09:45:36.000000000 +0200
- +++ numpy-1.21.2/numpy/distutils/system_info.py 2021-09-14 10:41:33.968933968 +0200
- @@ -944,7 +944,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'):
- @@ -1030,7 +1030,10 @@
- def _find_libs(self, lib_dirs, libs, exts):
- # make sure we preserve the order of libs, as it can be important
- found_dirs, found_libs = [], []
- - for lib in 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.21.2.orig/numpy/distutils/unixccompiler.py numpy-1.21.2/numpy/distutils/unixccompiler.py
- --- numpy-1.21.2.orig/numpy/distutils/unixccompiler.py 2021-08-11 11:10:44.000000000 +0200
- +++ numpy-1.21.2/numpy/distutils/unixccompiler.py 2021-09-14 10:42:24.388056822 +0200
- @@ -138,3 +138,13 @@
-
- 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)
- +
|