forked from yliu634/smash
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
165 lines (146 loc) · 5.69 KB
/
CMakeLists.txt
File metadata and controls
165 lines (146 loc) · 5.69 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
cmake_minimum_required(VERSION 3.5)
project(Smash)
# curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
# sudo apt-get install google-perftools libgoogle-perftools-dev cmake build-essential gdb libssl-dev pkgconf tmux clang liblua5.3-dev libboost-all-dev
# cd ~/Smash ; mkdir release ; cd release ; cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -G "CodeBlocks - Unix Makefiles" .. ; make -j8
# cd ~/Smash ; mkdir debug ; cd debug ; cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -G "CodeBlocks - Unix Makefiles" .. ; make -j8
link_directories(/usr/local/lib)
set(CMAKE_C_COMPILER "/usr/bin/clang")
set(CMAKE_CXX_COMPILER "/usr/bin/clang++")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -mavx -maes")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native -mavx -maes")
IF ((CMAKE_BUILD_TYPE MATCHES Debug) OR (CMAKE_BUILD_TYPE MATCHES RelWithDebInfo))
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DPROFILE ")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DPROFILE ")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb ")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ggdb ")
ENDIF ((CMAKE_BUILD_TYPE MATCHES Debug) OR (CMAKE_BUILD_TYPE MATCHES RelWithDebInfo))
IF ((CMAKE_BUILD_TYPE MATCHES Debug))
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_DEBUG")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DFULL_DEBUG")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-no-as-needed -ggdb -O0")
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DFULL_DEBUG")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-no-as-needed -ggdb -O0")
ENDIF ((CMAKE_BUILD_TYPE MATCHES Debug))
IF ((CMAKE_BUILD_TYPE MATCHES Release) OR (CMAKE_BUILD_TYPE MATCHES RelWithDebInfo))
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Ofast -DNDEBUG")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Ofast -DNDEBUG")
ENDIF ((CMAKE_BUILD_TYPE MATCHES Release) OR (CMAKE_BUILD_TYPE MATCHES RelWithDebInfo))
include_directories(
${Boost_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
)
set(COMMON_SOURCE_FILES
common.cpp
utils/farmhash/farmhash.cc
utils/ClientSock.cpp
utils/hashutil.cc
input/input_types.cpp
ycsb_workload.h
)
set(HEADER_FILES
common.h
ceph.h
utils/hash.h
utils/farmhash/farmhash.h
utils/hashutil.h
utils/lfsr64.h
utils/disjointset.h
utils/ClientSock.h
utils/json.hpp
utils/debugbreak.h
utils/fibonacci_queue.h
input/input_types.h
BloomFilter/bloom_filter.h
Othello/othello_cp_dp.h
CuckooPresized/cuckoo_cp_dp.h
CuckooPresized/cuckoo_ht.h
VacuumFilter/vacuum_filter.h
VacuumFilter/better_table.h
Ludo/ludo_cp_dp.h
Smash/storage_node.h
Smash/lookup_fn.h
Smash/client.h
Smash/master_fn.h
Smash/node.h
Smash/adapters.h
Smash/socket_node.h
utils/CompactArray.h
VacuumFilter/cuckoo_filter.h
Smash/name_server.h
utils/fibonacci_queue.h
Smash/commander.h)
#add_executable(validity
# ${HEADER_FILES}
# ${COMMON_SOURCE_FILES}
# validity.cpp)
add_executable(function
${HEADER_FILES}
${COMMON_SOURCE_FILES}
Smash/node.cpp
simulations.cpp)
#add_executable(sideExperiments
# ${HEADER_FILES}
# ${COMMON_SOURCE_FILES}
# sideExperiments.cpp)
#add_executable(testSocket
# common.h
# utils/hash.h
# utils/farmhash/farmhash.h
# utils/hashutil.h
# utils/lfsr64.h
# utils/disjointset.h
# utils/ClientSock.h
# utils/json.hpp
# utils/debugbreak.h
# input/input_types.h
# common.cpp
# utils/farmhash/farmhash.cc
# utils/ClientSock.cpp
# utils/hashutil.cc
# input/input_types.cpp
# testSocket.cpp)
IF (APPLE)
set(CMAKE_THREAD_LIBS_INIT "-lpthread")
set(CMAKE_HAVE_THREADS_LIBRARY 1)
set(CMAKE_USE_WIN32_THREADS_INIT 0)
set(CMAKE_USE_PTHREADS_INIT 1)
set(THREADS_PREFER_PTHREAD_FLAG ON)
ELSE ()
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
# target_link_libraries(validity LINK_PUBLIC Threads::Threads)
target_link_libraries(function LINK_PUBLIC Threads::Threads)
# target_link_libraries(ycsb LINK_PUBLIC Threads::Threads)
# target_link_libraries(sideExperiments LINK_PUBLIC Threads::Threads)
# target_link_libraries(testSocket LINK_PUBLIC Threads::Threads)
ENDIF ()
set(Gperftools_DIR "${CMAKE_CURRENT_LIST_DIR}/cmake/")
find_package(Gperftools REQUIRED)
#target_link_libraries(validity LINK_PUBLIC ${GPERFTOOLS_PROFILER})
target_link_libraries(function LINK_PUBLIC ${GPERFTOOLS_PROFILER})
#target_link_libraries(ycsb LINK_PUBLIC ${GPERFTOOLS_PROFILER})
#target_link_libraries(sideExperiments LINK_PUBLIC ${GPERFTOOLS_PROFILER})
#target_link_libraries(testSocket LINK_PUBLIC ${GPERFTOOLS_PROFILER})
#target_link_libraries(validity LINK_PUBLIC ${Rados_LIBRARIES})
target_link_libraries(function LINK_PUBLIC stdc++fs)
target_link_libraries(function LINK_PUBLIC rados)
target_link_libraries(function LINK_PUBLIC boost_system)
target_link_libraries(function LINK_PUBLIC dl)
#target_link_libraries(ycsb LINK_PUBLIC rados)
#target_link_libraries(sideExperiments LINK_PUBLIC ${Rados_LIBRARIES})
#target_link_libraries(testSocket LINK_PUBLIC ${Rados_LIBRARIES})
find_package(PkgConfig REQUIRED)
pkg_search_module(OPENSSL REQUIRED openssl)
#target_link_libraries(validity LINK_PUBLIC ${OPENSSL_LIBRARIES})
target_link_libraries(function LINK_PUBLIC ${OPENSSL_LIBRARIES})
#target_link_libraries(ycsb LINK_PUBLIC ${OPENSSL_LIBRARIES})
#target_link_libraries(sideExperiments LINK_PUBLIC ${OPENSSL_LIBRARIES})
#target_link_libraries(testSocket LINK_PUBLIC ${OPENSSL_LIBRARIES})
find_package(Boost COMPONENTS REQUIRED)
#target_link_libraries(validity LINK_PUBLIC ${Boost_LIBRARIES})
target_link_libraries(function LINK_PUBLIC ${Boost_LIBRARIES})
#target_link_libraries(ycsb LINK_PUBLIC ${Boost_LIBRARIES})
#target_link_libraries(sideExperiments LINK_PUBLIC ${Boost_LIBRARIES})
#target_link_libraries(testSocket LINK_PUBLIC ${Boost_LIBRARIES})