5353# (see cibuildwheel settings in pyproject.toml), but used by CI jobs already
5454blas_symbol_suffix = get_option (' blas-symbol-suffix' )
5555
56+ use_ilp64 = get_option (' use-ilp64' )
57+ if not use_ilp64
58+ # For now, keep supporting this environment variable too (same as in setup.py)
59+ # `false is the default for the CLI flag, so check if env var was set
60+ use_ilp64 = run_command (py,
61+ [
62+ ' -c' ,
63+ ' import os; print(1) if os.environ.get("NPY_USE_BLAS_ILP64", "0") != "0" else print(0)'
64+ ],
65+ check : true
66+ ).stdout().strip() == ' 1'
67+ endif
68+
5669
5770# TODO: 64-bit (ILP64) BLAS and LAPACK support (e.g., check for more .pc files
5871# so we detect `openblas64_.so` directly). Partially supported now, needs more
@@ -70,7 +83,12 @@ lapack_name = get_option('lapack')
7083# pkg-config uses a lower-case name while CMake uses a capitalized name, so try
7184# that too to make the fallback detection with CMake work
7285if blas_name == ' openblas'
73- blas = dependency ([' openblas' , ' OpenBLAS' ], required : false )
86+ if use_ilp64
87+ _openblas_names = [' openblas64' , ' openblas' , ' OpenBLAS' ]
88+ else
89+ _openblas_names = [' openblas' , ' OpenBLAS' ]
90+ endif
91+ blas = dependency (_openblas_names, required : false )
7492else
7593 blas = dependency (blas_name, required : false )
7694endif
@@ -121,19 +139,6 @@ if have_blas
121139 endif
122140endif
123141
124- use_ilp64 = get_option (' use-ilp64' )
125- if not use_ilp64
126- # For now, keep supporting this environment variable too (same as in setup.py)
127- # `false is the default for the CLI flag, so check if env var was set
128- use_ilp64 = run_command (py,
129- [
130- ' -c' ,
131- ' import os; print(1) if os.environ.get("NPY_USE_BLAS_ILP64", "0") != "0" else print(0)'
132- ],
133- check : true
134- ).stdout().strip() == ' 1'
135- endif
136-
137142# BLAS and LAPACK are dependencies for NumPy. Since NumPy 2.0, by default the
138143# build will fail if they are missing; the performance impact is large, so
139144# using fallback routines must be explicitly opted into by the user. xref
0 commit comments