diff options
Diffstat (limited to 'numpy/linalg/setup.py')
-rw-r--r-- | numpy/linalg/setup.py | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/numpy/linalg/setup.py b/numpy/linalg/setup.py index 66c07c9e1..acfab0a68 100644 --- a/numpy/linalg/setup.py +++ b/numpy/linalg/setup.py @@ -1,11 +1,9 @@ -from __future__ import division, print_function - import os import sys def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration - from numpy.distutils.system_info import get_info + from numpy.distutils.system_info import get_info, system_info config = Configuration('linalg', parent_package, top_path) config.add_data_dir('tests') @@ -26,10 +24,33 @@ def configuration(parent_package='', top_path=None): ] all_sources = config.paths(lapack_lite_src) - lapack_info = get_info('lapack_opt', 0) # and {} + if os.environ.get('NPY_USE_BLAS_ILP64', "0") != "0": + lapack_info = get_info('lapack_ilp64_opt', 2) + else: + lapack_info = get_info('lapack_opt', 0) # and {} + + use_lapack_lite = not lapack_info + + if use_lapack_lite: + # This makes numpy.distutils write the fact that lapack_lite + # is being used to numpy.__config__ + class numpy_linalg_lapack_lite(system_info): + def calc_info(self): + info = {'language': 'c'} + if sys.maxsize > 2**32: + # Build lapack-lite in 64-bit integer mode. + # The suffix is arbitrary (lapack_lite symbols follow it), + # but use the "64_" convention here. + info['define_macros'] = [ + ('HAVE_BLAS_ILP64', None), + ('BLAS_SYMBOL_SUFFIX', '64_') + ] + self.set_info(**info) + + lapack_info = numpy_linalg_lapack_lite().get_info(2) def get_lapack_lite_sources(ext, build_dir): - if not lapack_info: + if use_lapack_lite: print("### Warning: Using unoptimized lapack ###") return all_sources else: |