-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathCMakeLists.txt
86 lines (64 loc) · 3.1 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
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
cmake_minimum_required(VERSION 3.2)
# No in-source build
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
message(FATAL_ERROR "In-source builds are not allowed.")
endif("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
project(vegito)
ADD_DEFINITIONS( -std=c++14 -Wno-register -Wno-placement-new)
set(CMAKE_CXX_COMPILER g++-8)
#find_library(jemalloc_lib NAMES jemalloc PATHS ./deps/jemalloc PATH_SUFFIXES lib
# NO_DEFAULT_PATH)
#if(NOT jemalloc_lib)
# set(jemalloc_lib "")
#endif()
include_directories(./src)
include_directories(third_party/rdma_lib/include)
## seperate install
set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY true)
## without benchmark profiling
# set (MACRO_FLAGS "-DBASE_LINE")
set (MACRO_FLAGS "")
## currently drtm in this codebase is not supported, i will fix this later
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DLEVELDB_PLATFORM_POSIX -pthread -DOS_LINUX -mrtm -pthread -O2 -g3 ${MACRO_FLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DLEVELDB_PLATFORM_POSIX -pthread -DOS_LINUX -mrtm -pthread -O0 -g2 ${MACRO_FLAGS}")
## TODO, we shall replace it with a pre-complied lib, but since now the lib is not stable, so we just add sources here
file(GLOB RDMA_SOURCES "third_party/rdma_lib/src/*.cc")
## add main files
file(GLOB SOURCES
"src/framework/*.cc" "src/framework/utils/*.cc" # framework
"src/memstore/*.cc" # memstore
"src/backup_store/*.cc" # backup_store
"src/db/*.cc" "src/db/txs/dbtx*.cc" "src/db/txs/log_ts_manager.cc" # framework + CC
"src/util/*.cc" "src/port/*.cc" # utils
)
# ch
file(GLOB CH_SOURCES
"src/app/ch/*.cc" # htap app
"src/app/ch/ch_query/*.cc" # htap app query part
"src/app/ch/micro_query/*.cc" # htap app micro query part
)
# micro index
file (GLOB MICRO_INDEX_SOURCES
"src/app/micro_index/*.cc"
)
file (GLOB SSMALLOC_SOURCES
"third_party/rdma_lib/ralloc/*.c"
)
# ch
add_executable(vegito
${SOURCES}
${CH_SOURCES}
${MICRO_INDEX_SOURCES}
${RDMA_SOURCES}
${SSMALLOC_SOURCES}
)
#target_compile_options(vegito PRIVATE "-DOCC_TX" "-DEPOCH_BLOCK=1")
target_compile_options(vegito PRIVATE "-DOCC_TX")
target_link_libraries(vegito ibverbs boost_system boost_coroutine)
# for the ease of running
set(CMAKE_INSTALL_PREFIX ./)
install(TARGETS vegito DESTINATION .)
# copy
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/run.sh" DESTINATION ${CMAKE_BINARY_DIR})
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/scripts/run2.py" DESTINATION ${CMAKE_BINARY_DIR}/scripts)
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/scripts/run_util.py" DESTINATION ${CMAKE_BINARY_DIR}/scripts)