2019-10-05 19:25:31 +00:00
|
|
|
option (ENABLE_ORC "Enable ORC" ${ENABLE_LIBRARIES})
|
2019-08-21 14:19:47 +00:00
|
|
|
|
2020-08-14 15:44:04 +00:00
|
|
|
if(NOT ENABLE_ORC)
|
|
|
|
if(USE_INTERNAL_ORC_LIBRARY)
|
2021-10-03 13:42:59 +00:00
|
|
|
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot use internal ORC library with ENABLE_ORC=OFF")
|
2020-08-14 15:44:04 +00:00
|
|
|
endif()
|
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
|
2020-08-17 18:47:16 +00:00
|
|
|
if (USE_INTERNAL_PARQUET_LIBRARY)
|
|
|
|
option(USE_INTERNAL_ORC_LIBRARY "Set to FALSE to use system ORC instead of bundled (experimental set to OFF on your own risk)"
|
2020-08-19 09:06:18 +00:00
|
|
|
ON)
|
2020-08-17 18:47:16 +00:00
|
|
|
elseif(USE_INTERNAL_ORC_LIBRARY)
|
|
|
|
message (${RECONFIGURE_MESSAGE_LEVEL} "Currently internal ORC can be build only with bundled Parquet")
|
|
|
|
endif()
|
2020-08-09 03:42:09 +00:00
|
|
|
|
2020-08-14 15:44:04 +00:00
|
|
|
include(cmake/find/snappy.cmake)
|
|
|
|
|
2019-09-09 21:40:40 +00:00
|
|
|
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/orc/c++/include/orc/OrcFile.hh")
|
|
|
|
if(USE_INTERNAL_ORC_LIBRARY)
|
|
|
|
message(WARNING "submodule contrib/orc is missing. to fix try run: \n git submodule update --init --recursive")
|
2020-08-14 15:44:04 +00:00
|
|
|
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal ORC")
|
2019-09-09 21:40:40 +00:00
|
|
|
set(USE_INTERNAL_ORC_LIBRARY 0)
|
|
|
|
endif()
|
|
|
|
set(MISSING_INTERNAL_ORC_LIBRARY 1)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (NOT USE_INTERNAL_ORC_LIBRARY)
|
|
|
|
find_package(orc)
|
2020-08-14 15:44:04 +00:00
|
|
|
if (NOT ORC_LIBRARY OR NOT ORC_INCLUDE_DIR)
|
|
|
|
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system ORC")
|
|
|
|
endif ()
|
2019-09-09 21:40:40 +00:00
|
|
|
endif ()
|
|
|
|
|
|
|
|
#if (USE_INTERNAL_ORC_LIBRARY)
|
|
|
|
#find_path(CYRUS_SASL_INCLUDE_DIR sasl/sasl.h)
|
|
|
|
#find_library(CYRUS_SASL_SHARED_LIB sasl2)
|
|
|
|
#if (NOT CYRUS_SASL_INCLUDE_DIR OR NOT CYRUS_SASL_SHARED_LIB)
|
|
|
|
# set(USE_ORC 0)
|
|
|
|
#endif()
|
|
|
|
#endif()
|
|
|
|
|
|
|
|
if (ORC_LIBRARY AND ORC_INCLUDE_DIR)
|
2019-08-21 14:19:47 +00:00
|
|
|
set(USE_ORC 1)
|
2019-10-30 20:34:06 +00:00
|
|
|
elseif(NOT MISSING_INTERNAL_ORC_LIBRARY AND ARROW_LIBRARY AND SNAPPY_LIBRARY) # (LIBGSASL_LIBRARY AND LIBXML2_LIBRARY)
|
2019-09-09 21:40:40 +00:00
|
|
|
set(ORC_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/orc/c++/include")
|
|
|
|
set(ORC_LIBRARY orc)
|
|
|
|
set(USE_ORC 1)
|
2020-08-14 15:44:04 +00:00
|
|
|
set(USE_INTERNAL_ORC_LIBRARY 1)
|
2019-09-09 21:40:40 +00:00
|
|
|
else()
|
2020-08-14 21:45:37 +00:00
|
|
|
message (${RECONFIGURE_MESSAGE_LEVEL}
|
|
|
|
"Can't enable ORC support - missing dependencies. Missing internal orc=${MISSING_INTERNAL_ORC_LIBRARY}. "
|
|
|
|
"arrow=${ARROW_LIBRARY} snappy=${SNAPPY_LIBRARY}")
|
2019-09-09 21:40:40 +00:00
|
|
|
set(USE_INTERNAL_ORC_LIBRARY 0)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
message (STATUS "Using internal=${USE_INTERNAL_ORC_LIBRARY} orc=${USE_ORC}: ${ORC_INCLUDE_DIR} : ${ORC_LIBRARY}")
|