diff --git a/cmake/find_zlib.cmake b/cmake/find_zlib.cmake index c5ebb6255647..806ab5d0b309 100644 --- a/cmake/find_zlib.cmake +++ b/cmake/find_zlib.cmake @@ -11,6 +11,10 @@ if (NOT ZLIB_FOUND) if (CMAKE_SYSTEM MATCHES "FreeBSD" OR ARCH_I386) set (WITH_OPTIM 0 CACHE INTERNAL "") # Bug in assembler endif () + if (ARCH_AARCH64) + set(WITH_NEON 1 CACHE INTERNAL "") + set(WITH_ACLE 1 CACHE INTERNAL "") + endif () set (ZLIB_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/zlib-ng" "${ClickHouse_BINARY_DIR}/contrib/zlib-ng") # generated zconf.h set (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR}) # for poco set (ZLIB_FOUND 1) # for poco diff --git a/dbms/src/Interpreters/CMakeLists.txt b/dbms/src/Interpreters/CMakeLists.txt index ef1d3bca1082..8b9d118b1208 100644 --- a/dbms/src/Interpreters/CMakeLists.txt +++ b/dbms/src/Interpreters/CMakeLists.txt @@ -7,10 +7,10 @@ endif () set (INTERNAL_COMPILER_EXECUTABLE "clickhouse-clang" CACHE STRING "") set (INTERNAL_LINKER_EXECUTABLE "clickhouse-lld" CACHE STRING "") -set (INTERNAL_COMPILER_NO_WARNING OFF CACHE BOOL "") +set (INTERNAL_COMPILER_NO_WARNING OFF CACHE INTERNAL "") set (INTERNAL_COMPILER_HEADERS "${PATH_SHARE}/clickhouse/headers" CACHE STRING "") set (INTERNAL_COMPILER_HEADERS_ROOT "${INTERNAL_COMPILER_HEADERS}" CACHE STRING "") -set (INTERNAL_COMPILER_CUSTOM_ROOT ON CACHE BOOL "") +set (INTERNAL_COMPILER_CUSTOM_ROOT ON CACHE INTERNAL "") set (INTERNAL_COMPILER_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE} ${CXX_FLAGS_INTERNAL_COMPILER} -x c++ -march=native -fPIC -fvisibility=hidden -fno-implement-inlines -nostdinc -nostdinc++ -Wno-unused-command-line-argument -Bprefix=${PATH_SHARE}/clickhouse -isysroot=${INTERNAL_COMPILER_HEADERS_ROOT}" CACHE STRING "") string(REPLACE "-no-pie" "" INTERNAL_COMPILER_FLAGS ${INTERNAL_COMPILER_FLAGS}) diff --git a/dbms/src/Interpreters/config_compile.h.in b/dbms/src/Interpreters/config_compile.h.in index a3e877995710..19f91fd34495 100644 --- a/dbms/src/Interpreters/config_compile.h.in +++ b/dbms/src/Interpreters/config_compile.h.in @@ -1,6 +1,9 @@ #pragma once #cmakedefine CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_LIBRARY_ARCHITECTURE@" +#if !defined(CMAKE_LIBRARY_ARCHITECTURE) +#define CMAKE_LIBRARY_ARCHITECTURE "" +#endif #cmakedefine PATH_SHARE "@PATH_SHARE@" #cmakedefine INTERNAL_COMPILER_FLAGS "@INTERNAL_COMPILER_FLAGS@" #cmakedefine INTERNAL_COMPILER_EXECUTABLE "@INTERNAL_COMPILER_EXECUTABLE@" diff --git a/dbms/src/Storages/StorageMySQL.cpp b/dbms/src/Storages/StorageMySQL.cpp index 8b3b8491fd53..eafefdca8795 100644 --- a/dbms/src/Storages/StorageMySQL.cpp +++ b/dbms/src/Storages/StorageMySQL.cpp @@ -1,4 +1,5 @@ #include +#if USE_MYSQL #include #include @@ -44,3 +45,5 @@ BlockInputStreams StorageMySQL::read( } } + +#endif diff --git a/dbms/src/Storages/StorageMySQL.h b/dbms/src/Storages/StorageMySQL.h index 5384f1501633..29d0d35e69d7 100644 --- a/dbms/src/Storages/StorageMySQL.h +++ b/dbms/src/Storages/StorageMySQL.h @@ -1,5 +1,8 @@ #pragma once +#include +#if USE_MYSQL + #include #include @@ -46,3 +49,5 @@ class StorageMySQL : public ext::shared_ptr_helper, public IStorag }; } + +#endif diff --git a/dbms/src/TableFunctions/CMakeLists.txt b/dbms/src/TableFunctions/CMakeLists.txt index d9a666c8fc13..ada1b81858e7 100644 --- a/dbms/src/TableFunctions/CMakeLists.txt +++ b/dbms/src/TableFunctions/CMakeLists.txt @@ -6,5 +6,9 @@ list(REMOVE_ITEM clickhouse_table_functions_headers ITableFunction.h TableFuncti add_library(clickhouse_table_functions ${clickhouse_table_functions_sources}) target_link_libraries(clickhouse_table_functions dbms clickhouse_storages_system ${Poco_Foundation_LIBRARY}) +if (Poco_DataODBC_FOUND) + target_link_libraries (clickhouse_table_functions ${Poco_DataODBC_LIBRARY}) +endif () + target_include_directories (clickhouse_table_functions BEFORE PRIVATE ${SPARCEHASH_INCLUDE_DIR}) diff --git a/dbms/src/TableFunctions/TableFunctionODBC.cpp b/dbms/src/TableFunctions/TableFunctionODBC.cpp index 960e9405c845..591e7f8af8ba 100644 --- a/dbms/src/TableFunctions/TableFunctionODBC.cpp +++ b/dbms/src/TableFunctions/TableFunctionODBC.cpp @@ -1,3 +1,6 @@ +#include + +#if Poco_DataODBC_FOUND #include #include @@ -8,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -122,3 +124,5 @@ void registerTableFunctionODBC(TableFunctionFactory & factory) factory.registerFunction(); } } + +#endif diff --git a/dbms/src/TableFunctions/TableFunctionODBC.h b/dbms/src/TableFunctions/TableFunctionODBC.h index bdb5939ef6f7..90389eb0d964 100644 --- a/dbms/src/TableFunctions/TableFunctionODBC.h +++ b/dbms/src/TableFunctions/TableFunctionODBC.h @@ -1,5 +1,8 @@ #pragma once +#include +#if Poco_DataODBC_FOUND + #include @@ -20,3 +23,5 @@ class TableFunctionODBC : public ITableFunction StoragePtr execute(const ASTPtr & ast_function, const Context & context) const override; }; } + +#endif diff --git a/dbms/src/TableFunctions/registerTableFunctions.cpp b/dbms/src/TableFunctions/registerTableFunctions.cpp index 9054872e92d9..af069a5fcf66 100644 --- a/dbms/src/TableFunctions/registerTableFunctions.cpp +++ b/dbms/src/TableFunctions/registerTableFunctions.cpp @@ -11,7 +11,9 @@ void registerTableFunctionRemote(TableFunctionFactory & factory); void registerTableFunctionShardByHash(TableFunctionFactory & factory); void registerTableFunctionNumbers(TableFunctionFactory & factory); void registerTableFunctionCatBoostPool(TableFunctionFactory & factory); +#if Poco_DataODBC_FOUND void registerTableFunctionODBC(TableFunctionFactory & factory); +#endif #if USE_MYSQL void registerTableFunctionMySQL(TableFunctionFactory & factory); @@ -27,7 +29,10 @@ void registerTableFunctions() registerTableFunctionShardByHash(factory); registerTableFunctionNumbers(factory); registerTableFunctionCatBoostPool(factory); + +#if Poco_DataODBC_FOUND registerTableFunctionODBC(factory); +#endif #if USE_MYSQL registerTableFunctionMySQL(factory); diff --git a/libs/libcommon/include/common/exp10.h b/libs/libcommon/include/common/exp10.h index 5e5f47db3f0b..9ed3c4765eb6 100644 --- a/libs/libcommon/include/common/exp10.h +++ b/libs/libcommon/include/common/exp10.h @@ -8,6 +8,11 @@ #include /// for __THROW +// freebsd have no __THROW +#if !defined(__THROW) +#define __THROW +#endif + extern "C" {