-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
104 lines (89 loc) · 2.02 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
project(
'fftconv',
'cpp',
'c',
version : '0.1.0',
default_options : [ # https://mesonbuild.com/Builtin-options.html
'warning_level=3',
'cpp_std=c++14',
'c_std=c11',
'debug=true', # debug symbols
'buildtype=release',
'optimization=3',
]
)
add_project_arguments('-Wno-sign-compare', language: 'cpp')
add_project_arguments('-mavx2', language: 'cpp')
add_project_arguments('-mavx2', language: 'c')
fftconv_src = [
'./fftconv_fftw/fftconv.cpp'
]
pocketfft_src = [
'fftconv_pocketfft/pocketfft.c'
]
pocketfft_hdr = [
'fftconv_pocketfft/pocketfft.h'
]
project_src = [
fftconv_src,
pocketfft_src
]
project_inc = include_directories(
'.',
'./fftconv_fftw',
'./fftconv_pocketfft',
'/opt/homebrew/include'
)
# Dependencies
cpp = meson.get_compiler('cpp')
larmadillo = cpp.find_library('armadillo', required: true)
lfftw3 = cpp.find_library('fftw3', required: true)
lbenchmark = cpp.find_library('benchmark', required: true)
project_dependencies = [
dependency('threads'),
larmadillo,
lfftw3,
lbenchmark,
]
# check for gperftools
lprofiler = cpp.find_library('profiler', required: true)
build_args = []
# ======
# Target
# ======
build_args += [
'-DPROJECT_NAME=' + meson.project_name(),
'-DPROJECT_VERSION=' + meson.project_version(),
]
# link gperftools
#link_args = ['-Wl,--no-as-needed,-lprofiler,--as-needed' ]
link_args = ['-lprofiler' ]
executable(
'test_fftconv',
'test/test.cpp',
project_src,
dependencies: project_dependencies,
include_directories: project_inc,
install : false,
c_args : build_args,
cpp_args : build_args,
link_args: link_args
)
executable(
'bench_fftconv',
'benchmark/bench_fftconv.cpp',
project_src,
dependencies: project_dependencies,
include_directories: project_inc,
install : false,
c_args : build_args,
)
executable(
'bench_pocketfft_hdr_thread',
'benchmark/bench_pocketfft_hdr_thread.cpp',
project_src,
dependencies: project_dependencies,
include_directories: project_inc,
install : false,
c_args : build_args,
)