MCPcopy Create free account
hub / github.com/numpy/numpy / configuration

Function configuration

numpy/linalg/setup.py:5–87  ·  view source on GitHub ↗
(parent_package='', top_path=None)

Source from the content-addressed store, hash-verified

3import sysconfig
4
5def configuration(parent_package='', top_path=None):
6 from numpy.distutils.misc_util import Configuration
7 from numpy.distutils.system_info import get_info, system_info
8 config = Configuration('linalg', parent_package, top_path)
9
10 config.add_subpackage('tests')
11
12 # Configure lapack_lite
13
14 src_dir = 'lapack_lite'
15 lapack_lite_src = [
16 os.path.join(src_dir, 'python_xerbla.c'),
17 os.path.join(src_dir, 'f2c_z_lapack.c'),
18 os.path.join(src_dir, 'f2c_c_lapack.c'),
19 os.path.join(src_dir, 'f2c_d_lapack.c'),
20 os.path.join(src_dir, 'f2c_s_lapack.c'),
21 os.path.join(src_dir, 'f2c_lapack.c'),
22 os.path.join(src_dir, 'f2c_blas.c'),
23 os.path.join(src_dir, 'f2c_config.c'),
24 os.path.join(src_dir, 'f2c.c'),
25 ]
26 all_sources = config.paths(lapack_lite_src)
27
28 if os.environ.get('NPY_USE_BLAS_ILP64', "0") != "0":
29 lapack_info = get_info('lapack_ilp64_opt', 2)
30 else:
31 lapack_info = get_info('lapack_opt', 0) # and {}
32
33 use_lapack_lite = not lapack_info
34
35 if use_lapack_lite:
36 # This makes numpy.distutils write the fact that lapack_lite
37 # is being used to numpy.__config__
38 class numpy_linalg_lapack_lite(system_info):
39 def calc_info(self):
40 info = {'language': 'c'}
41 size_t_size = sysconfig.get_config_var("SIZEOF_SIZE_T")
42 if size_t_size:
43 maxsize = 2**(size_t_size - 1) - 1
44 else:
45 # We prefer using sysconfig as it allows cross-compilation
46 # but the information may be missing (e.g. on windows).
47 maxsize = sys.maxsize
48 if maxsize > 2**32:
49 # Build lapack-lite in 64-bit integer mode.
50 # The suffix is arbitrary (lapack_lite symbols follow it),
51 # but use the "64_" convention here.
52 info['define_macros'] = [
53 ('HAVE_BLAS_ILP64', None),
54 ('BLAS_SYMBOL_SUFFIX', '64_'),
55 ('OPENBLAS_ILP64_NAMING_SCHEME', None),
56 ]
57 self.set_info(**info)
58
59 lapack_info = numpy_linalg_lapack_lite().get_info(2)
60
61 def get_lapack_lite_sources(ext, build_dir):
62 if use_lapack_lite:

Callers

nothing calls this directly

Calls 10

add_subpackageMethod · 0.95
pathsMethod · 0.95
add_extensionMethod · 0.95
add_data_filesMethod · 0.95
ConfigurationClass · 0.90
get_infoFunction · 0.90
joinMethod · 0.45
getMethod · 0.45
get_infoMethod · 0.45

Tested by

no test coverage detected