8000 Add meson option to toggle building with openMP · r-devulap/numpy@02c4728 · GitHub
[go: up one dir, main page]

Skip to content

Commit 02c4728

Browse files
committed
Add meson option to toggle building with openMP
1 parent f8cfa4e commit 02c4728

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

meson.options

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ option('disable-intel-sort', type: 'boolean', value: false,
2222
description: 'Disables SIMD-optimized operations related to Intel x86-simd-sort')
2323
option('disable-threading', type: 'boolean', value: false,
2424
description: 'Disable threading support (see `NPY_ALLOW_THREADS` docs)')
25+
option('enable-openmp', type: 'boolean', value: false,
26+
description: 'Enable building NumPy with openmp support')
2527
option('disable-optimization', type: 'boolean', value: false,
2628
description: 'Disable CPU optimized code (dispatch,simd,unroll...)')
2729
option('cpu-baseline', type: 'string', value: 'min',

numpy/_core/meson.build

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,15 @@ if use_intel_sort and not fs.exists('src/npysort/x86-simd-sort/README.md')
128128
error('Missing the `x86-simd-sort` git submodule! Run `git submodule update --init` to fix this.')
129129
endif
130130

131+
use_openmp = not get_option('disable-threading') and get_option('enable-openmp') and cpp.has_argument('-fopenmp')
132+
summary({
133+
'Build with openMP? ' : use_openmp,
134+
})
135+
131136
# Setup openmp flags for x86-simd-sort:
132137
omp_cflags = []
133138
omp = []
134-
if use_intel_sort and cpp.has_argument('-fopenmp')
139+
if use_intel_sort and use_openmp
135140
omp = dependency('openmp', required : false)
136141
if omp.found()
137142
omp_cflags = ['-fopenmp', '-DXSS_USE_OPENMP']

0 commit comments

Comments
 (0)
0