summaryrefslogtreecommitdiff
path: root/numpy/distutils/__init__.py
blob: 0450334ffd4b27337f90d5c9918ae2ad63c78a9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from __future__ import division, absolute_import, print_function

import sys

from .__version__ import version as __version__
# Must import local ccompiler ASAP in order to get
# customized CCompiler.spawn effective.
from . import ccompiler
from . import unixccompiler

from .info import __doc__
from .npy_pkg_config import *

# If numpy is installed, add distutils.test()
try:
    from . import __config__
    # Normally numpy is installed if the above import works, but an interrupted
    # in-place build could also have left a __config__.py.  In that case the
    # next import may still fail, so keep it inside the try block.
    from numpy.testing.nosetester import _numpy_tester
    test = _numpy_tester().test
except ImportError:
    pass


def customized_fcompiler(plat=None, compiler=None):
    from numpy.distutils.fcompiler import new_fcompiler
    c = new_fcompiler(plat=plat, compiler=compiler)
    c.customize() 
    return c

def customized_ccompiler(plat=None, compiler=None):
    c = ccompiler.new_compiler(plat=plat, compiler=compiler)
    c.customize('')
    return c