@@ -128,6 +128,16 @@ if use_intel_sort and not fs.exists('src/npysort/x86-simd-sort/README.md')
128
128
error (' Missing the `x86-simd-sort` git submodule! Run `git submodule update --init` to fix this.' )
129
129
endif
130
130
131
+ # Setup openmp flags for x86-simd-sort:
132
+ omp_cflags = []
133
+ omp = []
134
+ if use_intel_sort and cpp.has_argument(' -fopenmp' )
135
+ omp = dependency (' openmp' , required : false )
136
+ if omp.found()
137
+ omp_cflags = [' -fopenmp' , ' -DXSS_USE_OPENMP' ]
138
+ endif
139
+ endif
140
+
131
141
if not fs.exists(' src/common/pythoncapi-compat' )
132
142
error (' Missing the `pythoncapi-compat` git submodule! ' +
133
143
' Run `git submodule update --init` to fix this.' )
@@ -867,14 +877,17 @@ foreach gen_mtargets : [
867
877
] : []
868
878
],
869
879
]
880
+
881
+
882
+
870
883
mtargets = mod_features.multi_targets(
871
884
gen_mtargets[0 ], multiarray_gen_headers + gen_mtargets[1 ],
872
885
dispatch : gen_mtargets[2 ],
873
886
# baseline: CPU_BASELINE, it doesn't provide baseline fallback
874
887
prefix : ' NPY_' ,
875
888
dependencies : [py_dep, np_core_dep],
876
889
c_args : c_args_common + max_opt,
877
- cpp_args : cpp_args_common + max_opt,
890
+ cpp_args : cpp_args_common + max_opt + omp_cflags ,
878
891
include_directories : [
879
892
' include' ,
880
893
' src/common' ,
@@ -1286,7 +1299,7 @@ py.extension_module('_multiarray_umath',
1286
1299
' src/umath' ,
1287
1300
' src/highway'
1288
1301
],
1289
- dependencies : [blas_dep],
1302
+ dependencies : [blas_dep, omp ],
1290
1303
link_with : [
1291
1304
npymath_lib,
1292
1305
unique_hash_so,
0 commit comments