diff options
| author | Matti Picus <matti.picus@gmail.com> | 2022-06-13 09:13:23 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-13 09:13:23 +0300 |
| commit | c8dd91b633798a4082f255784dec483b08351f58 (patch) | |
| tree | 4164341d72d626b854e33aee178708fbc3c0277e /numpy | |
| parent | d4baf3641471971552206b02f94323a54b54d99a (diff) | |
| parent | ffcaa3f783af53d706ffe001add323c938dfd78e (diff) | |
| download | numpy-c8dd91b633798a4082f255784dec483b08351f58.tar.gz | |
Merge pull request #21733 from hoodmane/fix-pointer-size-for-cross-build
ENH: Fix pointer size determination for cross build
Diffstat (limited to 'numpy')
| -rw-r--r-- | numpy/linalg/setup.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/numpy/linalg/setup.py b/numpy/linalg/setup.py index dc62dff8f..1c4e1295e 100644 --- a/numpy/linalg/setup.py +++ b/numpy/linalg/setup.py @@ -1,5 +1,6 @@ import os import sys +import sysconfig def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration @@ -38,7 +39,14 @@ def configuration(parent_package='', top_path=None): class numpy_linalg_lapack_lite(system_info): def calc_info(self): info = {'language': 'c'} - if sys.maxsize > 2**32: + size_t_size = sysconfig.get_config_var("SIZEOF_SIZE_T") + if size_t_size: + maxsize = 2**(size_t_size - 1) - 1 + else: + # We prefer using sysconfig as it allows cross-compilation + # but the information may be missing (e.g. on windows). + maxsize = sys.maxsize + if 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. |
