mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-10-10 02:20:48 +00:00
Build fixes (Orc, ...) (#6835)
* Fix build * cmake: fix cpuinfo * Fix includes after processors merge Conflicts: dbms/src/Processors/Formats/Impl/CapnProtoRowInputFormat.cpp dbms/src/Processors/Formats/Impl/ParquetBlockOutputFormat.cpp dbms/src/Processors/Formats/Impl/ProtobufRowInputFormat.cpp dbms/src/Processors/Formats/Impl/ProtobufRowOutputFormat.cpp * Fix build in gcc8 * fix test link * fix test link * Fix test link * link fix * Fix includes after processors merge 2 Conflicts: dbms/src/Processors/Formats/Impl/ParquetBlockInputFormat.cpp * Fix includes after processors merge 3 * link fix * Fix likely/unlikely conflict with cython * Fix conflict with protobuf/stubs/atomicops.h * remove unlikely.h * Fix macos build (do not use timer_t) * wip * Fix build (orc, ...) * Missing files * Try fix * fix hdfs * Fix llvm 7.1 find
This commit is contained in:
parent
7e157f1518
commit
2c930c6d80
@ -343,7 +343,7 @@ include (cmake/find_hyperscan.cmake)
|
||||
include (cmake/find_simdjson.cmake)
|
||||
include (cmake/find_rapidjson.cmake)
|
||||
include (cmake/find_fastops.cmake)
|
||||
include (cmake/find_orc.cmake)
|
||||
#include (cmake/find_orc.cmake)
|
||||
|
||||
find_contrib_lib(cityhash)
|
||||
find_contrib_lib(farmhash)
|
||||
|
@ -1,24 +1,29 @@
|
||||
if(NOT ARCH_ARM AND NOT OS_FREEBSD AND NOT APPLE AND USE_PROTOBUF)
|
||||
option (ENABLE_HDFS "Enable HDFS" ${NOT_UNBUNDLED})
|
||||
endif ()
|
||||
|
||||
if (ENABLE_HDFS AND NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/libhdfs3/include/hdfs/hdfs.h")
|
||||
message (WARNING "submodule contrib/libhdfs3 is missing. to fix try run: \n git submodule update --init --recursive")
|
||||
set (ENABLE_HDFS 0)
|
||||
option(ENABLE_HDFS "Enable HDFS" 1)
|
||||
endif()
|
||||
|
||||
if(ENABLE_HDFS)
|
||||
option (USE_INTERNAL_HDFS3_LIBRARY "Set to FALSE to use system HDFS3 instead of bundled" ON)
|
||||
option(USE_INTERNAL_HDFS3_LIBRARY "Set to FALSE to use system HDFS3 instead of bundled" ${NOT_UNBUNDLED})
|
||||
|
||||
if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/libhdfs3/include/hdfs/hdfs.h")
|
||||
if(USE_INTERNAL_HDFS3_LIBRARY)
|
||||
message(WARNING "submodule contrib/libhdfs3 is missing. to fix try run: \n git submodule update --init --recursive")
|
||||
endif()
|
||||
set(MISSING_INTERNAL_HDFS3_LIBRARY 1)
|
||||
set(USE_INTERNAL_HDFS3_LIBRARY 0)
|
||||
endif()
|
||||
|
||||
if(NOT USE_INTERNAL_HDFS3_LIBRARY)
|
||||
find_package(hdfs3)
|
||||
find_library(HDFS3_LIBRARY hdfs3)
|
||||
find_path(HDFS3_INCLUDE_DIR NAMES hdfs/hdfs.h PATHS ${HDFS3_INCLUDE_PATHS})
|
||||
endif()
|
||||
|
||||
if(HDFS3_LIBRARY AND HDFS3_INCLUDE_DIR)
|
||||
set(USE_HDFS 1)
|
||||
elseif (LIBGSASL_LIBRARY AND LIBXML2_LIBRARY)
|
||||
elseif(NOT MISSING_INTERNAL_HDFS3_LIBRARY AND LIBGSASL_LIBRARY AND LIBXML2_LIBRARY)
|
||||
set(HDFS3_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/libhdfs3/include")
|
||||
set(HDFS3_LIBRARY hdfs3)
|
||||
set(USE_INTERNAL_HDFS3_LIBRARY 1)
|
||||
set(USE_HDFS 1)
|
||||
else()
|
||||
set(USE_INTERNAL_HDFS3_LIBRARY 0)
|
||||
|
@ -18,22 +18,12 @@ if (ENABLE_EMBEDDED_COMPILER)
|
||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
find_package(LLVM ${CMAKE_CXX_COMPILER_VERSION} CONFIG PATHS ${LLVM_PATHS})
|
||||
else ()
|
||||
#TODO:
|
||||
#if(NOT LLVM_FOUND)
|
||||
# find_package(LLVM 9 CONFIG PATHS ${LLVM_PATHS})
|
||||
#endif()
|
||||
#if(NOT LLVM_FOUND)
|
||||
# find_package(LLVM 8 CONFIG PATHS ${LLVM_PATHS})
|
||||
#endif()
|
||||
# TODO: 9 8
|
||||
foreach(llvm_v 7.1 7 6 5)
|
||||
if (NOT LLVM_FOUND)
|
||||
find_package (LLVM 7 CONFIG PATHS ${LLVM_PATHS})
|
||||
endif ()
|
||||
if (NOT LLVM_FOUND)
|
||||
find_package (LLVM 6 CONFIG PATHS ${LLVM_PATHS})
|
||||
endif ()
|
||||
if (NOT LLVM_FOUND)
|
||||
find_package (LLVM 5 CONFIG PATHS ${LLVM_PATHS})
|
||||
find_package (LLVM ${llvm_v} CONFIG PATHS ${LLVM_PATHS})
|
||||
endif ()
|
||||
endforeach ()
|
||||
endif ()
|
||||
|
||||
if (LLVM_FOUND)
|
||||
|
@ -1,8 +1,38 @@
|
||||
##TODO replace hardcode to find procedure
|
||||
option (ENABLE_ORC "Enable ORC" 1)
|
||||
|
||||
set(USE_ORC 0)
|
||||
set(USE_INTERNAL_ORC_LIBRARY ON)
|
||||
if(ENABLE_ORC)
|
||||
option (USE_INTERNAL_ORC_LIBRARY "Set to FALSE to use system ORC instead of bundled" ${NOT_UNBUNDLED})
|
||||
|
||||
if (ARROW_LIBRARY)
|
||||
set(USE_ORC 1)
|
||||
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")
|
||||
set(USE_INTERNAL_ORC_LIBRARY 0)
|
||||
endif()
|
||||
set(MISSING_INTERNAL_ORC_LIBRARY 1)
|
||||
endif ()
|
||||
|
||||
if (NOT USE_INTERNAL_ORC_LIBRARY)
|
||||
find_package(orc)
|
||||
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)
|
||||
set(USE_ORC 1)
|
||||
elseif(NOT MISSING_INTERNAL_ORC_LIBRARY AND ARROW_LIBRARY) # (LIBGSASL_LIBRARY AND LIBXML2_LIBRARY)
|
||||
set(ORC_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/orc/c++/include")
|
||||
set(ORC_LIBRARY orc)
|
||||
set(USE_ORC 1)
|
||||
else()
|
||||
set(USE_INTERNAL_ORC_LIBRARY 0)
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
message (STATUS "Using internal=${USE_INTERNAL_ORC_LIBRARY} orc=${USE_ORC}: ${ORC_INCLUDE_DIR} : ${ORC_LIBRARY}")
|
||||
|
@ -62,6 +62,7 @@ elseif(NOT MISSING_INTERNAL_PARQUET_LIBRARY AND NOT OS_FREEBSD)
|
||||
endif()
|
||||
|
||||
set(USE_PARQUET 1)
|
||||
set(USE_ORC 1)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
17
contrib/CMakeLists.txt
vendored
17
contrib/CMakeLists.txt
vendored
@ -10,19 +10,6 @@ endif ()
|
||||
|
||||
set_property(DIRECTORY PROPERTY EXCLUDE_FROM_ALL 1)
|
||||
|
||||
if (USE_INTERNAL_ORC_LIBRARY)
|
||||
set(BUILD_JAVA OFF)
|
||||
set (ANALYZE_JAVA OFF)
|
||||
set (BUILD_CPP_TESTS OFF)
|
||||
set (BUILD_TOOLS OFF)
|
||||
option(BUILD_JAVA OFF)
|
||||
option (ANALYZE_JAVA OFF)
|
||||
option (BUILD_CPP_TESTS OFF)
|
||||
option (BUILD_TOOLS OFF)
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/contrib/orc/cmake_modules")
|
||||
add_subdirectory(orc)
|
||||
endif()
|
||||
|
||||
if (USE_INTERNAL_BOOST_LIBRARY)
|
||||
add_subdirectory (boost-cmake)
|
||||
endif ()
|
||||
@ -327,3 +314,7 @@ endif()
|
||||
if (USE_FASTOPS)
|
||||
add_subdirectory (fastops-cmake)
|
||||
endif()
|
||||
|
||||
#if (USE_INTERNAL_ORC_LIBRARY)
|
||||
# add_subdirectory(orc-cmake)
|
||||
#endif ()
|
||||
|
@ -56,11 +56,11 @@ set(ORC_SOURCE_WRAP_DIR ${ORC_SOURCE_DIR}/wrap)
|
||||
set(ORC_BUILD_SRC_DIR ${CMAKE_CURRENT_BINARY_DIR}/../orc/c++/src)
|
||||
set(ORC_BUILD_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/../orc/c++/include)
|
||||
|
||||
set(GOOGLE_PROTOBUF_DIR ${ClickHouse_SOURCE_DIR}/contrib/protobuf/src/)
|
||||
set(GOOGLE_PROTOBUF_DIR ${Protobuf_INCLUDE_DIR}/)
|
||||
set(ORC_ADDITION_SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR})
|
||||
set(ARROW_SRC_DIR ${ClickHouse_SOURCE_DIR}/contrib/arrow/cpp/src)
|
||||
|
||||
set(PROTOBUF_EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/../protobuf/cmake/protoc)
|
||||
set(PROTOBUF_EXECUTABLE ${Protobuf_PROTOC_EXECUTABLE})
|
||||
set(PROTO_DIR ${ORC_SOURCE_DIR}/../proto)
|
||||
|
||||
|
||||
@ -70,14 +70,10 @@ add_custom_command(OUTPUT orc_proto.pb.h orc_proto.pb.cc
|
||||
--cpp_out="${CMAKE_CURRENT_BINARY_DIR}"
|
||||
"${PROTO_DIR}/orc_proto.proto")
|
||||
|
||||
include_directories(SYSTEM ${ORC_INCLUDE_DIR})
|
||||
include_directories(SYSTEM ${ORC_SOURCE_SRC_DIR})
|
||||
include_directories(SYSTEM ${ORC_SOURCE_WRAP_DIR})
|
||||
include_directories(SYSTEM ${GOOGLE_PROTOBUF_DIR})
|
||||
include_directories(SYSTEM ${ORC_BUILD_SRC_DIR})
|
||||
include_directories(SYSTEM ${ORC_BUILD_INCLUDE_DIR})
|
||||
include_directories(SYSTEM ${ORC_ADDITION_SOURCE_DIR})
|
||||
include_directories(SYSTEM ${ARROW_SRC_DIR})
|
||||
include(${ClickHouse_SOURCE_DIR}/contrib/orc/cmake_modules/CheckSourceCompiles.cmake)
|
||||
include(orc_check.cmake)
|
||||
configure_file("${ORC_INCLUDE_DIR}/orc/orc-config.hh.in" "${ORC_BUILD_INCLUDE_DIR}/orc/orc-config.hh")
|
||||
configure_file("${ORC_SOURCE_SRC_DIR}/Adaptor.hh.in" "${ORC_BUILD_INCLUDE_DIR}/Adaptor.hh")
|
||||
|
||||
|
||||
set(ORC_SRCS
|
||||
@ -232,6 +228,14 @@ if (ARROW_WITH_ZSTD)
|
||||
target_link_libraries(${ARROW_LIBRARY} PRIVATE ${ZSTD_LIBRARY})
|
||||
endif()
|
||||
|
||||
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})
|
||||
|
||||
# === parquet
|
||||
|
||||
|
126
contrib/arrow-cmake/orc_check.cmake
Normal file
126
contrib/arrow-cmake/orc_check.cmake
Normal file
@ -0,0 +1,126 @@
|
||||
# Not changed part of contrib/orc/c++/src/CMakeLists.txt
|
||||
|
||||
INCLUDE(CheckCXXSourceCompiles)
|
||||
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
#include<fcntl.h>
|
||||
#include<unistd.h>
|
||||
int main(int,char*[]){
|
||||
int f = open(\"/x/y\", O_RDONLY);
|
||||
char buf[100];
|
||||
return pread(f, buf, 100, 1000) == 0;
|
||||
}"
|
||||
HAS_PREAD
|
||||
)
|
||||
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
#include<time.h>
|
||||
int main(int,char*[]){
|
||||
struct tm time2020;
|
||||
return !strptime(\"2020-02-02 12:34:56\", \"%Y-%m-%d %H:%M:%S\", &time2020);
|
||||
}"
|
||||
HAS_STRPTIME
|
||||
)
|
||||
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
#include<string>
|
||||
int main(int,char* argv[]){
|
||||
return static_cast<int>(std::stoll(argv[0]));
|
||||
}"
|
||||
HAS_STOLL
|
||||
)
|
||||
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
#include<stdint.h>
|
||||
#include<stdio.h>
|
||||
int main(int,char*[]){
|
||||
int64_t x = 1; printf(\"%lld\",x);
|
||||
}"
|
||||
INT64_IS_LL
|
||||
)
|
||||
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored \"-Wdeprecated\"
|
||||
#pragma clang diagnostic pop
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored \"-Wdeprecated\"
|
||||
#pragma GCC diagnostic pop
|
||||
#elif defined(_MSC_VER)
|
||||
#pragma warning( push )
|
||||
#pragma warning( disable : 4996 )
|
||||
#pragma warning( pop )
|
||||
#else
|
||||
unknownCompiler!
|
||||
#endif
|
||||
int main(int, char *[]) {}"
|
||||
HAS_DIAGNOSTIC_PUSH
|
||||
)
|
||||
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
#include<cmath>
|
||||
int main(int, char *[]) {
|
||||
return std::isnan(1.0f);
|
||||
}"
|
||||
HAS_STD_ISNAN
|
||||
)
|
||||
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
#include<mutex>
|
||||
int main(int, char *[]) {
|
||||
std::mutex test_mutex;
|
||||
std::lock_guard<std::mutex> lock_mutex(test_mutex);
|
||||
}"
|
||||
HAS_STD_MUTEX
|
||||
)
|
||||
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
#include<string>
|
||||
std::string func() {
|
||||
std::string var = \"test\";
|
||||
return std::move(var);
|
||||
}
|
||||
int main(int, char *[]) {}"
|
||||
NEEDS_REDUNDANT_MOVE
|
||||
)
|
||||
|
||||
INCLUDE(CheckCXXSourceRuns)
|
||||
|
||||
CHECK_CXX_SOURCE_RUNS("
|
||||
#include<time.h>
|
||||
int main(int, char *[]) {
|
||||
time_t t = -14210715; // 1969-07-20 12:34:45
|
||||
struct tm *ptm = gmtime(&t);
|
||||
return !(ptm && ptm->tm_year == 69);
|
||||
}"
|
||||
HAS_PRE_1970
|
||||
)
|
||||
|
||||
CHECK_CXX_SOURCE_RUNS("
|
||||
#include<stdlib.h>
|
||||
#include<time.h>
|
||||
int main(int, char *[]) {
|
||||
setenv(\"TZ\", \"America/Los_Angeles\", 1);
|
||||
tzset();
|
||||
struct tm time2037;
|
||||
struct tm time2038;
|
||||
strptime(\"2037-05-05 12:34:56\", \"%Y-%m-%d %H:%M:%S\", &time2037);
|
||||
strptime(\"2038-05-05 12:34:56\", \"%Y-%m-%d %H:%M:%S\", &time2038);
|
||||
return mktime(&time2038) - mktime(&time2037) != 31536000;
|
||||
}"
|
||||
HAS_POST_2038
|
||||
)
|
||||
|
||||
set(CMAKE_REQUIRED_INCLUDES ${ZLIB_INCLUDE_DIR})
|
||||
set(CMAKE_REQUIRED_LIBRARIES zlib)
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
#define Z_PREFIX
|
||||
#include<zlib.h>
|
||||
z_stream strm;
|
||||
int main(int, char *[]) {
|
||||
deflateReset(&strm);
|
||||
}"
|
||||
NEEDS_Z_PREFIX
|
||||
)
|
@ -199,17 +199,17 @@ if (WITH_KERBEROS)
|
||||
endif()
|
||||
target_include_directories(hdfs3 PRIVATE ${LIBXML2_INCLUDE_DIR})
|
||||
|
||||
target_link_libraries(hdfs3 ${LIBGSASL_LIBRARY})
|
||||
target_link_libraries(hdfs3 PRIVATE ${LIBGSASL_LIBRARY})
|
||||
if (WITH_KERBEROS)
|
||||
target_link_libraries(hdfs3 ${KERBEROS_LIBRARIES})
|
||||
target_link_libraries(hdfs3 PRIVATE ${KERBEROS_LIBRARIES})
|
||||
endif()
|
||||
target_link_libraries(hdfs3 ${LIBXML2_LIBRARY})
|
||||
target_link_libraries(hdfs3 PRIVATE ${LIBXML2_LIBRARY})
|
||||
|
||||
# inherit from parent cmake
|
||||
target_include_directories(hdfs3 PRIVATE ${Boost_INCLUDE_DIRS})
|
||||
target_include_directories(hdfs3 PRIVATE ${Protobuf_INCLUDE_DIR})
|
||||
target_link_libraries(hdfs3 ${Protobuf_LIBRARY})
|
||||
target_link_libraries(hdfs3 PRIVATE ${Protobuf_LIBRARY})
|
||||
if(OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES)
|
||||
target_include_directories(hdfs3 PRIVATE ${OPENSSL_INCLUDE_DIR})
|
||||
target_link_libraries(hdfs3 ${OPENSSL_LIBRARIES})
|
||||
target_link_libraries(hdfs3 PRIVATE ${OPENSSL_LIBRARIES})
|
||||
endif()
|
||||
|
229
contrib/orc-cmake/CMakeLists.txt
Normal file
229
contrib/orc-cmake/CMakeLists.txt
Normal file
@ -0,0 +1,229 @@
|
||||
# modifyed copy of contrib/orc/c++/src/CMakeLists.txt
|
||||
set(LIBRARY_INCLUDE ${ClickHouse_SOURCE_DIR}/contrib/orc/c++/include)
|
||||
set(LIBRARY_DIR ${ClickHouse_SOURCE_DIR}/contrib/orc/c++/src)
|
||||
|
||||
set(PROTOBUF_INCLUDE_DIR ${Protobuf_INCLUDE_DIR})
|
||||
set(PROTOBUF_EXECUTABLE ${Protobuf_PROTOC_EXECUTABLE})
|
||||
|
||||
# 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 (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX11_FLAGS} ${WARN_FLAGS}")
|
||||
|
||||
INCLUDE(CheckCXXSourceCompiles)
|
||||
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
#include<fcntl.h>
|
||||
#include<unistd.h>
|
||||
int main(int,char*[]){
|
||||
int f = open(\"/x/y\", O_RDONLY);
|
||||
char buf[100];
|
||||
return pread(f, buf, 100, 1000) == 0;
|
||||
}"
|
||||
HAS_PREAD
|
||||
)
|
||||
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
#include<time.h>
|
||||
int main(int,char*[]){
|
||||
struct tm time2020;
|
||||
return !strptime(\"2020-02-02 12:34:56\", \"%Y-%m-%d %H:%M:%S\", &time2020);
|
||||
}"
|
||||
HAS_STRPTIME
|
||||
)
|
||||
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
#include<string>
|
||||
int main(int,char* argv[]){
|
||||
return static_cast<int>(std::stoll(argv[0]));
|
||||
}"
|
||||
HAS_STOLL
|
||||
)
|
||||
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
#include<stdint.h>
|
||||
#include<stdio.h>
|
||||
int main(int,char*[]){
|
||||
int64_t x = 1; printf(\"%lld\",x);
|
||||
}"
|
||||
INT64_IS_LL
|
||||
)
|
||||
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored \"-Wdeprecated\"
|
||||
#pragma clang diagnostic pop
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored \"-Wdeprecated\"
|
||||
#pragma GCC diagnostic pop
|
||||
#elif defined(_MSC_VER)
|
||||
#pragma warning( push )
|
||||
#pragma warning( disable : 4996 )
|
||||
#pragma warning( pop )
|
||||
#else
|
||||
unknownCompiler!
|
||||
#endif
|
||||
int main(int, char *[]) {}"
|
||||
HAS_DIAGNOSTIC_PUSH
|
||||
)
|
||||
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
#include<cmath>
|
||||
int main(int, char *[]) {
|
||||
return std::isnan(1.0f);
|
||||
}"
|
||||
HAS_STD_ISNAN
|
||||
)
|
||||
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
#include<mutex>
|
||||
int main(int, char *[]) {
|
||||
std::mutex test_mutex;
|
||||
std::lock_guard<std::mutex> lock_mutex(test_mutex);
|
||||
}"
|
||||
HAS_STD_MUTEX
|
||||
)
|
||||
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
#include<string>
|
||||
std::string func() {
|
||||
std::string var = \"test\";
|
||||
return std::move(var);
|
||||
}
|
||||
int main(int, char *[]) {}"
|
||||
NEEDS_REDUNDANT_MOVE
|
||||
)
|
||||
|
||||
INCLUDE(CheckCXXSourceRuns)
|
||||
|
||||
CHECK_CXX_SOURCE_RUNS("
|
||||
#include<time.h>
|
||||
int main(int, char *[]) {
|
||||
time_t t = -14210715; // 1969-07-20 12:34:45
|
||||
struct tm *ptm = gmtime(&t);
|
||||
return !(ptm && ptm->tm_year == 69);
|
||||
}"
|
||||
HAS_PRE_1970
|
||||
)
|
||||
|
||||
CHECK_CXX_SOURCE_RUNS("
|
||||
#include<stdlib.h>
|
||||
#include<time.h>
|
||||
int main(int, char *[]) {
|
||||
setenv(\"TZ\", \"America/Los_Angeles\", 1);
|
||||
tzset();
|
||||
struct tm time2037;
|
||||
struct tm time2038;
|
||||
strptime(\"2037-05-05 12:34:56\", \"%Y-%m-%d %H:%M:%S\", &time2037);
|
||||
strptime(\"2038-05-05 12:34:56\", \"%Y-%m-%d %H:%M:%S\", &time2038);
|
||||
return mktime(&time2038) - mktime(&time2037) != 31536000;
|
||||
}"
|
||||
HAS_POST_2038
|
||||
)
|
||||
|
||||
set(CMAKE_REQUIRED_INCLUDES ${ZLIB_INCLUDE_DIR})
|
||||
set(CMAKE_REQUIRED_LIBRARIES zlib)
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
#define Z_PREFIX
|
||||
#include<zlib.h>
|
||||
z_stream strm;
|
||||
int main(int, char *[]) {
|
||||
deflateReset(&strm);
|
||||
}"
|
||||
NEEDS_Z_PREFIX
|
||||
)
|
||||
|
||||
configure_file (
|
||||
"${LIBRARY_DIR}/Adaptor.hh.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/Adaptor.hh"
|
||||
)
|
||||
|
||||
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/orc_proto.pb.h ${CMAKE_CURRENT_BINARY_DIR}/orc_proto.pb.cc
|
||||
COMMAND ${PROTOBUF_EXECUTABLE}
|
||||
-I${ClickHouse_SOURCE_DIR}/contrib/orc/proto
|
||||
--cpp_out="${CMAKE_CURRENT_BINARY_DIR}"
|
||||
"${ClickHouse_SOURCE_DIR}/contrib/orc/proto/orc_proto.proto"
|
||||
)
|
||||
|
||||
set(SOURCE_FILES
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/Adaptor.hh"
|
||||
${CMAKE_CURRENT_BINARY_DIR}/orc_proto.pb.h
|
||||
${LIBRARY_DIR}/io/InputStream.cc
|
||||
${LIBRARY_DIR}/io/OutputStream.cc
|
||||
${LIBRARY_DIR}/wrap/orc-proto-wrapper.cc
|
||||
${LIBRARY_DIR}/Adaptor.cc
|
||||
${LIBRARY_DIR}/ByteRLE.cc
|
||||
${LIBRARY_DIR}/ColumnPrinter.cc
|
||||
${LIBRARY_DIR}/ColumnReader.cc
|
||||
${LIBRARY_DIR}/ColumnWriter.cc
|
||||
${LIBRARY_DIR}/Common.cc
|
||||
${LIBRARY_DIR}/Compression.cc
|
||||
${LIBRARY_DIR}/Exceptions.cc
|
||||
${LIBRARY_DIR}/Int128.cc
|
||||
${LIBRARY_DIR}/LzoDecompressor.cc
|
||||
${LIBRARY_DIR}/MemoryPool.cc
|
||||
${LIBRARY_DIR}/OrcFile.cc
|
||||
${LIBRARY_DIR}/Reader.cc
|
||||
${LIBRARY_DIR}/RLEv1.cc
|
||||
${LIBRARY_DIR}/RLEv2.cc
|
||||
${LIBRARY_DIR}/RLE.cc
|
||||
${LIBRARY_DIR}/Statistics.cc
|
||||
${LIBRARY_DIR}/StripeStream.cc
|
||||
${LIBRARY_DIR}/Timezone.cc
|
||||
${LIBRARY_DIR}/TypeImpl.cc
|
||||
${LIBRARY_DIR}/Vector.cc
|
||||
${LIBRARY_DIR}/Writer.cc
|
||||
)
|
||||
|
||||
if(ORC_CXX_HAS_THREAD_LOCAL AND BUILD_LIBHDFSPP)
|
||||
set(SOURCE_FILES ${SOURCE_FILES} ${LIBRARY_DIR}/OrcHdfsFile.cc)
|
||||
endif(ORC_CXX_HAS_THREAD_LOCAL AND BUILD_LIBHDFSPP)
|
||||
|
||||
#list(TRANSFORM SOURCE_FILES PREPEND ${LIBRARY_DIR}/)
|
||||
|
||||
configure_file (
|
||||
"${LIBRARY_INCLUDE}/orc/orc-config.hh.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/orc/orc-config.hh"
|
||||
)
|
||||
|
||||
add_library (orc ${SOURCE_FILES})
|
||||
|
||||
target_include_directories (orc
|
||||
PRIVATE
|
||||
${LIBRARY_INCLUDE}
|
||||
${LIBRARY_DIR}
|
||||
#PUBLIC
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
PRIVATE
|
||||
${PROTOBUF_INCLUDE_DIR}
|
||||
${ZLIB_INCLUDE_DIR}
|
||||
${SNAPPY_INCLUDE_DIR}
|
||||
${LZ4_INCLUDE_DIR}
|
||||
${LIBHDFSPP_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
target_link_libraries (orc PRIVATE
|
||||
${Protobuf_LIBRARY}
|
||||
${ZLIB_LIBRARIES}
|
||||
${SNAPPY_LIBRARY}
|
||||
${LZ4_LIBRARY}
|
||||
${LIBHDFSPP_LIBRARIES}
|
||||
)
|
||||
|
||||
#install(TARGETS orc DESTINATION lib)
|
||||
|
||||
if(ORC_CXX_HAS_THREAD_LOCAL AND BUILD_LIBHDFSPP)
|
||||
add_definitions(-DBUILD_LIBHDFSPP)
|
||||
endif(ORC_CXX_HAS_THREAD_LOCAL AND BUILD_LIBHDFSPP)
|
@ -1,7 +1,7 @@
|
||||
#include "config_formats.h"
|
||||
#include "ArrowColumnToCHColumn.h"
|
||||
|
||||
#if USE_ORC or USE_PARQUET
|
||||
#if USE_ORC || USE_PARQUET
|
||||
#include <DataTypes/DataTypeFactory.h>
|
||||
#include <DataTypes/DataTypeNullable.h>
|
||||
#include <DataTypes/DataTypeString.h>
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "config_formats.h"
|
||||
|
||||
#if USE_ORC or USE_PARQUET
|
||||
#if USE_ORC || USE_PARQUET
|
||||
|
||||
#include <DataTypes/IDataType.h>
|
||||
#include <DataTypes/DataTypesNumber.h>
|
||||
|
Loading…
Reference in New Issue
Block a user