Skip to content

Commit d7e17e5

Browse files
authoredMar 13, 2023
BLD: emit a warning when building from source on 32-bit Windows (scipy#18145)
1 parent 0a017f2 commit d7e17e5

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed
 

‎meson.build

+15-7
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,21 @@ project(
1818
],
1919
)
2020

21+
# https://mesonbuild.com/Python-module.html
22+
py_mod = import('python')
23+
py3 = py_mod.find_installation(pure: false)
24+
py3_dep = py3.dependency()
25+
26+
# Emit a warning for 32-bit Python installs on Windows; users are getting
27+
# unexpected from-source builds there because we no longer provide wheels.
28+
is_windows = host_machine.system() == 'windows'
29+
if is_windows and py3.has_variable('EXT_SUFFIX')
30+
ext_suffix = py3.get_variable('EXT_SUFFIX')
31+
if ext_suffix.contains('win32')
32+
warning('You are building from source on a 32-bit Python install. SciPy does not provide 32-bit wheels; install 64-bit Python if you are having issues!')
33+
endif
34+
endif
35+
2136
cc = meson.get_compiler('c')
2237
cpp = meson.get_compiler('cpp')
2338

@@ -67,8 +82,6 @@ if ff.has_argument('-Wno-conversion')
6782
add_project_arguments('-Wno-conversion', language: 'fortran')
6883
endif
6984

70-
is_windows = host_machine.system() == 'windows'
71-
7285
# Intel compilers default to fast-math, so disable it if we detect Intel
7386
# compilers. A word of warning: this may not work with the conda-forge
7487
# compilers, because those have the annoying habit of including lots of flags
@@ -118,11 +131,6 @@ cython = find_program(meson.get_compiler('cython').cmd_array()[0])
118131
generate_f2pymod = files('tools/generate_f2pymod.py')
119132
tempita = files('scipy/_build_utils/tempita.py')
120133

121-
# https://mesonbuild.com/Python-module.html
122-
py_mod = import('python')
123-
py3 = py_mod.find_installation(pure: false)
124-
py3_dep = py3.dependency()
125-
126134
use_pythran = get_option('use-pythran')
127135
if use_pythran
128136
pythran = find_program('pythran', native: true)

0 commit comments

Comments
 (0)