@@ -249,6 +249,20 @@ if(WITH_UBSAN)
249
249
endif ()
250
250
endif ()
251
251
252
+ find_package (NUMA )
253
+ if (NUMA_FOUND )
254
+ add_definitions (-DNUMA )
255
+ include_directories (${NUMA_INCLUDE_DIR} )
256
+ list (APPEND THIRDPARTY_LIBS ${NUMA_LIBRARIES} )
257
+ endif ()
258
+
259
+ find_package (TBB )
260
+ if (TBB_FOUND )
261
+ add_definitions (-DTBB )
262
+ include_directories (${TBB_INCLUDE_DIR} )
263
+ list (APPEND THIRDPARTY_LIBS ${TBB_LIBRARIES} )
264
+ endif ()
265
+
252
266
# Used to run CI build and tests so we can run faster
253
267
set (OPTIMIZE_DEBUG_DEFAULT 0 ) # Debug build is unoptimized by default use -DOPTDBG=1 to optimize
254
268
@@ -316,11 +330,8 @@ if(NOT WIN32)
316
330
endif ()
317
331
318
332
option (WITH_FALLOCATE "build with fallocate" ON )
319
-
320
333
if (WITH_FALLOCATE )
321
- set (CMAKE_REQUIRED_FLAGS ${CMAKE_C_FLAGS} )
322
- include (CheckCSourceCompiles )
323
- CHECK_C_SOURCE_COMPILES ("
334
+ CHECK_CXX_SOURCE_COMPILES ("
324
335
#include <fcntl.h>
325
336
#include <linux/falloc.h>
326
337
int main() {
@@ -333,12 +344,38 @@ int main() {
333
344
endif ()
334
345
endif ()
335
346
336
- include (CheckFunctionExists )
337
- CHECK_FUNCTION_EXISTS (malloc_usable_size HAVE_MALLOC_USABLE_SIZE )
347
+ CHECK_CXX_SOURCE_COMPILES ("
348
+ #include <fcntl.h>
349
+ int main() {
350
+ int fd = open(\" /dev/null\" , 0);
351
+ sync_file_range(fd, 0, 1024, SYNC_FILE_RANGE_WRITE);
352
+ }
353
+ " HAVE_SYNC_FILE_RANGE_WRITE )
354
+ if (HAVE_SYNC_FILE_RANGE_WRITE )
355
+ add_definitions (-DROCKSDB_RANGESYNC_PRESENT )
356
+ endif ()
357
+
358
+ CHECK_CXX_SOURCE_COMPILES ("
359
+ #include <pthread.h>
360
+ int main() {
361
+ (void) PTHREAD_MUTEX_ADAPTIVE_NP;
362
+ }
363
+ " HAVE_PTHREAD_MUTEX_ADAPTIVE_NP )
364
+ if (HAVE_PTHREAD_MUTEX_ADAPTIVE_NP )
365
+ add_definitions (-DROCKSDB_PTHREAD_ADAPTIVE_MUTEX )
366
+ endif ()
367
+
368
+ include (CheckCXXSymbolExists )
369
+ check_cxx_symbol_exists (malloc_usable_size malloc.h HAVE_MALLOC_USABLE_SIZE )
338
370
if (HAVE_MALLOC_USABLE_SIZE )
339
371
add_definitions (-DROCKSDB_MALLOC_USABLE_SIZE )
340
372
endif ()
341
373
374
+ check_cxx_symbol_exists (sched_getcpu sched.h HAVE_SCHED_GETCPU )
375
+ if (HAVE_SCHED_GETCPU )
376
+ add_definitions (-DROCKSDB_SCHED_GETCPU_PRESENT )
377
+ endif ()
378
+
342
379
include_directories (${PROJECT_SOURCE_DIR} )
343
380
include_directories (${PROJECT_SOURCE_DIR} /include )
344
381
include_directories (SYSTEM ${PROJECT_SOURCE_DIR} /third-party/gtest-1.7.0/fused-src )
0 commit comments