This repository was archived by the owner on May 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
209 lines (179 loc) · 6.45 KB
/
Copy pathCMakeLists.txt
File metadata and controls
209 lines (179 loc) · 6.45 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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# Copyright(c) 2022-2023 Intel Corporation.
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
cmake_minimum_required(VERSION 3.16)
message(STATUS "Building using CMake version: ${CMAKE_VERSION}")
find_program(CCACHE "sccache")
if(CCACHE)
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE})
set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE})
endif(CCACHE)
set(BDTK_VERSION "0.9.0")
string(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" BDTK_BASE_VERSION
"${BDTK_VERSION}")
# if no build build type is specified, default to release builds
if(NOT DEFINED CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE
Release
CACHE STRING "Choose the type of build.")
endif()
project(BDTK VERSION "${BDTK_BASE_VERSION}")
set(BDTK_VERSION_MAJOR "${BDTK_VERSION_MAJOR}")
set(BDTK_VERSION_MINOR "${BDTK_VERSION_MINOR}")
set(BDTK_VERSION_PATCH "${BDTK_VERSION_PATCH}")
set(BDTK_SO_VERSION "${BDTK_VERSION_MAJOR}")
set(BDTK_FULL_SO_VERSION
"${BDTK_SO_VERSION}.${BDTK_VERSION_MINOR}.${BDTK_VERSION_PATCH}")
message(
STATUS "BDTK version: "
"${BDTK_VERSION_MAJOR}.${BDTK_VERSION_MINOR}.${BDTK_VERSION_PATCH} "
"(full: '${BDTK_VERSION}')")
message(
STATUS "BDTK SO version: ${BDTK_SO_VERSION} (full: ${BDTK_FULL_SO_VERSION})")
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules")
option(BDTK_ENABLE_ICL "Build ICL compression library for BDTK" OFF)
option(ICL_WITH_QPL "Build ICL with QPL codec" OFF)
option(ICL_WITH_QAT "Build ICL with QAT codec" OFF)
option(ICL_WITH_IGZIP "Build ICL with IGZIP codec" ON)
option(ICL_BUILD_TESTS "Build the ICL googletest unit tests" ON)
option(ICL_BUILD_BENCHMARKS "Build the ICL micro benchmarks" ON)
option(BDTK_ENABLE_CIDER "Build Cider library for BDTK" ON)
option(CIDER_ENABLE_TESTS "Build unit tests" ON)
option(CIDER_ENABLE_GOOGLETEST "Build GoogleTest for Cider." ON)
option(CIDER_ENABLE_DUCKDB "Build DuckDB for Cider." ON)
option(CIDER_ENABLE_VELOX "Build Velox Plugin for Cider." ON)
option(CIDER_ENABLE_SUBSTRAIT "Build Substrait for Cider." ON)
option(CIDER_ENABLE_BENCHMARK "Build benchmark for Cider." OFF)
option(CIDER_ENABLE_AVX512 "Enable avx512 instructions." OFF)
if(BDTK_ENABLE_CIDER)
include_directories(${PROJECT_BINARY_DIR})
if(CIDER_ENABLE_VELOX)
# Disable components when enable velox build
set(CIDER_ENABLE_GOOGLETEST OFF)
set(CIDER_ENABLE_DUCKDB OFF)
set(CIDER_ENABLE_SUBSTRAIT OFF)
endif()
if(CIDER_ENABLE_GOOGLETEST)
# googletest
add_subdirectory(thirdparty/googletest)
include_directories(thirdparty/googletest/googletest/include)
else()
include_directories(
thirdparty/velox/third_party/googletest/googletest/include)
endif()
if(CIDER_ENABLE_BENCHMARK OR ENABLE_BENCHMARK)
set(CMAKE_CXX_FLAGS "-g -ggdb -fno-omit-frame-pointer")
endif()
if(ENABLE_BENCHMARK)
set(VELOX_ENABLE_TPCH_CONNECTOR ON)
endif()
if(CIDER_ENABLE_BENCHMARK)
set(BENCHMARK_ENABLE_INSTALL OFF)
set(BENCHMARK_ENABLE_TESTING OFF)
add_subdirectory(thirdparty/benchmark)
include_directories(thirdparty/benchmark/include)
endif()
if(CIDER_ENABLE_DUCKDB)
add_subdirectory(thirdparty/duckdb-amalgamation)
include_directories(${CMAKE_BINARY_DIR}/thirdparty/duckdb-amalgamation)
else()
include_directories(thirdparty/velox/velox/external/duckdb)
endif()
if(CIDER_ENABLE_SUBSTRAIT)
set(SUBSTRAIT_ROOT ${CMAKE_SOURCE_DIR}/thirdparty/substrait/proto)
else()
set(SUBSTRAIT_ROOT
${CMAKE_SOURCE_DIR}/thirdparty/velox/velox/substrait/proto)
endif()
# robin-hood-hashing
include_directories(thirdparty/robin-hood-hashing/src/include)
# substrait
include(substrait)
include(substrait-cpp)
if(CIDER_ENABLE_VELOX)
add_subdirectory(thirdparty/velox)
endif()
include(BuildUtils)
set(CIDER_DEPENDENCIES_LIBS)
list(APPEND CIDER_DEPENDENCIES_LIBS substrait)
list(APPEND CIDER_DEPENDENCIES_LIBS SubstraitCpp::function SubstraitCpp::type
SubstraitCpp::common)
list(APPEND CIDER_DEPENDENCIES_LIBS yaml-cpp)
list(
APPEND
CIDER_DEPENDENCIES_LIBS
cider_util
cider_processor
cider_plan
jitlib
nextgen
QueryEngine
cider_hashtable_join
cider_module)
set(BUILD_OUTPUT_ROOT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
icl_car(_FIRST_LIB ${CIDER_DEPENDENCIES_LIBS})
icl_cdr(_OTHER_LIBS ${CIDER_DEPENDENCIES_LIBS})
create_merged_static_lib(
cider_static
NAME
cider_static
ROOT
${_FIRST_LIB}
TO_MERGE
${_OTHER_LIBS})
set(CIDER_VELOX_DEPENDENCIES_LIBS)
list(APPEND CIDER_VELOX_DEPENDENCIES_LIBS velox_plugin)
list(APPEND CIDER_VELOX_DEPENDENCIES_LIBS velox_substrait_convertor
velox_plan_transformer cider_plan_transformer)
set(BUILD_OUTPUT_ROOT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
icl_car(_FIRST_LIB ${CIDER_VELOX_DEPENDENCIES_LIBS})
icl_cdr(_OTHER_LIBS ${CIDER_VELOX_DEPENDENCIES_LIBS})
create_merged_static_lib(
cider_velox_static
NAME
cider_velox_static
ROOT
${_FIRST_LIB}
TO_MERGE
${_OTHER_LIBS})
include_directories(src/cider)
include_directories(src/cider/include)
add_subdirectory(src/cider)
if(CIDER_ENABLE_VELOX)
add_subdirectory(src/cider-velox)
endif()
endif()
if(BDTK_ENABLE_ICL)
if(NOT BDTK_ENABLE_CIDER)
if(ICL_BUILD_TESTS)
add_subdirectory(thirdparty/googletest)
include_directories(thirdparty/googletest/googletest/include)
endif()
if(ICL_BUILD_BENCHMARKS)
set(BENCHMARK_ENABLE_INSTALL OFF)
set(BENCHMARK_ENABLE_TESTING OFF)
add_subdirectory(thirdparty/benchmark)
include_directories(thirdparty/benchmark/include)
include_directories(thirdparty/googletest/googlemock/include)
endif()
endif()
add_subdirectory(src/compression)
endif()