__init__.py 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. from __future__ import division, absolute_import, print_function
  17. # Must import local ccompiler ASAP in order to get
  18. # customized CCompiler.spawn effective.
  19. from . import ccompiler
  20. from . import unixccompiler
  21. from .npy_pkg_config import *
  22. # If numpy is installed, add distutils.test()
  23. try:
  24. from . import __config__
  25. # Normally numpy is installed if the above import works, but an interrupted
  26. # in-place build could also have left a __config__.py. In that case the
  27. # next import may still fail, so keep it inside the try block.
  28. from numpy._pytesttester import PytestTester
  29. test = PytestTester(__name__)
  30. del PytestTester
  31. except ImportError:
  32. pass
  33. def customized_fcompiler(plat=None, compiler=None):
  34. from numpy.distutils.fcompiler import new_fcompiler
  35. c = new_fcompiler(plat=plat, compiler=compiler)
  36. c.customize()
  37. return c
  38. def customized_ccompiler(plat=None, compiler=None, verbose=1):
  39. c = ccompiler.new_compiler(plat=plat, compiler=compiler, verbose=verbose)
  40. c.customize('')
  41. return c