numpy-1.21.2-mkl.patch 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. fix issues in numpy distutils pkg w.r.t. detecting BLAS/LAPACK libraries
  2. by Pierre-Yves Barriat (UCLouvain)
  3. diff -ru numpy-1.21.2.orig/numpy/distutils/fcompiler/__init__.py numpy-1.21.2/numpy/distutils/fcompiler/__init__.py
  4. --- numpy-1.21.2.orig/numpy/distutils/fcompiler/__init__.py 2021-08-11 11:10:44.000000000 +0200
  5. +++ numpy-1.21.2/numpy/distutils/fcompiler/__init__.py 2021-09-14 10:40:01.042550564 +0200
  6. @@ -631,7 +631,10 @@
  7. return options
  8. def library_option(self, lib):
  9. - return "-l" + lib
  10. + if lib[0]=='-':
  11. + return lib
  12. + else:
  13. + return "-l" + lib
  14. def library_dir_option(self, dir):
  15. return "-L" + dir
  16. diff -ru numpy-1.21.2.orig/numpy/distutils/system_info.py numpy-1.21.2/numpy/distutils/system_info.py
  17. --- numpy-1.21.2.orig/numpy/distutils/system_info.py 2021-08-15 09:45:36.000000000 +0200
  18. +++ numpy-1.21.2/numpy/distutils/system_info.py 2021-09-14 10:41:33.968933968 +0200
  19. @@ -944,7 +944,7 @@
  20. if is_string(default):
  21. return [default]
  22. return default
  23. - return [b for b in [a.strip() for a in libs.split(',')] if b]
  24. + return [b for b in [a.strip().replace(':',',') for a in libs.split(',')] if b]
  25. def get_libraries(self, key='libraries'):
  26. if hasattr(self, '_lib_names'):
  27. @@ -1030,7 +1030,10 @@
  28. def _find_libs(self, lib_dirs, libs, exts):
  29. # make sure we preserve the order of libs, as it can be important
  30. found_dirs, found_libs = [], []
  31. - for lib in libs:
  32. + for lib in libs:
  33. + if lib[0] == '-':
  34. + found_libs.append(lib)
  35. + continue
  36. for lib_dir in lib_dirs:
  37. found_lib = self._find_lib(lib_dir, lib, exts)
  38. if found_lib:
  39. diff -ru numpy-1.21.2.orig/numpy/distutils/unixccompiler.py numpy-1.21.2/numpy/distutils/unixccompiler.py
  40. --- numpy-1.21.2.orig/numpy/distutils/unixccompiler.py 2021-08-11 11:10:44.000000000 +0200
  41. +++ numpy-1.21.2/numpy/distutils/unixccompiler.py 2021-09-14 10:42:24.388056822 +0200
  42. @@ -138,3 +138,13 @@
  43. replace_method(UnixCCompiler, 'create_static_lib',
  44. UnixCCompiler_create_static_lib)
  45. +
  46. +def UnixCCompiler_library_option(self, lib):
  47. + if lib[0]=='-':
  48. + return lib
  49. + else:
  50. + return "-l" + lib
  51. +
  52. +replace_method(UnixCCompiler, 'library_option',
  53. + UnixCCompiler_library_option)
  54. +