-
Notifications
You must be signed in to change notification settings - Fork 8
/
meson.build
68 lines (57 loc) · 1.77 KB
/
meson.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
project(
'fluidsim',
'cpp',
license: 'CeCILL',
meson_version: '>= 1.1.0',
default_options: [
'buildtype=release',
'c_std=c99',
'cpp_std=c++14',
],
)
# https://mesonbuild.com/Python-module.html
py_mod = import('python')
py = py_mod.find_installation('python3', pure: false)
py_dep = py.dependency()
backend = get_option('transonic-backend')
if backend.contains(',')
backends = backend.split(',')
else
backends = [backend]
endif
use_pythran = backend.contains('pythran')
if use_pythran
incdir_numpy = run_command('transonic-get-include', 'numpy', check: true).stdout().strip()
inc_np = include_directories(incdir_numpy)
np_dep = declare_dependency(include_directories: inc_np)
incdir_pythran = run_command('transonic-get-include', 'pythran', check: true).stdout().strip()
pythran = find_program('pythran', native: true)
cpp_args_pythran = [
'-DENABLE_PYTHON_MODULE',
'-D__PYTHRAN__=3',
'-DPYTHRAN_BLAS_NONE'
]
if get_option('use-xsimd') == true
# xsimd is unvendored from pythran by conda-forge, and due to a compiler
# activation bug the default <prefix>/include/ may not be visible (see
# gh-15698). Hence look for xsimd explicitly.
xsimd_dep = dependency('xsimd', required: false)
pythran_dep = declare_dependency(
include_directories: incdir_pythran,
dependencies: xsimd_dep,
)
cpp_args_pythran += ['-DUSE_XSIMD']
else
pythran_dep = declare_dependency(
include_directories: incdir_pythran,
)
endif
pythran_complex_hook = get_option('pythran-complex-hook')
if pythran_complex_hook == 'os-dependent'
pythran_complex_hook = host_machine.system() == 'linux'
endif
if get_option('native')
cpp_args_pythran += ['-march=native', '-Ofast']
endif
endif
subdir('fluidsim')