-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathCMakeLists.txt
140 lines (107 loc) · 3.37 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
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
cmake_minimum_required(VERSION 3.10)
project(SOSD)
if(UNIX AND NOT APPLE)
set(LINUX TRUE)
endif()
option(USER "Enable USER macro" OFF)
option(META "Enable META macro" OFF)
option(PERF "Enable PERF macro" OFF)
option(SPEEDUP "Enable SPEEDUP macro" OFF)
option(DESIGNSPACE "Enable DESIGNSPACE macro" OFF)
option(PARETO_AVG "Enable PARETO_AVG macro" OFF)
option(PARETO_AVG_STACK "Enable PARETO_AVG_STACK macro" OFF)
option(PARETO_AVG_COVID "Enable PARETO_AVG_COVID macro" OFF)
option(PARETO_AVG_HISTORY "Enable PARETO_AVG_HISTORY macro" OFF)
option(PARETO_AVG_BOOKS "Enable PARETO_AVG_BOOKS macro" OFF)
option(PARETO_AVG_OSM "Enable PARETO_AVG_OSM macro" OFF)
option(PARETO_AVG_GENOME "Enable PARETO_AVG_GENOME macro" OFF)
option(PARETO_TAIL "Enable PARETO_TAIL macro" OFF)
option(PARETO_TAIL_STACK "Enable PARETO_TAIL_STACK macro" OFF)
option(PARETO_TAIL_COVID "Enable PARETO_TAIL_COVID macro" OFF)
option(PARETO_TAIL_HISTORY "Enable PARETO_TAIL_HISTORY macro" OFF)
option(PARETO_TAIL_BOOKS "Enable PARETO_TAIL_BOOKS macro" OFF)
option(PARETO_TAIL_OSM "Enable PARETO_TAIL_OSM macro" OFF)
option(PARETO_TAIL_GENOME "Enable PARETO_TAIL_GENOME macro" OFF)
if(USER)
add_compile_definitions(USER)
endif()
if(META)
add_compile_definitions(META)
endif()
if(PERF)
add_compile_definitions(PERF)
endif()
if(SPEEDUP)
add_compile_definitions(SPEEDUP)
endif()
if(DESIGNSPACE)
add_compile_definitions(DESIGNSPACE)
endif()
if(PARETO_AVG)
add_compile_definitions(PARETO_AVG)
endif()
if(PARETO_AVG_STACK)
add_compile_definitions(PARETO_AVG_STACK)
endif()
if(PARETO_AVG_COVID)
add_compile_definitions(PARETO_AVG_COVID)
endif()
if(PARETO_AVG_HISTORY)
add_compile_definitions(PARETO_AVG_HISTORY)
endif()
if(PARETO_AVG_BOOKS)
add_compile_definitions(PARETO_AVG_BOOKS)
endif()
if(PARETO_AVG_OSM)
add_compile_definitions(PARETO_AVG_OSM)
endif()
if(PARETO_AVG_GENOME)
add_compile_definitions(PARETO_AVG_GENOME)
endif()
if(PARETO_TAIL)
add_compile_definitions(PARETO_TAIL)
endif()
if(PARETO_TAIL_STACK)
add_compile_definitions(PARETO_TAIL_STACK)
endif()
if(PARETO_TAIL_COVID)
add_compile_definitions(PARETO_TAIL_COVID)
endif()
if(PARETO_TAIL_HISTORY)
add_compile_definitions(PARETO_TAIL_HISTORY)
endif()
if(PARETO_TAIL_BOOKS)
add_compile_definitions(PARETO_TAIL_BOOKS)
endif()
if(PARETO_TAIL_OSM)
add_compile_definitions(PARETO_TAIL_OSM)
endif()
if(PARETO_TAIL_GENOME)
add_compile_definitions(PARETO_TAIL_GENOME)
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffast-math -Wall -Wfatal-errors -march=native")
# Enable OpenMP if available
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag(-fopenmp HAS_OPENMP)
if (HAS_OPENMP)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
endif()
set(CMAKE_CXX_STANDARD 17)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
add_subdirectory(dtl)
set(SOURCE_FILES util.h)
file(GLOB_RECURSE BENCH_SOURCES "benchmarks/*.h")
add_executable(generate generate.cc ${SOURCE_FILES})
target_link_libraries(generate Threads::Threads)
add_executable(benchmark benchmark.cc ${SOURCE_FILES})
target_include_directories(benchmark
PRIVATE "indexes/srs/include"
PRIVATE "indexes/sPGM-index/include"
PRIVATE "indexes/sCHT/include"
PRIVATE "indexes/anaylsis-srmi/include"
PRIVATE "indexes/stx-btree-0.9/include"
pgmindexlib)
target_link_libraries(benchmark
PRIVATE Threads::Threads dtl
PRIVATE dl)