2019-12-28 16:42:58 +00:00
|
|
|
set (CMAKE_CXX_STANDARD 17)
|
|
|
|
|
2019-02-19 20:51:44 +00:00
|
|
|
|
|
|
|
|
2019-08-21 14:19:47 +00:00
|
|
|
# === orc
|
2021-04-24 19:47:52 +00:00
|
|
|
set(ORC_SOURCE_DIR "${ClickHouse_SOURCE_DIR}/contrib/orc/c++")
|
|
|
|
set(ORC_INCLUDE_DIR "${ORC_SOURCE_DIR}/include")
|
|
|
|
set(ORC_SOURCE_SRC_DIR "${ORC_SOURCE_DIR}/src")
|
2021-10-11 03:58:08 +00:00
|
|
|
# set(ORC_SOURCE_WRAP_DIR "${ORC_SOURCE_DIR}/wrap")
|
2019-08-21 14:19:47 +00:00
|
|
|
|
2021-04-24 19:47:52 +00:00
|
|
|
set(ORC_BUILD_SRC_DIR "${CMAKE_CURRENT_BINARY_DIR}/../orc/c++/src")
|
|
|
|
set(ORC_BUILD_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/../orc/c++/include")
|
2019-08-21 14:19:47 +00:00
|
|
|
|
2021-04-24 19:47:52 +00:00
|
|
|
set(GOOGLE_PROTOBUF_DIR "${Protobuf_INCLUDE_DIR}/")
|
2019-08-21 14:19:47 +00:00
|
|
|
set(ORC_ADDITION_SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR})
|
2021-04-24 19:47:52 +00:00
|
|
|
set(ARROW_SRC_DIR "${ClickHouse_SOURCE_DIR}/contrib/arrow/cpp/src")
|
2019-08-21 14:19:47 +00:00
|
|
|
|
2019-09-09 21:40:40 +00:00
|
|
|
set(PROTOBUF_EXECUTABLE ${Protobuf_PROTOC_EXECUTABLE})
|
2021-04-24 19:47:52 +00:00
|
|
|
set(PROTO_DIR "${ORC_SOURCE_DIR}/../proto")
|
2019-08-21 14:19:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
add_custom_command(OUTPUT orc_proto.pb.h orc_proto.pb.cc
|
|
|
|
COMMAND ${PROTOBUF_EXECUTABLE}
|
|
|
|
-I ${PROTO_DIR}
|
|
|
|
--cpp_out="${CMAKE_CURRENT_BINARY_DIR}"
|
|
|
|
"${PROTO_DIR}/orc_proto.proto")
|
|
|
|
|
2019-12-22 07:15:51 +00:00
|
|
|
|
|
|
|
# === flatbuffers
|
2021-04-24 19:47:52 +00:00
|
|
|
set(FLATBUFFERS_SRC_DIR "${ClickHouse_SOURCE_DIR}/contrib/flatbuffers")
|
|
|
|
set(FLATBUFFERS_BINARY_DIR "${ClickHouse_BINARY_DIR}/contrib/flatbuffers")
|
|
|
|
set(FLATBUFFERS_INCLUDE_DIR "${FLATBUFFERS_SRC_DIR}/include")
|
2019-12-23 06:51:35 +00:00
|
|
|
|
|
|
|
# set flatbuffers CMake options
|
2020-08-14 15:44:04 +00:00
|
|
|
if (MAKE_STATIC_LIBRARIES)
|
2019-12-23 06:51:35 +00:00
|
|
|
set(FLATBUFFERS_BUILD_FLATLIB ON CACHE BOOL "Enable the build of the flatbuffers library")
|
|
|
|
set(FLATBUFFERS_BUILD_SHAREDLIB OFF CACHE BOOL "Disable the build of the flatbuffers shared library")
|
2019-12-24 15:17:15 +00:00
|
|
|
else ()
|
2019-12-23 06:51:35 +00:00
|
|
|
set(FLATBUFFERS_BUILD_SHAREDLIB ON CACHE BOOL "Enable the build of the flatbuffers shared library")
|
|
|
|
set(FLATBUFFERS_BUILD_FLATLIB OFF CACHE BOOL "Disable the build of the flatbuffers library")
|
2019-12-24 15:17:15 +00:00
|
|
|
endif ()
|
2019-12-23 06:51:35 +00:00
|
|
|
set(FLATBUFFERS_BUILD_TESTS OFF CACHE BOOL "Skip flatbuffers tests")
|
2019-12-22 07:15:51 +00:00
|
|
|
|
2019-12-23 06:51:35 +00:00
|
|
|
add_subdirectory(${FLATBUFFERS_SRC_DIR} "${FLATBUFFERS_BINARY_DIR}")
|
2019-12-22 07:15:51 +00:00
|
|
|
|
2020-07-06 21:36:10 +00:00
|
|
|
message(STATUS "FLATBUFFERS_LIBRARY: ${FLATBUFFERS_LIBRARY}")
|
2019-12-23 06:51:35 +00:00
|
|
|
|
2019-12-26 17:26:22 +00:00
|
|
|
# arrow-cmake cmake file calling orc cmake subroutine which detects certain compiler features.
|
2020-06-09 10:54:49 +00:00
|
|
|
# Apple Clang compiler failed to compile this code without specifying c++11 standard.
|
2019-11-01 19:16:03 +00:00
|
|
|
# As result these compiler features detected as absent. In result it failed to compile orc itself.
|
|
|
|
# In orc makefile there is code that sets flags, but arrow-cmake ignores these flags.
|
2019-11-01 16:33:43 +00:00
|
|
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
|
2019-12-24 15:17:15 +00:00
|
|
|
set(CXX11_FLAGS "-std=c++0x")
|
|
|
|
endif ()
|
2019-11-01 16:33:43 +00:00
|
|
|
|
2021-10-11 03:58:08 +00:00
|
|
|
set (ORC_CXX_HAS_INITIALIZER_LIST 1)
|
|
|
|
set (ORC_CXX_HAS_NOEXCEPT 1)
|
|
|
|
set (ORC_CXX_HAS_NULLPTR 1)
|
|
|
|
set (ORC_CXX_HAS_OVERRIDE 1)
|
|
|
|
set (ORC_CXX_HAS_UNIQUE_PTR 1)
|
|
|
|
set (ORC_CXX_HAS_CSTDINT 1)
|
|
|
|
set (ORC_CXX_HAS_THREAD_LOCAL 1)
|
|
|
|
|
2019-09-09 21:40:40 +00:00
|
|
|
include(orc_check.cmake)
|
2019-12-24 15:17:15 +00:00
|
|
|
configure_file("${ORC_INCLUDE_DIR}/orc/orc-config.hh.in" "${ORC_BUILD_INCLUDE_DIR}/orc/orc-config.hh")
|
2019-09-09 21:40:40 +00:00
|
|
|
configure_file("${ORC_SOURCE_SRC_DIR}/Adaptor.hh.in" "${ORC_BUILD_INCLUDE_DIR}/Adaptor.hh")
|
2019-08-21 14:19:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
set(ORC_SRCS
|
2021-04-24 19:47:52 +00:00
|
|
|
"${ARROW_SRC_DIR}/arrow/adapters/orc/adapter.cc"
|
|
|
|
"${ARROW_SRC_DIR}/arrow/adapters/orc/adapter_util.cc"
|
|
|
|
"${ORC_SOURCE_SRC_DIR}/Exceptions.cc"
|
|
|
|
"${ORC_SOURCE_SRC_DIR}/OrcFile.cc"
|
|
|
|
"${ORC_SOURCE_SRC_DIR}/Reader.cc"
|
|
|
|
"${ORC_SOURCE_SRC_DIR}/ByteRLE.cc"
|
|
|
|
"${ORC_SOURCE_SRC_DIR}/ColumnPrinter.cc"
|
|
|
|
"${ORC_SOURCE_SRC_DIR}/ColumnReader.cc"
|
|
|
|
"${ORC_SOURCE_SRC_DIR}/ColumnWriter.cc"
|
|
|
|
"${ORC_SOURCE_SRC_DIR}/Common.cc"
|
|
|
|
"${ORC_SOURCE_SRC_DIR}/Compression.cc"
|
|
|
|
"${ORC_SOURCE_SRC_DIR}/Int128.cc"
|
|
|
|
"${ORC_SOURCE_SRC_DIR}/LzoDecompressor.cc"
|
|
|
|
"${ORC_SOURCE_SRC_DIR}/MemoryPool.cc"
|
|
|
|
"${ORC_SOURCE_SRC_DIR}/RLE.cc"
|
|
|
|
"${ORC_SOURCE_SRC_DIR}/RLEv1.cc"
|
|
|
|
"${ORC_SOURCE_SRC_DIR}/RLEv2.cc"
|
|
|
|
"${ORC_SOURCE_SRC_DIR}/Statistics.cc"
|
|
|
|
"${ORC_SOURCE_SRC_DIR}/StripeStream.cc"
|
|
|
|
"${ORC_SOURCE_SRC_DIR}/Timezone.cc"
|
|
|
|
"${ORC_SOURCE_SRC_DIR}/TypeImpl.cc"
|
|
|
|
"${ORC_SOURCE_SRC_DIR}/Vector.cc"
|
|
|
|
"${ORC_SOURCE_SRC_DIR}/Writer.cc"
|
|
|
|
"${ORC_SOURCE_SRC_DIR}/io/InputStream.cc"
|
|
|
|
"${ORC_SOURCE_SRC_DIR}/io/OutputStream.cc"
|
|
|
|
"${ORC_ADDITION_SOURCE_DIR}/orc_proto.pb.cc"
|
2019-08-21 14:19:47 +00:00
|
|
|
)
|
|
|
|
|
2019-02-19 20:51:44 +00:00
|
|
|
|
|
|
|
# === arrow
|
|
|
|
|
2021-04-24 19:47:52 +00:00
|
|
|
set(LIBRARY_DIR "${ClickHouse_SOURCE_DIR}/contrib/arrow/cpp/src/arrow")
|
2019-12-22 07:15:51 +00:00
|
|
|
|
2020-11-07 13:25:30 +00:00
|
|
|
configure_file("${LIBRARY_DIR}/util/config.h.cmake" "${CMAKE_CURRENT_BINARY_DIR}/cpp/src/arrow/util/config.h")
|
2019-12-22 07:15:51 +00:00
|
|
|
|
2019-02-19 20:51:44 +00:00
|
|
|
# arrow/cpp/src/arrow/CMakeLists.txt
|
|
|
|
set(ARROW_SRCS
|
2021-04-24 19:47:52 +00:00
|
|
|
"${LIBRARY_DIR}/buffer.cc"
|
|
|
|
"${LIBRARY_DIR}/builder.cc"
|
|
|
|
"${LIBRARY_DIR}/chunked_array.cc"
|
|
|
|
"${LIBRARY_DIR}/compare.cc"
|
|
|
|
"${LIBRARY_DIR}/datum.cc"
|
|
|
|
"${LIBRARY_DIR}/device.cc"
|
|
|
|
"${LIBRARY_DIR}/extension_type.cc"
|
|
|
|
"${LIBRARY_DIR}/memory_pool.cc"
|
|
|
|
"${LIBRARY_DIR}/pretty_print.cc"
|
|
|
|
"${LIBRARY_DIR}/record_batch.cc"
|
|
|
|
"${LIBRARY_DIR}/result.cc"
|
|
|
|
"${LIBRARY_DIR}/scalar.cc"
|
|
|
|
"${LIBRARY_DIR}/sparse_tensor.cc"
|
|
|
|
"${LIBRARY_DIR}/status.cc"
|
|
|
|
"${LIBRARY_DIR}/table_builder.cc"
|
|
|
|
"${LIBRARY_DIR}/table.cc"
|
|
|
|
"${LIBRARY_DIR}/tensor.cc"
|
|
|
|
"${LIBRARY_DIR}/type.cc"
|
|
|
|
"${LIBRARY_DIR}/visitor.cc"
|
|
|
|
|
|
|
|
"${LIBRARY_DIR}/array/array_base.cc"
|
|
|
|
"${LIBRARY_DIR}/array/array_binary.cc"
|
|
|
|
"${LIBRARY_DIR}/array/array_decimal.cc"
|
|
|
|
"${LIBRARY_DIR}/array/array_dict.cc"
|
|
|
|
"${LIBRARY_DIR}/array/array_nested.cc"
|
|
|
|
"${LIBRARY_DIR}/array/array_primitive.cc"
|
|
|
|
"${LIBRARY_DIR}/array/builder_adaptive.cc"
|
|
|
|
"${LIBRARY_DIR}/array/builder_base.cc"
|
|
|
|
"${LIBRARY_DIR}/array/builder_binary.cc"
|
|
|
|
"${LIBRARY_DIR}/array/builder_decimal.cc"
|
|
|
|
"${LIBRARY_DIR}/array/builder_dict.cc"
|
|
|
|
"${LIBRARY_DIR}/array/builder_nested.cc"
|
|
|
|
"${LIBRARY_DIR}/array/builder_primitive.cc"
|
|
|
|
"${LIBRARY_DIR}/array/builder_union.cc"
|
|
|
|
"${LIBRARY_DIR}/array/concatenate.cc"
|
|
|
|
"${LIBRARY_DIR}/array/data.cc"
|
|
|
|
"${LIBRARY_DIR}/array/diff.cc"
|
|
|
|
"${LIBRARY_DIR}/array/util.cc"
|
|
|
|
"${LIBRARY_DIR}/array/validate.cc"
|
|
|
|
|
2021-06-01 08:32:09 +00:00
|
|
|
"${LIBRARY_DIR}/compute/api_aggregate.cc"
|
2021-04-24 19:47:52 +00:00
|
|
|
"${LIBRARY_DIR}/compute/api_scalar.cc"
|
|
|
|
"${LIBRARY_DIR}/compute/api_vector.cc"
|
|
|
|
"${LIBRARY_DIR}/compute/cast.cc"
|
|
|
|
"${LIBRARY_DIR}/compute/exec.cc"
|
|
|
|
"${LIBRARY_DIR}/compute/function.cc"
|
2021-08-03 08:27:23 +00:00
|
|
|
"${LIBRARY_DIR}/compute/function_internal.cc"
|
2021-04-24 19:47:52 +00:00
|
|
|
"${LIBRARY_DIR}/compute/kernel.cc"
|
|
|
|
"${LIBRARY_DIR}/compute/registry.cc"
|
|
|
|
|
2021-08-03 08:27:23 +00:00
|
|
|
"${LIBRARY_DIR}/compute/exec/exec_plan.cc"
|
|
|
|
"${LIBRARY_DIR}/compute/exec/expression.cc"
|
|
|
|
"${LIBRARY_DIR}/compute/exec/key_compare.cc"
|
|
|
|
"${LIBRARY_DIR}/compute/exec/key_encode.cc"
|
|
|
|
"${LIBRARY_DIR}/compute/exec/key_hash.cc"
|
|
|
|
"${LIBRARY_DIR}/compute/exec/key_map.cc"
|
|
|
|
"${LIBRARY_DIR}/compute/exec/util.cc"
|
|
|
|
|
2021-04-24 19:47:52 +00:00
|
|
|
"${LIBRARY_DIR}/compute/kernels/aggregate_basic.cc"
|
|
|
|
"${LIBRARY_DIR}/compute/kernels/aggregate_mode.cc"
|
2021-06-01 08:32:09 +00:00
|
|
|
"${LIBRARY_DIR}/compute/kernels/aggregate_quantile.cc"
|
|
|
|
"${LIBRARY_DIR}/compute/kernels/aggregate_tdigest.cc"
|
2021-04-24 19:47:52 +00:00
|
|
|
"${LIBRARY_DIR}/compute/kernels/aggregate_var_std.cc"
|
|
|
|
"${LIBRARY_DIR}/compute/kernels/codegen_internal.cc"
|
2021-06-01 08:32:09 +00:00
|
|
|
"${LIBRARY_DIR}/compute/kernels/hash_aggregate.cc"
|
2021-04-24 19:47:52 +00:00
|
|
|
"${LIBRARY_DIR}/compute/kernels/scalar_arithmetic.cc"
|
|
|
|
"${LIBRARY_DIR}/compute/kernels/scalar_boolean.cc"
|
|
|
|
"${LIBRARY_DIR}/compute/kernels/scalar_cast_boolean.cc"
|
2021-08-03 08:27:23 +00:00
|
|
|
"${LIBRARY_DIR}/compute/kernels/scalar_cast_dictionary.cc"
|
2021-04-24 19:47:52 +00:00
|
|
|
"${LIBRARY_DIR}/compute/kernels/scalar_cast_internal.cc"
|
|
|
|
"${LIBRARY_DIR}/compute/kernels/scalar_cast_nested.cc"
|
|
|
|
"${LIBRARY_DIR}/compute/kernels/scalar_cast_numeric.cc"
|
|
|
|
"${LIBRARY_DIR}/compute/kernels/scalar_cast_string.cc"
|
|
|
|
"${LIBRARY_DIR}/compute/kernels/scalar_cast_temporal.cc"
|
|
|
|
"${LIBRARY_DIR}/compute/kernels/scalar_compare.cc"
|
|
|
|
"${LIBRARY_DIR}/compute/kernels/scalar_fill_null.cc"
|
2021-08-03 08:27:23 +00:00
|
|
|
"${LIBRARY_DIR}/compute/kernels/scalar_if_else.cc"
|
2021-04-24 19:47:52 +00:00
|
|
|
"${LIBRARY_DIR}/compute/kernels/scalar_nested.cc"
|
|
|
|
"${LIBRARY_DIR}/compute/kernels/scalar_set_lookup.cc"
|
|
|
|
"${LIBRARY_DIR}/compute/kernels/scalar_string.cc"
|
2021-08-03 08:27:23 +00:00
|
|
|
"${LIBRARY_DIR}/compute/kernels/scalar_temporal.cc"
|
2021-04-24 19:47:52 +00:00
|
|
|
"${LIBRARY_DIR}/compute/kernels/scalar_validity.cc"
|
2021-08-03 08:27:23 +00:00
|
|
|
"${LIBRARY_DIR}/compute/kernels/util_internal.cc"
|
2021-04-24 19:47:52 +00:00
|
|
|
"${LIBRARY_DIR}/compute/kernels/vector_hash.cc"
|
|
|
|
"${LIBRARY_DIR}/compute/kernels/vector_nested.cc"
|
2021-08-03 08:27:23 +00:00
|
|
|
"${LIBRARY_DIR}/compute/kernels/vector_replace.cc"
|
2021-04-24 19:47:52 +00:00
|
|
|
"${LIBRARY_DIR}/compute/kernels/vector_selection.cc"
|
|
|
|
"${LIBRARY_DIR}/compute/kernels/vector_sort.cc"
|
|
|
|
|
|
|
|
"${LIBRARY_DIR}/csv/chunker.cc"
|
|
|
|
"${LIBRARY_DIR}/csv/column_builder.cc"
|
|
|
|
"${LIBRARY_DIR}/csv/column_decoder.cc"
|
|
|
|
"${LIBRARY_DIR}/csv/converter.cc"
|
|
|
|
"${LIBRARY_DIR}/csv/options.cc"
|
|
|
|
"${LIBRARY_DIR}/csv/parser.cc"
|
|
|
|
"${LIBRARY_DIR}/csv/reader.cc"
|
2021-08-03 08:27:23 +00:00
|
|
|
"${LIBRARY_DIR}/csv/writer.cc"
|
2021-04-24 19:47:52 +00:00
|
|
|
|
|
|
|
"${LIBRARY_DIR}/ipc/dictionary.cc"
|
|
|
|
"${LIBRARY_DIR}/ipc/feather.cc"
|
|
|
|
"${LIBRARY_DIR}/ipc/message.cc"
|
|
|
|
"${LIBRARY_DIR}/ipc/metadata_internal.cc"
|
|
|
|
"${LIBRARY_DIR}/ipc/options.cc"
|
|
|
|
"${LIBRARY_DIR}/ipc/reader.cc"
|
|
|
|
"${LIBRARY_DIR}/ipc/writer.cc"
|
|
|
|
|
|
|
|
"${LIBRARY_DIR}/io/buffered.cc"
|
|
|
|
"${LIBRARY_DIR}/io/caching.cc"
|
|
|
|
"${LIBRARY_DIR}/io/compressed.cc"
|
|
|
|
"${LIBRARY_DIR}/io/file.cc"
|
|
|
|
"${LIBRARY_DIR}/io/interfaces.cc"
|
|
|
|
"${LIBRARY_DIR}/io/memory.cc"
|
|
|
|
"${LIBRARY_DIR}/io/slow.cc"
|
2021-08-03 08:27:23 +00:00
|
|
|
"${LIBRARY_DIR}/io/stdio.cc"
|
2021-06-01 08:32:09 +00:00
|
|
|
"${LIBRARY_DIR}/io/transform.cc"
|
2021-04-24 19:47:52 +00:00
|
|
|
|
|
|
|
"${LIBRARY_DIR}/tensor/coo_converter.cc"
|
|
|
|
"${LIBRARY_DIR}/tensor/csf_converter.cc"
|
|
|
|
"${LIBRARY_DIR}/tensor/csx_converter.cc"
|
|
|
|
|
|
|
|
"${LIBRARY_DIR}/util/basic_decimal.cc"
|
|
|
|
"${LIBRARY_DIR}/util/bit_block_counter.cc"
|
|
|
|
"${LIBRARY_DIR}/util/bit_run_reader.cc"
|
|
|
|
"${LIBRARY_DIR}/util/bit_util.cc"
|
|
|
|
"${LIBRARY_DIR}/util/bitmap_builders.cc"
|
|
|
|
"${LIBRARY_DIR}/util/bitmap_ops.cc"
|
2021-08-03 08:27:23 +00:00
|
|
|
"${LIBRARY_DIR}/util/bitmap.cc"
|
2021-04-24 19:47:52 +00:00
|
|
|
"${LIBRARY_DIR}/util/bpacking.cc"
|
2021-06-01 08:32:09 +00:00
|
|
|
"${LIBRARY_DIR}/util/cancel.cc"
|
2021-04-24 19:47:52 +00:00
|
|
|
"${LIBRARY_DIR}/util/compression.cc"
|
|
|
|
"${LIBRARY_DIR}/util/cpu_info.cc"
|
|
|
|
"${LIBRARY_DIR}/util/decimal.cc"
|
|
|
|
"${LIBRARY_DIR}/util/delimiting.cc"
|
|
|
|
"${LIBRARY_DIR}/util/formatting.cc"
|
|
|
|
"${LIBRARY_DIR}/util/future.cc"
|
|
|
|
"${LIBRARY_DIR}/util/int_util.cc"
|
|
|
|
"${LIBRARY_DIR}/util/io_util.cc"
|
|
|
|
"${LIBRARY_DIR}/util/key_value_metadata.cc"
|
|
|
|
"${LIBRARY_DIR}/util/logging.cc"
|
|
|
|
"${LIBRARY_DIR}/util/memory.cc"
|
2021-06-01 08:32:09 +00:00
|
|
|
"${LIBRARY_DIR}/util/mutex.cc"
|
2021-04-24 19:47:52 +00:00
|
|
|
"${LIBRARY_DIR}/util/string_builder.cc"
|
|
|
|
"${LIBRARY_DIR}/util/string.cc"
|
|
|
|
"${LIBRARY_DIR}/util/task_group.cc"
|
2021-06-01 08:32:09 +00:00
|
|
|
"${LIBRARY_DIR}/util/tdigest.cc"
|
2021-04-24 19:47:52 +00:00
|
|
|
"${LIBRARY_DIR}/util/thread_pool.cc"
|
|
|
|
"${LIBRARY_DIR}/util/time.cc"
|
|
|
|
"${LIBRARY_DIR}/util/trie.cc"
|
|
|
|
"${LIBRARY_DIR}/util/utf8.cc"
|
|
|
|
"${LIBRARY_DIR}/util/value_parsing.cc"
|
|
|
|
|
2021-06-16 13:12:23 +00:00
|
|
|
"${LIBRARY_DIR}/vendored/base64.cpp"
|
2019-12-24 15:17:15 +00:00
|
|
|
${ORC_SRCS}
|
|
|
|
)
|
2019-02-19 20:51:44 +00:00
|
|
|
|
2019-12-24 15:17:15 +00:00
|
|
|
if (SNAPPY_INCLUDE_DIR AND SNAPPY_LIBRARY)
|
2019-02-19 20:51:44 +00:00
|
|
|
set(ARROW_WITH_SNAPPY 1)
|
2019-12-24 15:17:15 +00:00
|
|
|
endif ()
|
2019-02-19 20:51:44 +00:00
|
|
|
|
2019-12-24 15:17:15 +00:00
|
|
|
if (ZLIB_INCLUDE_DIR AND ZLIB_LIBRARIES)
|
2019-02-19 20:51:44 +00:00
|
|
|
set(ARROW_WITH_ZLIB 1)
|
2019-12-24 15:17:15 +00:00
|
|
|
endif ()
|
2019-02-19 20:51:44 +00:00
|
|
|
|
|
|
|
if (ZSTD_INCLUDE_DIR AND ZSTD_LIBRARY)
|
|
|
|
set(ARROW_WITH_ZSTD 1)
|
2019-12-24 15:17:15 +00:00
|
|
|
endif ()
|
2019-02-19 20:51:44 +00:00
|
|
|
|
2020-06-09 10:54:49 +00:00
|
|
|
add_definitions(-DARROW_WITH_LZ4)
|
2021-04-24 19:47:52 +00:00
|
|
|
SET(ARROW_SRCS "${LIBRARY_DIR}/util/compression_lz4.cc" ${ARROW_SRCS})
|
2019-02-19 20:51:44 +00:00
|
|
|
|
|
|
|
if (ARROW_WITH_SNAPPY)
|
2019-12-24 15:17:15 +00:00
|
|
|
add_definitions(-DARROW_WITH_SNAPPY)
|
2021-04-24 19:47:52 +00:00
|
|
|
SET(ARROW_SRCS "${LIBRARY_DIR}/util/compression_snappy.cc" ${ARROW_SRCS})
|
2019-12-24 15:17:15 +00:00
|
|
|
endif ()
|
2019-02-19 20:51:44 +00:00
|
|
|
|
|
|
|
if (ARROW_WITH_ZLIB)
|
2019-12-24 15:17:15 +00:00
|
|
|
add_definitions(-DARROW_WITH_ZLIB)
|
2021-04-24 19:47:52 +00:00
|
|
|
SET(ARROW_SRCS "${LIBRARY_DIR}/util/compression_zlib.cc" ${ARROW_SRCS})
|
2019-12-24 15:17:15 +00:00
|
|
|
endif ()
|
2019-02-19 20:51:44 +00:00
|
|
|
|
|
|
|
if (ARROW_WITH_ZSTD)
|
2019-12-24 15:17:15 +00:00
|
|
|
add_definitions(-DARROW_WITH_ZSTD)
|
2021-04-24 19:47:52 +00:00
|
|
|
SET(ARROW_SRCS "${LIBRARY_DIR}/util/compression_zstd.cc" ${ARROW_SRCS})
|
2019-12-24 15:17:15 +00:00
|
|
|
endif ()
|
2019-02-19 20:51:44 +00:00
|
|
|
|
|
|
|
|
2019-04-24 09:06:28 +00:00
|
|
|
add_library(${ARROW_LIBRARY} ${ARROW_SRCS})
|
2019-10-05 19:25:31 +00:00
|
|
|
|
2019-12-23 06:51:35 +00:00
|
|
|
# Arrow dependencies
|
2020-07-06 21:36:10 +00:00
|
|
|
add_dependencies(${ARROW_LIBRARY} ${FLATBUFFERS_LIBRARY})
|
2019-12-23 06:51:35 +00:00
|
|
|
|
2020-06-09 10:54:49 +00:00
|
|
|
target_link_libraries(${ARROW_LIBRARY} PRIVATE ${FLATBUFFERS_LIBRARY} boost::filesystem)
|
2019-12-22 07:15:51 +00:00
|
|
|
|
2019-10-05 19:25:31 +00:00
|
|
|
if (USE_INTERNAL_PROTOBUF_LIBRARY)
|
|
|
|
add_dependencies(${ARROW_LIBRARY} protoc)
|
2019-12-24 15:17:15 +00:00
|
|
|
endif ()
|
2019-10-05 19:25:31 +00:00
|
|
|
|
2021-04-24 19:47:52 +00:00
|
|
|
target_include_directories(${ARROW_LIBRARY} SYSTEM PUBLIC "${ClickHouse_SOURCE_DIR}/contrib/arrow/cpp/src")
|
|
|
|
target_include_directories(${ARROW_LIBRARY} SYSTEM PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/cpp/src")
|
2019-08-28 20:49:37 +00:00
|
|
|
target_link_libraries(${ARROW_LIBRARY} PRIVATE ${DOUBLE_CONVERSION_LIBRARIES} ${Protobuf_LIBRARY})
|
2020-06-09 10:54:49 +00:00
|
|
|
target_link_libraries(${ARROW_LIBRARY} PRIVATE lz4)
|
2019-02-19 20:51:44 +00:00
|
|
|
if (ARROW_WITH_SNAPPY)
|
|
|
|
target_link_libraries(${ARROW_LIBRARY} PRIVATE ${SNAPPY_LIBRARY})
|
2019-12-24 15:17:15 +00:00
|
|
|
endif ()
|
2019-02-19 20:51:44 +00:00
|
|
|
if (ARROW_WITH_ZLIB)
|
|
|
|
target_link_libraries(${ARROW_LIBRARY} PRIVATE ${ZLIB_LIBRARIES})
|
2019-12-24 15:17:15 +00:00
|
|
|
endif ()
|
2019-02-19 20:51:44 +00:00
|
|
|
if (ARROW_WITH_ZSTD)
|
|
|
|
target_link_libraries(${ARROW_LIBRARY} PRIVATE ${ZSTD_LIBRARY})
|
2020-02-28 00:07:42 +00:00
|
|
|
target_include_directories(${ARROW_LIBRARY} SYSTEM BEFORE PRIVATE ${ZLIB_INCLUDE_DIR})
|
2019-12-24 15:17:15 +00:00
|
|
|
endif ()
|
2019-02-19 20:51:44 +00:00
|
|
|
|
2019-09-09 21:40:40 +00:00
|
|
|
target_include_directories(${ARROW_LIBRARY} PRIVATE SYSTEM ${ORC_INCLUDE_DIR})
|
|
|
|
target_include_directories(${ARROW_LIBRARY} PRIVATE SYSTEM ${ORC_SOURCE_SRC_DIR})
|
|
|
|
target_include_directories(${ARROW_LIBRARY} PRIVATE SYSTEM ${ORC_SOURCE_WRAP_DIR})
|
|
|
|
target_include_directories(${ARROW_LIBRARY} PRIVATE SYSTEM ${GOOGLE_PROTOBUF_DIR})
|
|
|
|
target_include_directories(${ARROW_LIBRARY} PRIVATE SYSTEM ${ORC_BUILD_SRC_DIR})
|
|
|
|
target_include_directories(${ARROW_LIBRARY} PRIVATE SYSTEM ${ORC_BUILD_INCLUDE_DIR})
|
|
|
|
target_include_directories(${ARROW_LIBRARY} PRIVATE SYSTEM ${ORC_ADDITION_SOURCE_DIR})
|
|
|
|
target_include_directories(${ARROW_LIBRARY} PRIVATE SYSTEM ${ARROW_SRC_DIR})
|
2019-12-24 16:59:22 +00:00
|
|
|
target_include_directories(${ARROW_LIBRARY} PRIVATE SYSTEM ${FLATBUFFERS_INCLUDE_DIR})
|
2019-12-26 17:26:22 +00:00
|
|
|
|
2019-02-19 20:51:44 +00:00
|
|
|
# === parquet
|
|
|
|
|
2021-04-24 19:47:52 +00:00
|
|
|
set(LIBRARY_DIR "${ClickHouse_SOURCE_DIR}/contrib/arrow/cpp/src/parquet")
|
|
|
|
set(GEN_LIBRARY_DIR "${ClickHouse_SOURCE_DIR}/contrib/arrow/cpp/src/generated")
|
2019-02-19 20:51:44 +00:00
|
|
|
# arrow/cpp/src/parquet/CMakeLists.txt
|
|
|
|
set(PARQUET_SRCS
|
2021-04-24 19:47:52 +00:00
|
|
|
"${LIBRARY_DIR}/arrow/path_internal.cc"
|
|
|
|
"${LIBRARY_DIR}/arrow/reader.cc"
|
|
|
|
"${LIBRARY_DIR}/arrow/reader_internal.cc"
|
|
|
|
"${LIBRARY_DIR}/arrow/schema.cc"
|
|
|
|
"${LIBRARY_DIR}/arrow/schema_internal.cc"
|
|
|
|
"${LIBRARY_DIR}/arrow/writer.cc"
|
|
|
|
"${LIBRARY_DIR}/bloom_filter.cc"
|
|
|
|
"${LIBRARY_DIR}/column_reader.cc"
|
|
|
|
"${LIBRARY_DIR}/column_scanner.cc"
|
|
|
|
"${LIBRARY_DIR}/column_writer.cc"
|
|
|
|
"${LIBRARY_DIR}/encoding.cc"
|
2021-06-01 08:32:09 +00:00
|
|
|
"${LIBRARY_DIR}/encryption/encryption.cc"
|
|
|
|
"${LIBRARY_DIR}/encryption/encryption_internal.cc"
|
|
|
|
"${LIBRARY_DIR}/encryption/internal_file_decryptor.cc"
|
|
|
|
"${LIBRARY_DIR}/encryption/internal_file_encryptor.cc"
|
|
|
|
"${LIBRARY_DIR}/exception.cc"
|
2021-04-24 19:47:52 +00:00
|
|
|
"${LIBRARY_DIR}/file_reader.cc"
|
|
|
|
"${LIBRARY_DIR}/file_writer.cc"
|
|
|
|
"${LIBRARY_DIR}/level_conversion.cc"
|
|
|
|
"${LIBRARY_DIR}/level_comparison.cc"
|
|
|
|
"${LIBRARY_DIR}/metadata.cc"
|
|
|
|
"${LIBRARY_DIR}/murmur3.cc"
|
|
|
|
"${LIBRARY_DIR}/platform.cc"
|
|
|
|
"${LIBRARY_DIR}/printer.cc"
|
|
|
|
"${LIBRARY_DIR}/properties.cc"
|
|
|
|
"${LIBRARY_DIR}/schema.cc"
|
|
|
|
"${LIBRARY_DIR}/statistics.cc"
|
2021-06-01 08:32:09 +00:00
|
|
|
"${LIBRARY_DIR}/stream_reader.cc"
|
|
|
|
"${LIBRARY_DIR}/stream_writer.cc"
|
2021-04-24 19:47:52 +00:00
|
|
|
"${LIBRARY_DIR}/types.cc"
|
|
|
|
|
|
|
|
"${GEN_LIBRARY_DIR}/parquet_constants.cpp"
|
|
|
|
"${GEN_LIBRARY_DIR}/parquet_types.cpp"
|
2019-12-24 15:17:15 +00:00
|
|
|
)
|
2021-04-24 19:47:52 +00:00
|
|
|
#list(TRANSFORM PARQUET_SRCS PREPEND "${LIBRARY_DIR}/") # cmake 3.12
|
2019-04-24 09:06:28 +00:00
|
|
|
add_library(${PARQUET_LIBRARY} ${PARQUET_SRCS})
|
2021-04-24 19:47:52 +00:00
|
|
|
target_include_directories(${PARQUET_LIBRARY} SYSTEM PUBLIC "${ClickHouse_SOURCE_DIR}/contrib/arrow/cpp/src" "${CMAKE_CURRENT_SOURCE_DIR}/cpp/src" PRIVATE ${OPENSSL_INCLUDE_DIR})
|
2021-11-09 03:54:00 +00:00
|
|
|
# include("${ClickHouse_SOURCE_DIR}/contrib/thrift/build/cmake/ConfigureChecks.cmake") # makes config.h
|
2021-11-21 16:16:12 +00:00
|
|
|
|
|
|
|
set (HAVE_ARPA_INET_H 1)
|
|
|
|
set (HAVE_FCNTL_H 1)
|
|
|
|
set (HAVE_GETOPT_H 1)
|
|
|
|
set (HAVE_INTTYPES_H 1)
|
|
|
|
set (HAVE_NETDB_H 1)
|
|
|
|
set (HAVE_NETINET_IN_H 1)
|
|
|
|
set (HAVE_SIGNAL_H 1)
|
|
|
|
set (HAVE_STDINT_H 1)
|
|
|
|
set (HAVE_UNISTD_H 1)
|
|
|
|
set (HAVE_PTHREAD_H 1)
|
|
|
|
set (HAVE_SYS_IOCTL_H 1)
|
|
|
|
set (HAVE_SYS_PARAM_H 1)
|
|
|
|
set (HAVE_SYS_RESOURCE_H 1)
|
|
|
|
set (HAVE_SYS_SOCKET_H 1)
|
|
|
|
set (HAVE_SYS_STAT_H 1)
|
|
|
|
set (HAVE_SYS_TIME_H 1)
|
|
|
|
set (HAVE_SYS_UN_H 1)
|
|
|
|
set (HAVE_POLL_H 1)
|
|
|
|
set (HAVE_SYS_POLL_H 1)
|
|
|
|
set (HAVE_SYS_SELECT_H 1)
|
|
|
|
set (HAVE_SCHED_H 1)
|
|
|
|
set (HAVE_STRING_H 1)
|
|
|
|
set (HAVE_STRINGS_H 1)
|
|
|
|
set (HAVE_GETHOSTBYNAME 1)
|
|
|
|
set (HAVE_STRERROR_R 1)
|
|
|
|
set (HAVE_SCHED_GET_PRIORITY_MAX 1)
|
|
|
|
set (HAVE_SCHED_GET_PRIORITY_MIN 1)
|
2021-11-21 21:15:18 +00:00
|
|
|
|
|
|
|
if (OS_LINUX)
|
|
|
|
set (STRERROR_R_CHAR_P 1)
|
|
|
|
endif ()
|
2021-11-21 16:16:12 +00:00
|
|
|
|
|
|
|
#set(PACKAGE ${PACKAGE_NAME})
|
|
|
|
#set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
|
|
|
|
#set(VERSION ${thrift_VERSION})
|
|
|
|
|
|
|
|
# generate a config.h file
|
|
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/thrift/config.h")
|
|
|
|
|
|
|
|
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
|
|
|
|
|
|
|
|
|
2020-07-06 21:36:10 +00:00
|
|
|
target_link_libraries(${PARQUET_LIBRARY} PUBLIC ${ARROW_LIBRARY} PRIVATE ${THRIFT_LIBRARY} boost::headers_only boost::regex ${OPENSSL_LIBRARIES})
|
2019-02-19 20:51:44 +00:00
|
|
|
|
2019-12-24 15:17:15 +00:00
|
|
|
if (SANITIZE STREQUAL "undefined")
|
2019-02-20 15:21:23 +00:00
|
|
|
target_compile_options(${PARQUET_LIBRARY} PRIVATE -fno-sanitize=undefined)
|
|
|
|
target_compile_options(${ARROW_LIBRARY} PRIVATE -fno-sanitize=undefined)
|
2019-12-24 15:17:15 +00:00
|
|
|
endif ()
|
2019-02-19 20:51:44 +00:00
|
|
|
|
|
|
|
# === tools
|
|
|
|
|
2021-04-24 19:47:52 +00:00
|
|
|
set(TOOLS_DIR "${ClickHouse_SOURCE_DIR}/contrib/arrow/cpp/tools/parquet")
|
2019-12-22 07:15:51 +00:00
|
|
|
set(PARQUET_TOOLS parquet_dump_schema parquet_reader parquet_scan)
|
2019-12-24 15:17:15 +00:00
|
|
|
foreach (TOOL ${PARQUET_TOOLS})
|
2021-04-24 19:47:52 +00:00
|
|
|
add_executable(${TOOL} "${TOOLS_DIR}/${TOOL}.cc")
|
2019-02-20 15:21:23 +00:00
|
|
|
target_link_libraries(${TOOL} PRIVATE ${PARQUET_LIBRARY})
|
2019-12-24 15:17:15 +00:00
|
|
|
endforeach ()
|