forked from ifilippov/nyc_taxi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
43 lines (35 loc) · 2.33 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR)
project(bench CXX)
find_package(arrow REQUIRED arrow_shared)
find_package(TBB REQUIRED tbb tbbmalloc tbbmalloc_proxy)
file(READ /proc/sys/vm/nr_hugepages HPAGES)
if((NOT HPAGES GREATER 0) AND NOT BENCH_NO_HUGEPAGES)
message( FATAL_ERROR "\
Huge pages are not configured. Run `sudo bash -c 'echo 30000 > /proc/sys/vm/nr_hugepages'`\n\
You can disable this warning by setting BENCH_NO_HUGEPAGES but performance will be worse and blocksize will need tuning for the (second) best performance" )
endif()
link_directories(${CONDA_PREFIX}/lib)
add_executable(bench_csv_arrow benchmark.cpp)
target_compile_features(bench_csv_arrow PRIVATE cxx_std_17)
target_compile_definitions(bench_csv_arrow PRIVATE BENCH_CSV_ONLY)
target_include_directories(bench_csv_arrow PRIVATE . ${CMAKE_INSTALL_PREFIX}/include)
target_link_libraries(bench_csv_arrow arrow_shared TBB::tbb
${arrow_IMPORTED_TARGETS} ${CMAKE_DL_LIBS}) # Link "rt" library on Linux
add_executable(bench_csv_tbbmalloc benchmark.cpp)
target_compile_features(bench_csv_tbbmalloc PRIVATE cxx_std_17)
target_compile_definitions(bench_csv_tbbmalloc PRIVATE BENCH_CSV_ONLY)
target_include_directories(bench_csv_tbbmalloc PRIVATE . ${CMAKE_INSTALL_PREFIX}/include)
target_link_libraries(bench_csv_tbbmalloc arrow_shared TBB::tbb TBB::tbbmalloc_proxy
${arrow_IMPORTED_TARGETS} ${CMAKE_DL_LIBS}) # Link "rt" library on Linux
add_executable(bench_csv_tbbmalloc_huge benchmark.cpp)
target_compile_features(bench_csv_tbbmalloc_huge PRIVATE cxx_std_17)
target_compile_definitions(bench_csv_tbbmalloc_huge PRIVATE BENCH_CSV_ONLY BENCH_USE_TBB_HUGE_PAGES)
target_include_directories(bench_csv_tbbmalloc_huge PRIVATE . ${CMAKE_INSTALL_PREFIX}/include)
target_link_libraries(bench_csv_tbbmalloc_huge arrow_shared ${TBB_IMPORTED_TARGETS}
${arrow_IMPORTED_TARGETS} ${CMAKE_DL_LIBS}) # Link "rt" library on Linux
add_executable(bench_all benchmark.cpp)
target_compile_features(bench_all PRIVATE cxx_std_17)
target_compile_definitions(bench_all PRIVATE BENCH_USE_TBB_HUGE_PAGES)
target_include_directories(bench_all PRIVATE . ${CMAKE_INSTALL_PREFIX}/include)
target_link_libraries(bench_all arrow_shared ${TBB_IMPORTED_TARGETS}
${arrow_IMPORTED_TARGETS} ${CMAKE_DL_LIBS}) # Link "rt" library on Linux