Skip to content

Commit ab6a084

Browse files
authored
Merge branch 'main' into coverity-triage-docs
2 parents 5e21e23 + 5ee2b9a commit ab6a084

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

‎meson.build‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,37 @@ if cc.get_argument_syntax() == 'msvc'
5555
link_args = ['/NXCompat', '/DynamicBase']
5656

5757
if cc.get_id().startswith('intel')
58+
# workaround for icx _Dcomplex regression, see numpy/numpy#31337
59+
npy_complex_check = '''
60+
#include <Python.h>
61+
#include <numpy/npy_math.h>
62+
'''
63+
undef_llvm = '/U__INTEL_LLVM_COMPILER'
64+
65+
if not cc.compiles(
66+
npy_complex_check,
67+
name: 'numpy complex helpers build with icx',
68+
dependencies: py_dep,
69+
include_directories: inc_np
70+
)
71+
if cc.compiles(
72+
npy_complex_check,
73+
name: 'numpy complex helpers build with ' + undef_llvm,
74+
args: undef_llvm,
75+
dependencies: py_dep,
76+
include_directories: inc_np
77+
)
78+
c_args += undef_llvm
79+
else
80+
error(
81+
'numpy headers do not compile with icx on Windows: '
82+
+ 'npy_cdouble conflicts with UCRT complex.h and '
83+
+ undef_llvm + ' does not resolve it. '
84+
+ 'See numpy/numpy#31337.'
85+
)
86+
endif
87+
endif
88+
5889
c_args += [
5990
'/Qimf-precision=high', '/Qprotect-parens',
6091
'/clang:-fveclib=SVML', '/clang:-fvectorize'

0 commit comments

Comments
 (0)