__config__.py 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. # This file is generated by numpy's build process
  2. # It contains system_info results at the time of building this package.
  3. from enum import Enum
  4. from numpy.core._multiarray_umath import (
  5. __cpu_features__,
  6. __cpu_baseline__,
  7. __cpu_dispatch__,
  8. )
  9. __all__ = ["show"]
  10. _built_with_meson = True
  11. class DisplayModes(Enum):
  12. stdout = "stdout"
  13. dicts = "dicts"
  14. def _cleanup(d):
  15. """
  16. Removes empty values in a `dict` recursively
  17. This ensures we remove values that Meson could not provide to CONFIG
  18. """
  19. if isinstance(d, dict):
  20. return {k: _cleanup(v) for k, v in d.items() if v and _cleanup(v)}
  21. else:
  22. return d
  23. CONFIG = _cleanup(
  24. {
  25. "Compilers": {
  26. "c": {
  27. "name": "msvc",
  28. "linker": "link",
  29. "version": "19.29.30152",
  30. "commands": "cl",
  31. },
  32. "cython": {
  33. "name": "cython",
  34. "linker": "cython",
  35. "version": "3.0.5",
  36. "commands": "cython",
  37. },
  38. "c++": {
  39. "name": "msvc",
  40. "linker": "link",
  41. "version": "19.29.30152",
  42. "commands": "cl",
  43. },
  44. },
  45. "Machine Information": {
  46. "host": {
  47. "cpu": "x86_64",
  48. "family": "x86_64",
  49. "endian": "little",
  50. "system": "windows",
  51. },
  52. "build": {
  53. "cpu": "x86_64",
  54. "family": "x86_64",
  55. "endian": "little",
  56. "system": "windows",
  57. },
  58. "cross-compiled": bool("False".lower().replace("false", "")),
  59. },
  60. "Build Dependencies": {
  61. "blas": {
  62. "name": "openblas64",
  63. "found": bool("True".lower().replace("false", "")),
  64. "version": "0.3.23.dev",
  65. "detection method": "pkgconfig",
  66. "include directory": r"/c/opt/64/include",
  67. "lib directory": r"/c/opt/64/lib",
  68. "openblas configuration": "USE_64BITINT=1 DYNAMIC_ARCH=1 DYNAMIC_OLDER= NO_CBLAS= NO_LAPACK= NO_LAPACKE= NO_AFFINITY=1 USE_OPENMP= SKYLAKEX MAX_THREADS=2",
  69. "pc file directory": r"C:/opt/64/lib/pkgconfig",
  70. },
  71. "lapack": {
  72. "name": "dep2952636600240",
  73. "found": bool("True".lower().replace("false", "")),
  74. "version": "1.26.2",
  75. "detection method": "internal",
  76. "include directory": r"unknown",
  77. "lib directory": r"unknown",
  78. "openblas configuration": "unknown",
  79. "pc file directory": r"unknown",
  80. },
  81. },
  82. "Python Information": {
  83. "path": r"C:\Users\runneradmin\AppData\Local\Temp\cibw-run-s5ovp148\cp312-win_amd64\build\venv\Scripts\python.exe",
  84. "version": "3.12",
  85. },
  86. "SIMD Extensions": {
  87. "baseline": __cpu_baseline__,
  88. "found": [
  89. feature for feature in __cpu_dispatch__ if __cpu_features__[feature]
  90. ],
  91. "not found": [
  92. feature for feature in __cpu_dispatch__ if not __cpu_features__[feature]
  93. ],
  94. },
  95. }
  96. )
  97. def _check_pyyaml():
  98. import yaml
  99. return yaml
  100. def show(mode=DisplayModes.stdout.value):
  101. """
  102. Show libraries and system information on which NumPy was built
  103. and is being used
  104. Parameters
  105. ----------
  106. mode : {`'stdout'`, `'dicts'`}, optional.
  107. Indicates how to display the config information.
  108. `'stdout'` prints to console, `'dicts'` returns a dictionary
  109. of the configuration.
  110. Returns
  111. -------
  112. out : {`dict`, `None`}
  113. If mode is `'dicts'`, a dict is returned, else None
  114. See Also
  115. --------
  116. get_include : Returns the directory containing NumPy C
  117. header files.
  118. Notes
  119. -----
  120. 1. The `'stdout'` mode will give more readable
  121. output if ``pyyaml`` is installed
  122. """
  123. if mode == DisplayModes.stdout.value:
  124. try: # Non-standard library, check import
  125. yaml = _check_pyyaml()
  126. print(yaml.dump(CONFIG))
  127. except ModuleNotFoundError:
  128. import warnings
  129. import json
  130. warnings.warn("Install `pyyaml` for better output", stacklevel=1)
  131. print(json.dumps(CONFIG, indent=2))
  132. elif mode == DisplayModes.dicts.value:
  133. return CONFIG
  134. else:
  135. raise AttributeError(
  136. f"Invalid `mode`, use one of: {', '.join([e.value for e in DisplayModes])}"
  137. )