__init__.py 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. """
  2. An enhanced distutils, providing support for Fortran compilers, for BLAS,
  3. LAPACK and other common libraries for numerical computing, and more.
  4. Public submodules are::
  5. misc_util
  6. system_info
  7. cpu_info
  8. log
  9. exec_command
  10. For details, please see the *Packaging* and *NumPy Distutils User Guide*
  11. sections of the NumPy Reference Guide.
  12. For configuring the preference for and location of libraries like BLAS and
  13. LAPACK, and for setting include paths and similar build options, please see
  14. ``site.cfg.example`` in the root of the NumPy repository or sdist.
  15. """
  16. # Must import local ccompiler ASAP in order to get
  17. # customized CCompiler.spawn effective.
  18. from . import ccompiler
  19. from . import unixccompiler
  20. from .npy_pkg_config import *
  21. # If numpy is installed, add distutils.test()
  22. try:
  23. from . import __config__
  24. # Normally numpy is installed if the above import works, but an interrupted
  25. # in-place build could also have left a __config__.py. In that case the
  26. # next import may still fail, so keep it inside the try block.
  27. from numpy._pytesttester import PytestTester
  28. test = PytestTester(__name__)
  29. del PytestTester
  30. except ImportError:
  31. pass
  32. def customized_fcompiler(plat=None, compiler=None):
  33. from numpy.distutils.fcompiler import new_fcompiler
  34. c = new_fcompiler(plat=plat, compiler=compiler)
  35. c.customize()
  36. return c
  37. def customized_ccompiler(plat=None, compiler=None, verbose=1):
  38. c = ccompiler.new_compiler(plat=plat, compiler=compiler, verbose=verbose)
  39. c.customize('')
  40. return c