numpy-1.20.3-mkl.patch 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. fix issues in numpy distutils pkg w.r.t. detecting BLAS/LAPACK libraries
  2. by Pierre-Yves Barriat (UCLouvain)
  3. Remade against numpy-1.20.3
  4. diff -ru numpy-1.20.3.orig/numpy/distutils/fcompiler/__init__.py numpy-1.20.3/numpy/distutils/fcompiler/__init__.py
  5. --- numpy-1.20.3.orig/numpy/distutils/fcompiler/__init__.py 2021-05-09 12:38:00.000000000 +0200
  6. +++ numpy-1.20.3/numpy/distutils/fcompiler/__init__.py 2021-08-06 12:57:51.306766559 +0200
  7. @@ -631,7 +631,10 @@
  8. return options
  9. def library_option(self, lib):
  10. - return "-l" + lib
  11. + if lib[0]=='-':
  12. + return lib
  13. + else:
  14. + return "-l" + lib
  15. def library_dir_option(self, dir):
  16. return "-L" + dir
  17. diff -ru numpy-1.20.3.orig/numpy/distutils/system_info.py numpy-1.20.3/numpy/distutils/system_info.py
  18. --- numpy-1.20.3.orig/numpy/distutils/system_info.py 2021-05-09 12:38:00.000000000 +0200
  19. +++ numpy-1.20.3/numpy/distutils/system_info.py 2021-08-06 13:00:54.466820115 +0200
  20. @@ -947,7 +947,7 @@
  21. if is_string(default):
  22. return [default]
  23. return default
  24. - return [b for b in [a.strip() for a in libs.split(',')] if b]
  25. + return [b for b in [a.strip().replace(':',',') for a in libs.split(',')] if b]
  26. def get_libraries(self, key='libraries'):
  27. if hasattr(self, '_lib_names'):
  28. @@ -1037,6 +1037,9 @@
  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. + if lib[0] == '-':
  33. + found_libs.append(lib)
  34. + continue
  35. for lib_dir in lib_dirs:
  36. found_lib = self._find_lib(lib_dir, lib, exts)
  37. if found_lib:
  38. diff -ru numpy-1.20.3.orig/numpy/distutils/unixccompiler.py numpy-1.20.3/numpy/distutils/unixccompiler.py
  39. --- numpy-1.20.3.orig/numpy/distutils/unixccompiler.py 2021-05-09 12:38:00.000000000 +0200
  40. +++ numpy-1.20.3/numpy/distutils/unixccompiler.py 2021-08-06 13:02:27.719484364 +0200
  41. @@ -138,3 +138,12 @@
  42. replace_method(UnixCCompiler, 'create_static_lib',
  43. UnixCCompiler_create_static_lib)
  44. +
  45. +def UnixCCompiler_library_option(self, lib):
  46. + if lib[0]=='-':
  47. + return lib
  48. + else:
  49. + return "-l" + lib
  50. +
  51. +replace_method(UnixCCompiler, 'library_option',
  52. + UnixCCompiler_library_option)