Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions CMake/resolve_dependency_modules/antlr4-runtime.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright (c) Facebook, Inc. and its affiliates.
#
# Licensed 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.
include_guard(GLOBAL)

set(VELOX_ANTLR4_RUNTIME_VERSION 4.13.2)
set(VELOX_ANTLR4_RUNTIME_BUILD_SHA256_CHECKSUM
9f18272a9b32b622835a3365f850dd1063d60f5045fb1e12ce475ae6e18a35bb)
set(VELOX_ANTLR4_RUNTIME_SOURCE_URL
"https://github.com/antlr/antlr4/archive/refs/tags/${VELOX_ANTLR4_RUNTIME_VERSION}.tar.gz"
)

velox_resolve_dependency_url(ANTLR4_RUNTIME)

message(STATUS "Building antlr4-runtime from source")

FetchContent_Declare(
antlr4-runtime
URL ${VELOX_ANTLR4_RUNTIME_SOURCE_URL}
URL_HASH ${VELOX_ANTLR4_RUNTIME_BUILD_SHA256_CHECKSUM}
SOURCE_SUBDIR runtime/Cpp OVERRIDE_FIND_PACKAGE)

set(ANTLR4_INSTALL
ON
CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(antlr4-runtime)
44 changes: 44 additions & 0 deletions CMake/resolve_dependency_modules/clp.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Copyright (c) Facebook, Inc. and its affiliates.
#
# Licensed 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.
include_guard(GLOBAL)

FetchContent_Declare(
clp
GIT_REPOSITORY https://github.com/y-scope/clp.git
GIT_TAG 0798100389bd5231b520ec48ab186275795e3790)

set(CLP_BUILD_CLP_REGEX_UTILS
OFF
CACHE BOOL "Build CLP regex utils")
set(CLP_BUILD_CLP_S_JSONCONSTRUCTOR
OFF
CACHE BOOL "Build CLP-S JSON constructor")
set(CLP_BUILD_CLP_S_REDUCER_DEPENDENCIES
OFF
CACHE BOOL "Build CLP-S reducer dependencies")
set(CLP_BUILD_CLP_S_SEARCH_SQL
OFF
CACHE BOOL "Build CLP-S search SQL")
set(CLP_BUILD_EXECUTABLES
OFF
CACHE BOOL "Build CLP executables")
set(CLP_BUILD_TESTING
OFF
CACHE BOOL "Build CLP tests")

FetchContent_Populate(clp)

list(APPEND CMAKE_MODULE_PATH "${clp_SOURCE_DIR}/components/core/cmake/Modules")
add_subdirectory(${clp_SOURCE_DIR}/components/core
${clp_BINARY_DIR}/components/core)
38 changes: 38 additions & 0 deletions CMake/resolve_dependency_modules/date.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright (c) Facebook, Inc. and its affiliates.
#
# Licensed 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.
include_guard(GLOBAL)

set(VELOX_DATE_BUILD_VERSION 3.0.1)
set(VELOX_DATE_BUILD_SHA256_CHECKSUM
7a390f200f0ccd207e8cff6757e04817c1a0aec3e327b006b7eb451c57ee3538)
set(VELOX_DATE_SOURCE_URL
"https://github.com/HowardHinnant/date/archive/refs/tags/v${VELOX_DATE_BUILD_VERSION}.tar.gz"
)

velox_resolve_dependency_url(DATE)

# Optionally set CMake variables *before* make-available
set(CMAKE_INSTALL_MESSAGE
LAZY
CACHE STRING "" FORCE)

message(STATUS "Building date from source")

FetchContent_Declare(
date
URL ${VELOX_DATE_SOURCE_URL}
URL_HASH ${VELOX_DATE_BUILD_SHA256_CHECKSUM}
OVERRIDE_FIND_PACKAGE)

FetchContent_MakeAvailable(date)
35 changes: 35 additions & 0 deletions CMake/resolve_dependency_modules/msgpack-cxx.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright (c) Facebook, Inc. and its affiliates.
#
# Licensed 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.
include_guard(GLOBAL)

set(VELOX_MSGPACK_BUILD_VERSION cpp-7.0.0)
set(VELOX_MSGPACK_BUILD_SHA256_CHECKSUM
070881ebea9208cf7e731fd5a46a11404025b2f260ab9527e32dfcb7c689fbfc)
set(VELOX_MSGPACK_SOURCE_URL
"https://github.com/msgpack/msgpack-c/archive/refs/tags/${VELOX_MSGPACK_BUILD_VERSION}.tar.gz"
)

velox_resolve_dependency_url(MSGPACK)

message(STATUS "Building msgpack-cxx from source")

FetchContent_Declare(
msgpack-cxx
URL ${VELOX_MSGPACK_SOURCE_URL}
URL_HASH ${VELOX_MSGPACK_BUILD_SHA256_CHECKSUM}
OVERRIDE_FIND_PACKAGE EXCLUDE_FROM_ALL SYSTEM)

set(MSGPACK_USE_BOOST OFF)

FetchContent_MakeAvailable(msgpack-cxx)
37 changes: 37 additions & 0 deletions CMake/resolve_dependency_modules/nlohmann_json.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright (c) Facebook, Inc. and its affiliates.
#
# Licensed 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.
include_guard(GLOBAL)

set(VELOX_NLOHMANN_JSON_BUILD_VERSION 3.11.3)
set(VELOX_NLOHMANN_JSON_BUILD_SHA256_CHECKSUM
0d8ef5af7f9794e3263480193c491549b2ba6cc74bb018906202ada498a79406)
set(VELOX_NLOHMANN_JSON_SOURCE_URL
"https://github.com/nlohmann/json/archive/refs/tags/v${VELOX_NLOHMANN_JSON_BUILD_VERSION}.tar.gz"
)

velox_resolve_dependency_url(NLOHMANN_JSON)

message(STATUS "Building nlohmann_json from source")

FetchContent_Declare(
nlohmann_json
URL ${VELOX_NLOHMANN_JSON_SOURCE_URL}
URL_HASH ${VELOX_NLOHMANN_JSON_BUILD_SHA256_CHECKSUM}
OVERRIDE_FIND_PACKAGE)

set(JSON_BuildTests
OFF
CACHE INTERNAL "")

FetchContent_MakeAvailable(nlohmann_json)
3 changes: 2 additions & 1 deletion CMake/resolve_dependency_modules/simdjson.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ message(STATUS "Building simdjson from source")
FetchContent_Declare(
simdjson
URL ${VELOX_SIMDJSON_SOURCE_URL}
URL_HASH ${VELOX_SIMDJSON_BUILD_SHA256_CHECKSUM})
URL_HASH ${VELOX_SIMDJSON_BUILD_SHA256_CHECKSUM}
OVERRIDE_FIND_PACKAGE)

