Skip to content

Commit 9726282

Browse files
WillAydzanmato1984
authored andcommitted
apacheGH-45800: [C++] Implement util configuration in Meson (apache#45824)
### Rationale for this change This continues to add support for Meson in the Arrow C++ codebase ### What changes are included in this PR? The util directory has been added to the Meson configuration ### Are these changes tested? Yes ### Are there any user-facing changes? No * GitHub Issue: apache#45800 Authored-by: Will Ayd <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
1 parent b4f409d commit 9726282

File tree

2 files changed

+239
-1
lines changed

2 files changed

+239
-1
lines changed

cpp/src/arrow/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ arrow_components = {
128128
'util/logger.cc',
129129
'util/logging.cc',
130130
'util/key_value_metadata.cc',
131+
'util/math_internal.cc',
131132
'util/memory.cc',
132133
'util/mutex.cc',
133134
'util/ree_util.cc',

cpp/src/arrow/util/meson.build

Lines changed: 238 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ conf_data.set('ARROW_GCS', false)
5858
conf_data.set('ARROW_HDFS', false)
5959
conf_data.set('ARROW_S3', false)
6060
conf_data.set('ARROW_USE_GLOG', false)
61-
conf_data.set('ARROW_USE_NATIVE_INT128', false)
61+
62+
has_int128 = cpp_compiler.has_define('__SIZEOF_INT128__')
63+
conf_data.set('ARROW_USE_NATIVE_INT128', has_int128)
64+
6265
conf_data.set('ARROW_WITH_BROTLI', false)
6366
conf_data.set('ARROW_WITH_BZ2', false)
6467
conf_data.set('ARROW_WITH_LZ4', false)
@@ -92,3 +95,237 @@ configure_file(
9295
configuration: internal_conf_data,
9396
format: 'cmake@',
9497
)
98+
99+
install_headers(
100+
[
101+
'algorithm.h',
102+
'aligned_storage.h',
103+
'align_util.h',
104+
'async_generator_fwd.h',
105+
'async_generator.h',
106+
'async_util.h',
107+
'base64.h',
108+
'basic_decimal.h',
109+
'benchmark_util.h',
110+
'binary_view_util.h',
111+
'bit_block_counter.h',
112+
'bitmap_builders.h',
113+
'bitmap_generate.h',
114+
'bitmap.h',
115+
'bitmap_ops.h',
116+
'bitmap_reader.h',
117+
'bitmap_visit.h',
118+
'bitmap_writer.h',
119+
'bit_run_reader.h',
120+
'bitset_stack.h',
121+
'bit_util.h',
122+
'bpacking64_default.h',
123+
'bpacking_avx2.h',
124+
'bpacking_avx512.h',
125+
'bpacking_default.h',
126+
'bpacking.h',
127+
'bpacking_neon.h',
128+
'byte_size.h',
129+
'cancel.h',
130+
'checked_cast.h',
131+
'compare.h',
132+
'compression.h',
133+
'concurrent_map.h',
134+
'converter.h',
135+
'counting_semaphore.h',
136+
'cpu_info.h',
137+
'crc32.h',
138+
'debug.h',
139+
'decimal.h',
140+
'delimiting.h',
141+
'dict_util.h',
142+
'dispatch.h',
143+
'double_conversion.h',
144+
'endian.h',
145+
'float16.h',
146+
'formatting.h',
147+
'functional.h',
148+
'future.h',
149+
'hashing.h',
150+
'hash_util.h',
151+
'int_util.h',
152+
'int_util_overflow.h',
153+
'io_util.h',
154+
'iterator.h',
155+
'key_value_metadata.h',
156+
'launder.h',
157+
'list_util.h',
158+
'logger.h',
159+
'logging.h',
160+
'macros.h',
161+
'map.h',
162+
'math_constants.h',
163+
'memory.h',
164+
'mutex.h',
165+
'parallel.h',
166+
'pcg_random.h',
167+
'prefetch.h',
168+
'print.h',
169+
'queue.h',
170+
'range.h',
171+
'ree_util.h',
172+
'regex.h',
173+
'rows_to_batches.h',
174+
'simd.h',
175+
'small_vector.h',
176+
'sort.h',
177+
'spaced.h',
178+
'span.h',
179+
'stopwatch.h',
180+
'string_builder.h',
181+
'string.h',
182+
'task_group.h',
183+
'tdigest.h',
184+
'test_common.h',
185+
'thread_pool.h',
186+
'time.h',
187+
'tracing.h',
188+
'trie.h',
189+
'type_fwd.h',
190+
'type_traits.h',
191+
'ubsan.h',
192+
'union_util.h',
193+
'unreachable.h',
194+
'uri.h',
195+
'utf8.h',
196+
'value_parsing.h',
197+
'vector.h',
198+
'visibility.h',
199+
'windows_compatibility.h',
200+
'windows_fixup.h',
201+
],
202+
subdir: 'arrow/util',
203+
)
204+
205+
utility_test_srcs = [
206+
'align_util_test.cc',
207+
'atfork_test.cc',
208+
'byte_size_test.cc',
209+
'byte_stream_split_test.cc',
210+
'cache_test.cc',
211+
'checked_cast_test.cc',
212+
'compression_test.cc',
213+
'decimal_test.cc',
214+
'float16_test.cc',
215+
'fixed_width_test.cc',
216+
'formatting_util_test.cc',
217+
'key_value_metadata_test.cc',
218+
'hashing_test.cc',
219+
'int_util_test.cc',
220+
'io_util_test.cc',
221+
'iterator_test.cc',
222+
'list_util_test.cc',
223+
'logger_test.cc',
224+
'logging_test.cc',
225+
'math_test.cc',
226+
'queue_test.cc',
227+
'range_test.cc',
228+
'ree_util_test.cc',
229+
'reflection_test.cc',
230+
'rows_to_batches_test.cc',
231+
'small_vector_test.cc',
232+
'span_test.cc',
233+
'stl_util_test.cc',
234+
'string_test.cc',
235+
'tdigest_test.cc',
236+
'test_common.cc',
237+
'time_test.cc',
238+
'tracing_test.cc',
239+
'trie_test.cc',
240+
'uri_test.cc',
241+
'utf8_util_test.cc',
242+
'value_parsing_test.cc',
243+
]
244+
245+
if host_machine.system() == 'windows'
246+
# This manifest enables long file paths on Windows 10+
247+
# See https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#enable-long-paths-in-windows-10-version-1607-and-later
248+
if cpp_compiler.get_id() == 'msvc'
249+
utility_test_sources += ['io_util_test.manifest']
250+
else
251+
utility_test_sources += ['io_util_test.rc']
252+
endif
253+
endif
254+
255+
exc = executable(
256+
'arrow-utility-test',
257+
sources: utility_test_srcs,
258+
dependencies: [arrow_dep, filesystem_dep, gtest_dep, gmock_dep],
259+
link_with: [arrow_test_lib],
260+
implicit_include_directories: false,
261+
)
262+
test('arrow-utility-test', exc)
263+
264+
util_tests = {
265+
'arrow-async-utility-test': {
266+
'sources': [
267+
'async_generator_test.cc',
268+
'async_util_test.cc',
269+
'test_common.cc',
270+
],
271+
},
272+
'arrow-bit-utility-test': {
273+
'sources': [
274+
'bit_block_counter_test.cc',
275+
'bit_util_test.cc',
276+
'rle_encoding_test.cc',
277+
],
278+
},
279+
'arrow-threading-utility-test': {
280+
'sources': [
281+
'cancel_test.cc',
282+
'counting_semaphore_test.cc',
283+
'future_test.cc',
284+
'task_group_test.cc',
285+
'test_common.cc',
286+
'thread_pool_test.cc',
287+
],
288+
},
289+
'arrow-crc32-test': {'sources': ['crc32_test.cc']},
290+
}
291+
292+
foreach key, val : util_tests
293+
exc = executable(
294+
key,
295+
sources: val['sources'],
296+
dependencies: [arrow_test_dep],
297+
implicit_include_directories: false,
298+
)
299+
test(key, exc)
300+
endforeach
301+
302+
util_benchmarks = [
303+
'bit_block_counter',
304+
'bit_util',
305+
'bitmap_reader',
306+
'cache',
307+
'compression',
308+
'decimal',
309+
'hashing',
310+
'int_util',
311+
'machine',
312+
'queue',
313+
'range',
314+
'small_vector',
315+
'tdigest',
316+
'thread_pool',
317+
'trie',
318+
]
319+
320+
foreach util_benchmark : util_benchmarks
321+
benchmark_name = '@0@-benchmark'.format(util_benchmark.replace('_', '-'))
322+
exc = executable(
323+
benchmark_name,
324+
sources: '@0@_benchmark.cc'.format(util_benchmark),
325+
dependencies: [arrow_benchmark_dep],
326+
implicit_include_directories: false,
327+
)
328+
benchmark(benchmark_name, exc)
329+
endforeach
330+
331+
# TODO: XSimd benchmark. See GH-45823

0 commit comments

Comments
 (0)