@@ -29,6 +29,7 @@ project(
29
29
VERSION "${RAPIDS_VERSION} "
30
30
LANGUAGES C CXX CUDA
31
31
)
32
+
32
33
if (CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA" AND CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 11.5 )
33
34
message (
34
35
FATAL_ERROR
@@ -45,7 +46,6 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)
45
46
46
47
# ##################################################################################################
47
48
# * build options ---------------------------------------------------------------------------------
48
-
49
49
option (USE_NVTX "Build with NVTX support" ON )
50
50
option (BUILD_TESTS "Configure CMake to build tests" ON )
51
51
option (BUILD_BENCHMARKS "Configure CMake to build (google & nvbench) benchmarks" OFF )
@@ -63,6 +63,7 @@ option(
63
63
stream to external libraries."
64
64
OFF
65
65
)
66
+
66
67
# Option to add all symbols to the dynamic symbol table in the library file, allowing to retrieve
67
68
# human-readable stacktrace for debugging.
68
69
option (
@@ -71,19 +72,23 @@ option(
71
72
OFF
72
73
)
73
74
option (DISABLE_DEPRECATION_WARNINGS "Disable warnings generated from deprecated declarations." OFF )
75
+
74
76
# Option to enable line info in CUDA device compilation to allow introspection when profiling /
75
77
# memchecking
76
78
option (CUDA_ENABLE_LINEINFO
77
79
"Enable the -lineinfo option for nvcc (useful for cuda-memcheck / profiler)" OFF
78
80
)
79
81
option (CUDA_WARNINGS_AS_ERRORS "Enable -Werror=all-warnings for all CUDA compilation" ON )
82
+
80
83
# cudart can be statically linked or dynamically linked. The python ecosystem wants dynamic linking
81
84
option (CUDA_STATIC_RUNTIME "Statically link the CUDA runtime" OFF )
82
85
83
86
set (DEFAULT_CUDF_BUILD_STREAMS_TEST_UTIL ON )
87
+
84
88
if (CUDA_STATIC_RUNTIME OR NOT BUILD_SHARED_LIBS )
85
89
set (DEFAULT_CUDF_BUILD_STREAMS_TEST_UTIL OFF )
86
90
endif ()
91
+
87
92
option (
88
93
CUDF_BUILD_STREAMS_TEST_UTIL
89
94
"Whether to build the utilities for stream testing contained in libcudf"
@@ -127,6 +132,7 @@ message(VERBOSE
127
132
rapids_cmake_build_type ("Release" )
128
133
set (CUDF_BUILD_TESTS ${BUILD_TESTS} )
129
134
set (CUDF_BUILD_BENCHMARKS ${BUILD_BENCHMARKS} )
135
+
130
136
if (BUILD_TESTS AND NOT CUDF_BUILD_TESTUTIL )
131
137
message (
132
138
FATAL_ERROR
@@ -175,12 +181,14 @@ if(CUDF_CLANG_TIDY)
175
181
string (REGEX MATCH "LLVM version ([0-9]+\\ .[0-9]+)\\ .[0-9]+" LLVM_VERSION_MATCH
176
182
"${CLANG_TIDY_OUTPUT} "
177
183
)
184
+
178
185
# Discard the patch version and allow it to float. Empirically, results between patch versions are
179
186
# mostly stable, and looking at available packages on some package managers sometimes patch
180
187
# versions are skipped so we don't want to constrain to a patch version that the user can't
181
188
# install.
182
189
set (LLVM_VERSION "${CMAKE_MATCH_1} " )
183
190
set (expected_clang_tidy_version 19.1 )
191
+
184
192
if (NOT expected_clang_tidy_version VERSION_EQUAL LLVM_VERSION )
185
193
message (
186
194
FATAL_ERROR
@@ -216,6 +224,7 @@ function(enable_static_checkers target)
216
224
)
217
225
endif ()
218
226
endif ()
227
+
219
228
if (_LINT_IWYU )
220
229
# A few extra warnings pop up when building with IWYU. I'm not sure why, but they are not
221
230
# relevant since they don't show up in any other build so it's better to suppress them until we
@@ -226,16 +235,19 @@ function(enable_static_checkers target)
226
235
# on real builds.
227
236
foreach (_flag -Wno-missing-braces -Wno-unneeded-internal-declaration )
228
237
list (FIND CUDF_CXX_FLAGS "${_flag} " _flag_index )
238
+
229
239
if (_flag_index EQUAL -1 )
230
240
list (APPEND CUDF_CXX_FLAGS ${_flag} )
231
241
endif ()
232
242
endforeach ()
243
+
233
244
set (CUDF_CXX_FLAGS
234
245
"${CUDF_CXX_FLAGS} "
235
246
PARENT_SCOPE
236
247
)
237
248
set_target_properties (${target} PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${IWYU_EXE} " )
238
249
endif ()
250
+
239
251
foreach (file IN LISTS _LINT_SKIPPED_FILES )
240
252
set_source_files_properties (${file} PROPERTIES SKIP_LINTING ON )
241
253
endforeach ()
@@ -279,32 +291,45 @@ create_logger_macros(CUDF "cudf::default_logger()" include/cudf)
279
291
280
292
# find jitify
281
293
include (cmake/thirdparty/get_jitify.cmake )
294
+
282
295
# find NVTX
283
296
include (cmake/thirdparty/get_nvtx.cmake )
297
+
284
298
# find nvCOMP
285
299
include (cmake/thirdparty/get_nvcomp.cmake )
300
+
286
301
# find CCCL before rmm so that we get cudf's patched version of CCCL
287
302
include (cmake/thirdparty/get_cccl.cmake )
303
+
288
304
# find rmm
289
305
include (cmake/thirdparty/get_rmm.cmake )
306
+
290
307
# find flatbuffers
291
308
include (cmake/thirdparty/get_flatbuffers.cmake )
309
+
292
310
# find dlpack
293
311
include (cmake/thirdparty/get_dlpack.cmake )
312
+
294
313
# find cuCollections, should come after including CCCL
295
314
include (cmake/thirdparty/get_cucollections.cmake )
315
+
296
316
# find or install GoogleTest
297
317
if (CUDF_BUILD_TESTUTIL )
298
318
include (cmake/thirdparty/get_gtest.cmake )
299
319
endif ()
320
+
300
321
# preprocess jitify-able kernels
301
322
include (cmake/Modules/JitifyPreprocessKernels.cmake )
323
+
302
324
# find KvikIO
303
325
include (cmake/thirdparty/get_kvikio.cmake )
326
+
304
327
# find nanoarrow
305
328
include (cmake/thirdparty/get_nanoarrow.cmake )
329
+
306
330
# find thread_pool
307
331
include (cmake/thirdparty/get_thread_pool.cmake )
332
+
308
333
# find zstd
309
334
include (cmake/thirdparty/get_zstd.cmake )
310
335
@@ -327,7 +352,6 @@ endif()
327
352
328
353
# ##################################################################################################
329
354
# * library targets -------------------------------------------------------------------------------
330
-
331
355
add_library (
332
356
cudf
333
357
src/aggregation/aggregation.cpp
@@ -754,6 +778,7 @@ add_library(
754
778
src/table/table.cpp
755
779
src/table/table_device_view.cu
756
780
src/table/table_view.cpp
781
+ src/text/deduplicate.cu
757
782
src/text/detokenize.cu
758
783
src/text/edit_distance.cu
759
784
src/text/generate_ngrams.cu
@@ -857,16 +882,20 @@ set_target_properties(
857
882
# flags if necessary.
858
883
if (CUDF_CLANG_TIDY OR CUDF_IWYU )
859
884
set (linters )
885
+
860
886
if (CUDF_CLANG_TIDY )
861
887
list (APPEND linters CLANG_TIDY )
862
888
endif ()
889
+
863
890
if (CUDF_IWYU )
864
891
list (APPEND linters IWYU )
865
892
endif ()
893
+
866
894
enable_static_checkers (
867
895
cudf SKIPPED_FILES src/io/comp/cpu_unbz2.cpp src/io/comp/brotli_dict.cpp ${linters}
868
896
)
869
897
endif ()
898
+
870
899
target_compile_options (
871
900
cudf PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${CUDF_CXX_FLAGS} >"
872
901
"$<$<COMPILE_LANGUAGE:CUDA>:${CUDF_CUDA_FLAGS} >"
@@ -997,7 +1026,6 @@ add_library(cudf::cudf ALIAS cudf)
997
1026
998
1027
# ##################################################################################################
999
1028
# * build cudftestutil ----------------------------------------------------------------------------
1000
-
1001
1029
if (CUDF_BUILD_TESTUTIL )
1002
1030
add_library (
1003
1031
cudftest_default_stream
@@ -1096,11 +1124,9 @@ if(CUDF_BUILD_TESTUTIL)
1096
1124
tests/utilities/tdigest_utilities.cu
1097
1125
DESTINATION src/cudftestutil/utilities
1098
1126
)
1099
-
1100
1127
endif ()
1101
1128
1102
1129
# * build cudf_identify_stream_usage --------------------------------------------------------------
1103
-
1104
1130
if (CUDF_BUILD_STREAMS_TEST_UTIL )
1105
1131
if (CUDA_STATIC_RUNTIME )
1106
1132
message (
@@ -1117,6 +1143,7 @@ if(CUDF_BUILD_STREAMS_TEST_UTIL)
1117
1143
add_library (
1118
1144
${_tgt} SHARED src/utilities/stacktrace.cpp tests/utilities/identify_stream_usage.cpp
1119
1145
)
1146
+
1120
1147
if (CUDF_USE_PER_THREAD_DEFAULT_STREAM )
1121
1148
target_compile_definitions (
1122
1149
${_tgt} PUBLIC CUDA_API_PER_THREAD_DEFAULT_STREAM CUDF_USE_PER_THREAD_DEFAULT_STREAM
@@ -1135,9 +1162,11 @@ if(CUDF_BUILD_STREAMS_TEST_UTIL)
1135
1162
)
1136
1163
target_include_directories (${_tgt} PRIVATE "$<BUILD_INTERFACE:${CUDF_SOURCE_DIR} /include>" )
1137
1164
target_link_libraries (${_tgt} PUBLIC CUDA::cudart rmm::rmm )
1165
+
1138
1166
if (CUDF_BUILD_STACKTRACE_DEBUG )
1139
1167
target_link_libraries (${_tgt} PRIVATE cudf_backtrace )
1140
1168
endif ()
1169
+
1141
1170
rapids_cuda_set_runtime (${_tgt} USE_STATIC ${CUDA_STATIC_RUNTIME} )
1142
1171
add_library (cudf::${_tgt} ALIAS ${_tgt} )
1143
1172
@@ -1149,7 +1178,6 @@ endif()
1149
1178
1150
1179
# ##################################################################################################
1151
1180
# * add tests -------------------------------------------------------------------------------------
1152
-
1153
1181
if (CUDF_BUILD_TESTS )
1154
1182
# include CTest module -- automatically calls enable_testing()
1155
1183
include (CTest )
@@ -1167,7 +1195,6 @@ endif()
1167
1195
1168
1196
# ##################################################################################################
1169
1197
# * add benchmarks --------------------------------------------------------------------------------
1170
-
1171
1198
if (CUDF_BUILD_BENCHMARKS )
1172
1199
# Find or install GoogleBench
1173
1200
include (${rapids-cmake-dir}/cpm/gbench.cmake )
@@ -1198,6 +1225,7 @@ install(FILES ${CUDF_BINARY_DIR}/include/cudf/version_config.hpp
1198
1225
)
1199
1226
1200
1227
set (_components_export_string )
1228
+
1201
1229
if (TARGET cudftestutil )
1202
1230
install (
1203
1231
TARGETS cudftest_default_stream cudftestutil cudftestutil_impl
0 commit comments