if(${VELOX_SIMDJSON_SKIPUTF8VALIDATION})
set(SIMDJSON_SKIPUTF8VALIDATION ON)
Expand Down
34 changes: 34 additions & 0 deletions CMake/resolve_dependency_modules/spdlog.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright (c) Facebook, Inc. and its affiliates.
#
# Licensed 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.
include_guard(GLOBAL)

set(VELOX_SPDLOG_BUILD_VERSION 1.12.0)
set(VELOX_SPDLOG_BUILD_SHA256_CHECKSUM
4dccf2d10f410c1e2feaff89966bfc49a1abb29ef6f08246335b110e001e09a9)
set(VELOX_SPDLOG_SOURCE_URL
"https://github.com/gabime/spdlog/archive/refs/tags/v${VELOX_SPDLOG_BUILD_VERSION}.tar.gz"
)

velox_resolve_dependency_url(SPDLOG)

message(STATUS "Building spdlog from source")

FetchContent_Declare(
spdlog
URL ${VELOX_SPDLOG_SOURCE_URL}
URL_HASH ${VELOX_SPDLOG_BUILD_SHA256_CHECKSUM}
OVERRIDE_FIND_PACKAGE EXCLUDE_FROM_ALL SYSTEM)

set(SPDLOG_FMT_EXTERNAL ON)
FetchContent_MakeAvailable(spdlog)
23 changes: 23 additions & 0 deletions CMake/resolve_dependency_modules/ystdlib_cpp.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright (c) Facebook, Inc. and its affiliates.
#
# Licensed 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.
include_guard(GLOBAL)

