File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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'
You can’t perform that action at this time.
0 commit comments