-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmeson.build
More file actions
291 lines (283 loc) · 15.3 KB
/
Copy pathmeson.build
File metadata and controls
291 lines (283 loc) · 15.3 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
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
project(
'palignprims',
'cpp',
version : '1.0.0',
default_options : ['warning_level=everything', 'cpp_std=c++23']
)
# Configuration variables
# -----------------------
cc = meson.get_compiler('cpp')
dependencies = []
include_dirs = []
override_options = []
cpp_args = []
link_args = []
# Include Python dependency
# -------------------------
py = import('python')
py_installation = py.find_installation(
pure: false,
modules: []
)
# Include boost dependency
# ------------------------
# NOTE: Do not add dependency to dependencies list until building the target. Some targets may not need boost.
boost_modules = [
'container',
'filesystem',
'iostreams'
]
boost_dep = dependency(
'boost',
version : '>=1.89.0',
modules : boost_modules,
static : true
)
# Load source checker target
# --------------------------
source_checker = custom_target(
'source_checker',
command: [py_installation.full_path(), meson.current_source_dir() + '/source_checker.py'],
output: ['unused'],
build_always_stale: true
)
# Load doxygen target
# -------------------
dot = find_program('dot', required: true)
doxygen = find_program('doxygen', required: true)
doc_generator = custom_target(
'doc_generator',
command: [py_installation.full_path(), meson.current_source_dir() + '/source_doxygen_runner.py'],
output : ['docs'],
build_always_stale: true
)
# Configure options
# -----------------
base_cpp_args = []
base_link_args = []
base_override_options = []
base_debug_override_options = base_override_options + ['b_lto=false', 'b_ndebug=false', 'debug=true', 'cpp_debugstl=true'] # + ['optimization=0', 'buildtype=debug']
base_release_override_options = base_override_options + ['b_lto=true', 'b_ndebug=true', 'debug=false', 'cpp_debugstl=false'] # + ['optimization=3', 'buildtype=release']
cc = meson.get_compiler('cpp')
if cc.get_id() == 'gcc' or cc.get_id() == 'clang'
# Configure base arguments for compiling / linking
# ------------------------------------------------
# Disable padding notification warning: Don't care about the compiler padding a struct.
base_cpp_args += ['-Wno-padded']
# Disable missing noexcept warning: Don't care that functions can be marked with noexcept.
base_cpp_args += ['-Wno-noexcept']
# Disable ignoring inline warning: When function implementations are placed inside of class definitions, it's a hint to the
# compiler to inline the function. If it can't inline the function (or it doesn't inline it because it seems like a bad idea), it
# puts out a -Winline warning. This only shows up when compiling at higher optimization levels.
base_cpp_args += ['-Wno-inline']
# Disable superfluous packing warning: When packing a struct, the compiler issues a warning if the struct is exactly the same
# size in its packed form vs its padded form (because all members are already aligned). These warnings are being supressed because
# the intention is for these structs to be packed, even if packing does nothing. In the future, should such a struct ever change
# such that members are no longer aligned, the packing will ensure padding stays out.
base_cpp_args += ['-Wno-packed']
# Disable warnings specific to g++ extensions: These warnings are about applying extensions specific to g++. It doesn't apply to
# portable C++ code. As such, don't care about them.
base_cpp_args += ['-Wno-suggest-attribute=pure', '-Wno-suggest-attribute=const']
# Unsure how to handle this, but it seems safe to ignore as this library requires a relatively new version of g++ and STL.
base_cpp_args += ['-Wno-abi-tag']
# Enable more robust compiler diagnostics
base_cpp_args += ['-fconcepts-diagnostics-depth=9999', '-ftemplate-backtrace-limit=0']
# Configure debug arguments for compiling / linking
# ------------------------------------------------
base_debug_cpp_args = base_cpp_args
base_debug_link_args = base_link_args
# Enable standard library debugging.
base_debug_cpp_args += ['-D_GLIBCXX_DEBUG']
# Enable Google sanititzers.
# DON'T USE THIS? MESON HAS b_sanitize OPTION?
# san_args = ['-fsanitize=undefined', '-fsanitize=thread']
# if cc.get_id() == 'clang'
# # Only available in clang -- doesn't really matter because I use valgrind for these.
# san_args += ['-fsanitize=memory']
# san_args += ['-fsanitize=leak']
# san_args += ['-fsanitize=address']
# endif
# debug_cpp_args += san_args
# debug_link_args += san_args
# Configure release arguments for compiling / linking
# ---------------------------------------------------
base_release_cpp_args = base_cpp_args
base_release_link_args = base_link_args
else
base_debug_cpp_args = base_cpp_args + []
base_debug_link_args = base_link_args + []
base_release_cpp_args = base_cpp_args + []
base_release_link_args = base_link_args + []
endif
# Set configuration options based on build type
# ---------------------------------------------
buildtype = get_option('buildtype')
if buildtype in ['debug', 'debugoptimized', 'minsize'] # Meson claims these profiles all have debugging info turned on, so enable debugging features
override_options += base_debug_override_options
cpp_args += base_debug_cpp_args
link_args += base_debug_link_args
elif buildtype == 'release'
override_options += base_release_override_options
cpp_args += base_release_cpp_args
link_args += base_release_link_args
elif buildtype == 'plain' # Unsure about what to do for plain - keep as-is for now.
override_options += []
cpp_args += []
link_args += []
else
error('Unknown buildtype: ' + buildtype)
endif
# Create unittest executables
# ---------------------------
gtest = subproject('gtest')
gtest_dependency = gtest.get_variable('gtest_dep')
gmock_dependency = gtest.get_variable('gmock_dep')
gtest = executable(
'gtest',
[
'gtest-all.cpp',
'offbynull/helpers/unordered_thread_pool_test.cpp',
'offbynull/helpers/simple_value_bidirectional_view_test.cpp',
'offbynull/helpers/forkable_thread_pool_test.cpp',
'offbynull/helpers/blankable_bidirectional_view_test.cpp',
'offbynull/helpers/join_bidirectional_view_test.cpp',
'offbynull/helpers/concat_bidirectional_view_test.cpp',
'offbynull/helpers/filter_bidirectional_view_test.cpp',
'offbynull/aligner/graph/utils_test.cpp',
'offbynull/aligner/graph/sliceable_pairwise_alignment_graph_test.cpp',
'offbynull/aligner/graphs/directed_graph_test.cpp',
'offbynull/aligner/graphs/grid_graph_test.cpp',
'offbynull/aligner/graphs/pairwise_global_alignment_graph_test.cpp',
'offbynull/aligner/graphs/pairwise_local_alignment_graph_test.cpp',
'offbynull/aligner/graphs/pairwise_overlap_alignment_graph_test.cpp',
'offbynull/aligner/graphs/pairwise_fitting_alignment_graph_test.cpp',
'offbynull/aligner/graphs/pairwise_extended_gap_alignment_graph_test.cpp',
'offbynull/aligner/graphs/prefix_sliceable_pairwise_alignment_graph_test.cpp',
'offbynull/aligner/graphs/reversed_sliceable_pairwise_alignment_graph_test.cpp',
'offbynull/aligner/graphs/suffix_sliceable_pairwise_alignment_graph_test.cpp',
'offbynull/aligner/graphs/middle_sliceable_pairwise_alignment_graph_test.cpp',
'offbynull/aligner/backtrackers/graph_backtracker/backtracker_test.cpp',
'offbynull/aligner/backtrackers/pairwise_alignment_graph_backtracker/backtracker_test.cpp',
'offbynull/aligner/backtrackers/sliceable_pairwise_alignment_graph_backtracker/path_container/path_container_test.cpp',
'offbynull/aligner/backtrackers/sliceable_pairwise_alignment_graph_backtracker/forward_walker/forward_walker_test.cpp',
'offbynull/aligner/backtrackers/sliceable_pairwise_alignment_graph_backtracker/bidi_walker/bidi_walker_test.cpp',
'offbynull/aligner/backtrackers/sliceable_pairwise_alignment_graph_backtracker/resident_segmenter/resident_segmenter_test.cpp',
'offbynull/aligner/backtrackers/sliceable_pairwise_alignment_graph_backtracker/sliced_subdivider/sliced_subdivider_test.cpp',
'offbynull/aligner/backtrackers/sliceable_pairwise_alignment_graph_backtracker/backtracker_test.cpp',
'offbynull/aligner/sequences/mmap_sequence_test.cpp',
'offbynull/aligner/sequences/iota_sequence_test.cpp',
'offbynull/aligner/sequences/transform_sequence_test.cpp',
'offbynull/aligner/sequences/reverse_sequence_test.cpp',
'offbynull/aligner/sequences/repeat_sequence_test.cpp',
'offbynull/aligner/sequences/prefix_pad_sequence_test.cpp',
'offbynull/aligner/sequences/suffix_pad_sequence_test.cpp',
'offbynull/aligner/sequences/substring_sequence_test.cpp',
'offbynull/aligner/sequences/sliding_window_sequence_test.cpp',
'offbynull/aligner/sequences/chunk_sequence_test.cpp',
'offbynull/aligner/sequences/zip_sequence_test.cpp',
'offbynull/aligner/scorers/constant_scorer_test.cpp',
'offbynull/aligner/scorers/simple_scorer_test.cpp',
'offbynull/aligner/scorers/levenshtein_scorer_test.cpp',
'offbynull/aligner/scorers/substitution_map_scorer_test.cpp',
'offbynull/aligner/scorers/single_character_substitution_matrix_scorer_test.cpp',
'offbynull/aligner/scorers/blosum_scorer_test.cpp',
'offbynull/aligner/scorers/pam_scorer_test.cpp',
'offbynull/aligner/scorers/qwerty_scorer_test.cpp',
'offbynull/aligner/scorers/widening_scorer_test.cpp',
'offbynull/aligner/scorers/wrap_callable_scorer_test.cpp',
'offbynull/aligner/scorers/consumption_gating_scorer_test.cpp',
'offbynull/aligner/aligners/global_dynamic_programming_heap_aligner_test.cpp',
'offbynull/aligner/aligners/global_dynamic_programming_stack_aligner_test.cpp',
'offbynull/aligner/aligners/global_sliced_subdivision_heap_aligner_test.cpp',
'offbynull/aligner/aligners/global_sliced_subdivision_stack_aligner_test.cpp',
'offbynull/aligner/aligners/local_dynamic_programming_heap_aligner_test.cpp',
'offbynull/aligner/aligners/local_dynamic_programming_stack_aligner_test.cpp',
'offbynull/aligner/aligners/local_sliced_subdivision_heap_aligner_test.cpp',
'offbynull/aligner/aligners/local_sliced_subdivision_stack_aligner_test.cpp',
'offbynull/aligner/aligners/overlap_dynamic_programming_heap_aligner_test.cpp',
'offbynull/aligner/aligners/overlap_dynamic_programming_stack_aligner_test.cpp',
'offbynull/aligner/aligners/overlap_sliced_subdivision_heap_aligner_test.cpp',
'offbynull/aligner/aligners/overlap_sliced_subdivision_stack_aligner_test.cpp',
'offbynull/aligner/aligners/fitting_dynamic_programming_heap_aligner_test.cpp',
'offbynull/aligner/aligners/fitting_dynamic_programming_stack_aligner_test.cpp',
'offbynull/aligner/aligners/fitting_sliced_subdivision_heap_aligner_test.cpp',
'offbynull/aligner/aligners/fitting_sliced_subdivision_stack_aligner_test.cpp',
'offbynull/aligner/aligners/extended_gap_dynamic_programming_heap_aligner_test.cpp',
'offbynull/aligner/aligners/extended_gap_dynamic_programming_stack_aligner_test.cpp',
'offbynull/aligner/aligners/extended_gap_sliced_subdivision_heap_aligner_test.cpp',
'offbynull/aligner/aligners/extended_gap_sliced_subdivision_stack_aligner_test.cpp',
'offbynull/aligner/aligners/rotational_dynamic_programming_heap_aligner_test.cpp',
'offbynull/aligner/aligners/rotational_dynamic_programming_stack_aligner_test.cpp',
'offbynull/aligner/aligners/rotational_sliced_subdivision_heap_aligner_test.cpp',
'offbynull/aligner/aligners/rotational_sliced_subdivision_stack_aligner_test.cpp',
],
source_checker,
dependencies: dependencies + [gtest_dependency]+ [boost_dep],
include_directories: include_dirs,
override_options: override_options,
cpp_args: cpp_args,
link_args: link_args
)
test('gtest', gtest)
# Create benchmark executables
# ----------------------------
benchmark_tiny_alignment_000 = executable(
'benchmark-tiny-alignment_000',
['benchmark-tiny-alignment.cpp'],
source_checker,
dependencies : [boost_dep],
override_options : base_release_override_options,
cpp_args : base_release_cpp_args \
+ ['-DBENCHMARK_HEAP', '-DBENCHMARK_SIZE_T_INDEX'],
link_args : base_release_link_args
)
benchmark_tiny_alignment_0m00 = executable(
'benchmark-tiny-alignment_0m00',
['benchmark-tiny-alignment.cpp'],
source_checker,
dependencies : [boost_dep],
override_options : base_release_override_options,
cpp_args : base_release_cpp_args \
+ ['-DBENCHMARK_HEAP', '-DMINIMIZE_ALLOCS', '-DBENCHMARK_SIZE_T_INDEX'],
link_args : base_release_link_args
)
benchmark_tiny_alignment_100 = executable(
'benchmark-tiny-alignment_100',
['benchmark-tiny-alignment.cpp'],
source_checker,
dependencies : [boost_dep],
override_options : base_release_override_options,
cpp_args : base_release_cpp_args \
+ ['-DBENCHMARK_STACK', '-DBENCHMARK_SIZE_T_INDEX'],
link_args : base_release_link_args
)
benchmark_tiny_alignment_101 = executable(
'benchmark-tiny-alignment_101',
['benchmark-tiny-alignment.cpp'],
source_checker,
dependencies : [boost_dep],
override_options : base_release_override_options,
cpp_args : base_release_cpp_args \
+ ['-DBENCHMARK_STACK', '-DBENCHMARK_SIZE_T_INDEX', '-DOBN_PACK_STRUCTS'],
link_args : base_release_link_args
)
benchmark_tiny_alignment_110 = executable(
'benchmark-tiny-alignment_110',
['benchmark-tiny-alignment.cpp'],
source_checker,
dependencies : [boost_dep],
override_options : base_release_override_options,
cpp_args : base_release_cpp_args \
+ ['-DBENCHMARK_STACK', '-DBENCHMARK_UINT8_INDEX'],
link_args : base_release_link_args
)
benchmark_tiny_alignment_111 = executable(
'benchmark-tiny-alignment_111',
['benchmark-tiny-alignment.cpp'],
source_checker,
dependencies : [boost_dep],
override_options : base_release_override_options,
cpp_args : base_release_cpp_args \
+ ['-DBENCHMARK_STACK', '-DBENCHMARK_UINT8_INDEX', '-DOBN_PACK_STRUCTS'],
link_args : base_release_link_args
)