FetchContent_Declare(
ystdlib_cpp
GIT_REPOSITORY https://github.com/y-scope/ystdlib-cpp.git
GIT_TAG 0ae886c6a7ee706a3c6e1950262b63d72f71fe63)

FetchContent_Populate(ystdlib_cpp)

set(CLP_YSTDLIB_SOURCE_DIRECTORY "${ystdlib_cpp_SOURCE_DIR}")
33 changes: 33 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ set(VELOX_GFLAGS_TYPE
)
option(VELOX_ENABLE_EXEC "Build exec." ON)
option(VELOX_ENABLE_AGGREGATES "Build aggregates." ON)
option(VELOX_ENABLE_CLP_CONNECTOR "Build CLP connector." ON)
option(VELOX_ENABLE_HIVE_CONNECTOR "Build Hive connector." ON)
option(VELOX_ENABLE_TPCH_CONNECTOR "Build TPC-H connector." ON)
option(VELOX_ENABLE_PRESTO_FUNCTIONS "Build Presto SQL functions." ON)
Expand Down Expand Up @@ -174,6 +175,7 @@ if(${VELOX_BUILD_MINIMAL} OR ${VELOX_BUILD_MINIMAL_WITH_DWIO})
set(VELOX_ENABLE_EXPRESSION ON)
set(VELOX_ENABLE_EXEC OFF)
set(VELOX_ENABLE_AGGREGATES OFF)
set(VELOX_ENABLE_CLP_CONNECTOR OFF)
set(VELOX_ENABLE_HIVE_CONNECTOR OFF)
set(VELOX_ENABLE_TPCH_CONNECTOR OFF)
set(VELOX_ENABLE_SPARK_FUNCTIONS OFF)
Expand Down Expand Up @@ -462,9 +464,11 @@ set(BOOST_INCLUDE_LIBRARIES
context
date_time
filesystem
iostreams
program_options
regex
system
url
thread)

velox_set_source(Boost)
Expand Down Expand Up @@ -520,6 +524,35 @@ endif()
velox_set_source(re2)
velox_resolve_dependency(re2)

if(${VELOX_ENABLE_CLP_CONNECTOR})
velox_set_source(absl)
velox_resolve_dependency(absl)

velox_set_source(antlr4-runtime)
velox_resolve_dependency(antlr4-runtime)

velox_set_source(date)
velox_resolve_dependency(date)

velox_set_source(msgpack-cxx)
velox_resolve_dependency(msgpack-cxx)

velox_set_source(nlohmann_json)
velox_resolve_dependency(nlohmann_json)

velox_set_source(simdjson)
velox_resolve_dependency(simdjson)

velox_set_source(spdlog)
velox_resolve_dependency(spdlog)

set(ystdlib_cpp_SOURCE BUNDLED)
velox_resolve_dependency(ystdlib_cpp)

set(clp_SOURCE BUNDLED)
velox_resolve_dependency(clp)
endif()

if(${VELOX_BUILD_PYTHON_PACKAGE})
find_package(
Python 3.9
Expand Down
4 changes: 4 additions & 0 deletions velox/connectors/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ velox_link_libraries(velox_connector velox_common_config velox_vector)

add_subdirectory(fuzzer)

if(${VELOX_ENABLE_CLP_CONNECTOR})
add_subdirectory(clp)
endif()

if(${VELOX_ENABLE_HIVE_CONNECTOR})
add_subdirectory(hive)
endif()
Expand Down
31 changes: 31 additions & 0 deletions velox/connectors/clp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright (c) Facebook, Inc. and its affiliates.
#
# Licensed 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.
#set(CLP_SRC_DIR ${clp_SOURCE_DIR}/components/core/src)
add_subdirectory(search_lib)

velox_add_library(
velox_clp_connector
OBJECT
ClpConfig.cpp
ClpConnector.cpp
ClpDataSource.cpp
ClpTableHandle.cpp)

velox_link_libraries(velox_clp_connector
PRIVATE clp-s-search simdjson::simdjson velox_connector)
target_compile_features(velox_clp_connector PRIVATE cxx_std_20)

if(${VELOX_BUILD_TESTING})
add_subdirectory(tests)
endif()
Loading