-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathmeson.build
More file actions
70 lines (61 loc) · 1.36 KB
/
meson.build
File metadata and controls
70 lines (61 loc) · 1.36 KB
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
69
70
project(
'mkl-service',
['c', 'cython'],
version: run_command(
'python', '-c',
'import os; exec(open("mkl/_version.py").read()); print(__version__)',
check: true
).stdout().strip(),
default_options: [
'buildtype=release',
]
)
py = import('python').find_installation(pure: false)
c_args = ['-DNDEBUG']
thread_dep = dependency('threads')
cc = meson.get_compiler('c')
mkl_dep = dependency('MKL', method: 'cmake',
modules: ['MKL::MKL'],
cmake_args: [
'-DMKL_ARCH=intel64',
'-DMKL_LINK=sdl',
],
required: true
)
rpath = ''
if host_machine.system() != 'windows'
rpath = '$ORIGIN/../..:$ORIGIN/../../..'
endif
# C extension
py.extension_module(
'_mklinit',
sources: ['mkl/_mklinitmodule.c'],
dependencies: [mkl_dep, thread_dep],
c_args: c_args + ['-DUSING_MKL_RT'],
install_rpath: rpath,
install: true,
subdir: 'mkl'
)
# Cython extension
py.extension_module(
'_py_mkl_service',
sources: ['mkl/_py_mkl_service.pyx'],
dependencies: [mkl_dep],
c_args: c_args,
install_rpath: rpath,
install: true,
subdir: 'mkl'
)
# Python sources
py.install_sources(
[
'mkl/__init__.py',
'mkl/_init_helper.py',
'mkl/_version.py',
],
subdir: 'mkl'
)
install_subdir(
'mkl/tests',
install_dir: py.get_install_dir() / 'mkl'
)