Build fixes (#1718)

* Embedded compiler fixes

* common lib not needed for clang and lld

* Fix pthread link

* Fix shared build

* Arm fixes 1

* arm fix

* Unused fix

* Build fixes

* release --pbuilder

* release pbuilder fix

* FORCE_PBUILDER_CREATE=1 release

* release: Auto use clang with sanitizers

* Fix build without poco data odbc lib. zlib arm build fix.

* Fix freebsd build and build without mysql

* Tests: Dont eat my cpu!

* Test me
This commit is contained in:
proller 2017-12-29 18:48:20 +03:00 committed by alexey-milovidov
parent bd98072259
commit 70e35d0bcc
10 changed files with 41 additions and 3 deletions

View File

@ -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

View File

@ -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})

View File

@ -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@"

View File

@ -1,4 +1,5 @@
#include <Storages/StorageMySQL.h>
#if USE_MYSQL
#include <Storages/transformQueryForExternalDatabase.h>
#include <Dictionaries/MySQLBlockInputStream.h>
@ -44,3 +45,5 @@ BlockInputStreams StorageMySQL::read(
}
}
#endif

View File

@ -1,5 +1,8 @@
#pragma once
#include <Common/config.h>
#if USE_MYSQL
#include <ext/shared_ptr_helper.h>
#include <Storages/IStorage.h>
@ -46,3 +49,5 @@ private:
};
}
#endif

View File

@ -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})

View File

@ -1,3 +1,6 @@
#include <TableFunctions/TableFunctionODBC.h>
#if Poco_DataODBC_FOUND
#include <type_traits>
#include <ext/scope_guard.h>
@ -8,7 +11,6 @@
#include <Storages/StorageODBC.h>
#include <TableFunctions/ITableFunction.h>
#include <TableFunctions/TableFunctionFactory.h>
#include <TableFunctions/TableFunctionODBC.h>
#include <Common/Exception.h>
#include <Common/typeid_cast.h>
#include <Core/Defines.h>
@ -122,3 +124,5 @@ void registerTableFunctionODBC(TableFunctionFactory & factory)
factory.registerFunction<TableFunctionODBC>();
}
}
#endif

View File

@ -1,5 +1,8 @@
#pragma once
#include <Common/config.h>
#if Poco_DataODBC_FOUND
#include <TableFunctions/ITableFunction.h>
@ -20,3 +23,5 @@ public:
StoragePtr execute(const ASTPtr & ast_function, const Context & context) const override;
};
}
#endif

View File

@ -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);

View File

@ -8,6 +8,11 @@
#include <stdlib.h> /// for __THROW
// freebsd have no __THROW
#if !defined(__THROW)
#define __THROW
#endif
extern "C"
{