__config__.py 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. # This file is generated by numpy's setup.py
  2. # It contains system_info results at the time of building this package.
  3. __all__ = ["get_info","show"]
  4. import os
  5. import sys
  6. extra_dll_dir = os.path.join(os.path.dirname(__file__), '.libs')
  7. if sys.platform == 'win32' and os.path.isdir(extra_dll_dir):
  8. if sys.version_info >= (3, 8):
  9. os.add_dll_directory(extra_dll_dir)
  10. else:
  11. os.environ.setdefault('PATH', '')
  12. os.environ['PATH'] += os.pathsep + extra_dll_dir
  13. blas_mkl_info={}
  14. blis_info={}
  15. openblas_info={}
  16. accelerate_info={}
  17. atlas_3_10_blas_threads_info={}
  18. atlas_3_10_blas_info={}
  19. atlas_blas_threads_info={}
  20. atlas_blas_info={}
  21. blas_info={}
  22. blas_src_info={}
  23. blas_opt_info={}
  24. lapack_mkl_info={}
  25. openblas_lapack_info={}
  26. openblas_clapack_info={}
  27. flame_info={}
  28. atlas_3_10_threads_info={}
  29. atlas_3_10_info={}
  30. atlas_threads_info={}
  31. atlas_info={}
  32. lapack_info={}
  33. lapack_src_info={}
  34. lapack_opt_info={}
  35. numpy_linalg_lapack_lite={'language': 'c', 'define_macros': [('HAVE_BLAS_ILP64', None), ('BLAS_SYMBOL_SUFFIX', '64_')]}
  36. def get_info(name):
  37. g = globals()
  38. return g.get(name, g.get(name + "_info", {}))
  39. def show():
  40. """
  41. Show libraries in the system on which NumPy was built.
  42. Print information about various resources (libraries, library
  43. directories, include directories, etc.) in the system on which
  44. NumPy was built.
  45. See Also
  46. --------
  47. get_include : Returns the directory containing NumPy C
  48. header files.
  49. Notes
  50. -----
  51. Classes specifying the information to be printed are defined
  52. in the `numpy.distutils.system_info` module.
  53. Information may include:
  54. * ``language``: language used to write the libraries (mostly
  55. C or f77)
  56. * ``libraries``: names of libraries found in the system
  57. * ``library_dirs``: directories containing the libraries
  58. * ``include_dirs``: directories containing library header files
  59. * ``src_dirs``: directories containing library source files
  60. * ``define_macros``: preprocessor macros used by
  61. ``distutils.setup``
  62. * ``baseline``: minimum CPU features required
  63. * ``found``: dispatched features supported in the system
  64. * ``not found``: dispatched features that are not supported
  65. in the system
  66. Examples
  67. --------
  68. >>> import numpy as np
  69. >>> np.show_config()
  70. blas_opt_info:
  71. language = c
  72. define_macros = [('HAVE_CBLAS', None)]
  73. libraries = ['openblas', 'openblas']
  74. library_dirs = ['/usr/local/lib']
  75. """
  76. from numpy.core._multiarray_umath import (
  77. __cpu_features__, __cpu_baseline__, __cpu_dispatch__
  78. )
  79. for name,info_dict in globals().items():
  80. if name[0] == "_" or type(info_dict) is not type({}): continue
  81. print(name + ":")
  82. if not info_dict:
  83. print(" NOT AVAILABLE")
  84. for k,v in info_dict.items():
  85. v = str(v)
  86. if k == "sources" and len(v) > 200:
  87. v = v[:60] + " ...\n... " + v[-60:]
  88. print(" %s = %s" % (k,v))
  89. features_found, features_not_found = [], []
  90. for feature in __cpu_dispatch__:
  91. if __cpu_features__[feature]:
  92. features_found.append(feature)
  93. else:
  94. features_not_found.append(feature)
  95. print("Supported SIMD extensions in this NumPy install:")
  96. print(" baseline = %s" % (','.join(__cpu_baseline__)))
  97. print(" found = %s" % (','.join(features_found)))
  98. print(" not found = %s" % (','.join(features_not_found)))