From 3d8c8ee83c816540706fb6f23c27aa6b3094f472 Mon Sep 17 00:00:00 2001 From: proller Date: Thu, 20 Jun 2019 12:12:49 +0300 Subject: [PATCH] Build fixes. Split config.h (#5686) --- CMakeLists.txt | 9 --------- cmake/find_gperf.cmake | 13 +++++++++++++ cmake/test_compiler.cmake | 3 +++ dbms/CMakeLists.txt | 2 +- dbms/src/Common/config.h.in | 12 ------------ dbms/src/Formats/CMakeLists.txt | 2 ++ dbms/src/Formats/CapnProtoRowInputStream.cpp | 5 +++-- dbms/src/Formats/CapnProtoRowInputStream.h | 3 +-- dbms/src/Formats/ParquetBlockInputStream.cpp | 3 +-- dbms/src/Formats/ParquetBlockInputStream.h | 5 +---- dbms/src/Formats/ParquetBlockOutputStream.cpp | 4 +--- dbms/src/Formats/ParquetBlockOutputStream.h | 2 +- dbms/src/Formats/ProtobufColumnMatcher.cpp | 5 +++-- dbms/src/Formats/ProtobufColumnMatcher.h | 2 +- dbms/src/Formats/ProtobufReader.cpp | 5 +++-- dbms/src/Formats/ProtobufReader.h | 2 +- dbms/src/Formats/ProtobufRowInputStream.cpp | 5 +++-- dbms/src/Formats/ProtobufRowInputStream.h | 2 +- dbms/src/Formats/ProtobufRowOutputStream.cpp | 2 +- dbms/src/Formats/ProtobufSchemas.cpp | 2 +- dbms/src/Formats/ProtobufSchemas.h | 2 +- dbms/src/Formats/ProtobufWriter.cpp | 5 +++-- dbms/src/Formats/ProtobufWriter.h | 2 +- dbms/src/Formats/config_formats.h.in | 8 ++++++++ dbms/src/Functions/CMakeLists.txt | 8 ++++++-- dbms/src/Functions/FunctionBase64Conversion.h | 2 +- dbms/src/Functions/FunctionMathBinaryFloat64.h | 2 +- dbms/src/Functions/FunctionMathUnaryFloat64.h | 2 +- dbms/src/Functions/FunctionsHashing.cpp | 5 ++--- dbms/src/Functions/FunctionsHashing.h | 3 ++- dbms/src/Functions/FunctionsJSON.h | 2 +- dbms/src/Functions/FunctionsStringRegex.cpp | 6 +++--- dbms/src/Functions/IFunction.cpp | 3 ++- dbms/src/Functions/RapidJSONParser.h | 2 +- dbms/src/Functions/Regexps.h | 2 +- dbms/src/Functions/SimdJSONParser.h | 2 +- dbms/src/Functions/base64Decode.cpp | 2 +- dbms/src/Functions/config_functions.h.in | 11 +++++++++++ dbms/src/Functions/exp10.cpp | 4 +++- dbms/src/Functions/firstSignificantSubdomain.h | 7 ++----- dbms/src/Functions/registerFunctionsString.cpp | 2 +- dbms/src/Functions/{gperf => }/tldLookup.gperf | 0 dbms/src/Functions/tldLookup.h | 2 +- dbms/src/Functions/tryBase64Decode.cpp | 2 +- .../StorageSystemBuildOptions.generated.cpp.in | 1 + dbms/tests/clickhouse-test | 5 ++++- 46 files changed, 101 insertions(+), 79 deletions(-) create mode 100644 cmake/find_gperf.cmake create mode 100644 dbms/src/Formats/config_formats.h.in create mode 100644 dbms/src/Functions/config_functions.h.in rename dbms/src/Functions/{gperf => }/tldLookup.gperf (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 18b561ccf5d..45c48ed6f35 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -268,15 +268,6 @@ if (USE_INCLUDE_WHAT_YOU_USE) endif() endif () -# Check if gperf was installed -option (USE_GPERF "Use gperf function hash generator tool" ON) -if (USE_GPERF) - find_program(GPERF gperf) - if (NOT GPERF) - message(FATAL_ERROR "Could not find the program gperf") - endif() -endif() - # Flags for test coverage if (TEST_COVERAGE) set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage -DIS_DEBUG") diff --git a/cmake/find_gperf.cmake b/cmake/find_gperf.cmake new file mode 100644 index 00000000000..24fd040ed4b --- /dev/null +++ b/cmake/find_gperf.cmake @@ -0,0 +1,13 @@ +# Check if gperf was installed +find_program(GPERF gperf) +if(GPERF) + option(ENABLE_GPERF "Use gperf function hash generator tool" ON) +endif() +if (ENABLE_GPERF) + if(NOT GPERF) + message(FATAL_ERROR "Could not find the program gperf") + endif() + set(USE_GPERF 1) +endif() + +message(STATUS "Using gperf=${USE_GPERF}: ${GPERF}") diff --git a/cmake/test_compiler.cmake b/cmake/test_compiler.cmake index cba7a04e5e3..570c058b9f7 100644 --- a/cmake/test_compiler.cmake +++ b/cmake/test_compiler.cmake @@ -1,6 +1,9 @@ include (CheckCXXSourceCompiles) include (CMakePushCheckState) +set(THREADS_PREFER_PTHREAD_FLAG ON) +find_package(Threads) + cmake_push_check_state () if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") diff --git a/dbms/CMakeLists.txt b/dbms/CMakeLists.txt index 993b62801a9..4089adc9cf5 100644 --- a/dbms/CMakeLists.txt +++ b/dbms/CMakeLists.txt @@ -348,7 +348,7 @@ if (USE_JEMALLOC) target_include_directories (dbms SYSTEM BEFORE PRIVATE ${JEMALLOC_INCLUDE_DIR}) # used in Interpreters/AsynchronousMetrics.cpp endif () -target_include_directories (dbms PUBLIC ${DBMS_INCLUDE_DIR}) +target_include_directories (dbms PUBLIC ${DBMS_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src/Formats/include) target_include_directories (clickhouse_common_io PUBLIC ${DBMS_INCLUDE_DIR}) target_include_directories (clickhouse_common_io SYSTEM PUBLIC ${PCG_RANDOM_INCLUDE_DIR}) target_include_directories (clickhouse_common_io SYSTEM BEFORE PUBLIC ${DOUBLE_CONVERSION_INCLUDE_DIR}) diff --git a/dbms/src/Common/config.h.in b/dbms/src/Common/config.h.in index 1ead4a4778f..9c959a6704c 100644 --- a/dbms/src/Common/config.h.in +++ b/dbms/src/Common/config.h.in @@ -5,31 +5,19 @@ #cmakedefine01 USE_ICU #cmakedefine01 USE_MYSQL #cmakedefine01 USE_RE2_ST -#cmakedefine01 USE_VECTORCLASS #cmakedefine01 USE_RDKAFKA -#cmakedefine01 USE_CAPNP #cmakedefine01 USE_EMBEDDED_COMPILER #cmakedefine01 USE_POCO_SQLODBC #cmakedefine01 USE_POCO_DATAODBC #cmakedefine01 USE_POCO_MONGODB #cmakedefine01 USE_POCO_NETSSL -#cmakedefine01 USE_BASE64 -#cmakedefine01 USE_SNAPPY -#cmakedefine01 USE_PARQUET #cmakedefine01 USE_HDFS -#cmakedefine01 USE_XXHASH #cmakedefine01 USE_INTERNAL_LLVM_LIBRARY -#cmakedefine01 USE_PROTOBUF #cmakedefine01 USE_CPUID #cmakedefine01 USE_CPUINFO #cmakedefine01 USE_BROTLI #cmakedefine01 USE_SSL -#cmakedefine01 USE_HYPERSCAN -#cmakedefine01 USE_SIMDJSON -#cmakedefine01 USE_RAPIDJSON #cmakedefine01 USE_LFALLOC #cmakedefine01 USE_LFALLOC_RANDOM_HINT -#cmakedefine01 USE_GPERF #cmakedefine01 CLICKHOUSE_SPLIT_BINARY -#cmakedefine01 LLVM_HAS_RTTI diff --git a/dbms/src/Formats/CMakeLists.txt b/dbms/src/Formats/CMakeLists.txt index 65172356645..fe434bbb07a 100644 --- a/dbms/src/Formats/CMakeLists.txt +++ b/dbms/src/Formats/CMakeLists.txt @@ -1,3 +1,5 @@ +configure_file(config_formats.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/config_formats.h) + if (ENABLE_TESTS) add_subdirectory (tests) endif () diff --git a/dbms/src/Formats/CapnProtoRowInputStream.cpp b/dbms/src/Formats/CapnProtoRowInputStream.cpp index 6770c54a9fd..5424e233618 100644 --- a/dbms/src/Formats/CapnProtoRowInputStream.cpp +++ b/dbms/src/Formats/CapnProtoRowInputStream.cpp @@ -1,9 +1,10 @@ -#include +#include "config_formats.h" #if USE_CAPNP +#include "CapnProtoRowInputStream.h" + #include #include -#include #include #include #include diff --git a/dbms/src/Formats/CapnProtoRowInputStream.h b/dbms/src/Formats/CapnProtoRowInputStream.h index 6e2ccd6042b..07023c3eb4c 100644 --- a/dbms/src/Formats/CapnProtoRowInputStream.h +++ b/dbms/src/Formats/CapnProtoRowInputStream.h @@ -1,10 +1,9 @@ #pragma once -#include +#include "config_formats.h" #if USE_CAPNP #include #include - #include namespace DB diff --git a/dbms/src/Formats/ParquetBlockInputStream.cpp b/dbms/src/Formats/ParquetBlockInputStream.cpp index a573969b65f..5e7dc876244 100644 --- a/dbms/src/Formats/ParquetBlockInputStream.cpp +++ b/dbms/src/Formats/ParquetBlockInputStream.cpp @@ -1,5 +1,4 @@ -#include - +#include "config_formats.h" #if USE_PARQUET # include "ParquetBlockInputStream.h" diff --git a/dbms/src/Formats/ParquetBlockInputStream.h b/dbms/src/Formats/ParquetBlockInputStream.h index d628c2ad2cb..636f0cec7b8 100644 --- a/dbms/src/Formats/ParquetBlockInputStream.h +++ b/dbms/src/Formats/ParquetBlockInputStream.h @@ -1,11 +1,8 @@ #pragma once -#include +#include "config_formats.h" #if USE_PARQUET # include -//# include -//# include -//# include namespace parquet { namespace arrow { class FileReader; } } diff --git a/dbms/src/Formats/ParquetBlockOutputStream.cpp b/dbms/src/Formats/ParquetBlockOutputStream.cpp index 744a50250da..f03aa181bc3 100644 --- a/dbms/src/Formats/ParquetBlockOutputStream.cpp +++ b/dbms/src/Formats/ParquetBlockOutputStream.cpp @@ -1,4 +1,4 @@ -#include +#include "config_formats.h" #if USE_PARQUET # include "ParquetBlockOutputStream.h" @@ -24,8 +24,6 @@ # include # include -# include // REMOVE ME - namespace DB { namespace ErrorCodes diff --git a/dbms/src/Formats/ParquetBlockOutputStream.h b/dbms/src/Formats/ParquetBlockOutputStream.h index 059113ae134..7cd484fc52b 100644 --- a/dbms/src/Formats/ParquetBlockOutputStream.h +++ b/dbms/src/Formats/ParquetBlockOutputStream.h @@ -1,6 +1,6 @@ #pragma once -#include +#include "config_formats.h" #if USE_PARQUET # include # include diff --git a/dbms/src/Formats/ProtobufColumnMatcher.cpp b/dbms/src/Formats/ProtobufColumnMatcher.cpp index af092fe3db9..317b6388ea5 100644 --- a/dbms/src/Formats/ProtobufColumnMatcher.cpp +++ b/dbms/src/Formats/ProtobufColumnMatcher.cpp @@ -1,8 +1,9 @@ -#include +#include "config_formats.h" #if USE_PROTOBUF +#include "ProtobufColumnMatcher.h" + #include -#include #include #include #include diff --git a/dbms/src/Formats/ProtobufColumnMatcher.h b/dbms/src/Formats/ProtobufColumnMatcher.h index efadcb8d757..ed6c632f8e8 100644 --- a/dbms/src/Formats/ProtobufColumnMatcher.h +++ b/dbms/src/Formats/ProtobufColumnMatcher.h @@ -1,6 +1,6 @@ #pragma once -#include +#include "config_formats.h" #if USE_PROTOBUF #include diff --git a/dbms/src/Formats/ProtobufReader.cpp b/dbms/src/Formats/ProtobufReader.cpp index d504c03203c..2c0ea1251f4 100644 --- a/dbms/src/Formats/ProtobufReader.cpp +++ b/dbms/src/Formats/ProtobufReader.cpp @@ -1,10 +1,11 @@ -#include +#include "config_formats.h" #if USE_PROTOBUF +#include "ProtobufReader.h" + #include #include #include -#include #include #include #include diff --git a/dbms/src/Formats/ProtobufReader.h b/dbms/src/Formats/ProtobufReader.h index b9b1ac36c51..9fc4b5cb8e3 100644 --- a/dbms/src/Formats/ProtobufReader.h +++ b/dbms/src/Formats/ProtobufReader.h @@ -5,7 +5,7 @@ #include #include -#include +#include "config_formats.h" #if USE_PROTOBUF #include diff --git a/dbms/src/Formats/ProtobufRowInputStream.cpp b/dbms/src/Formats/ProtobufRowInputStream.cpp index 44d830f56ea..45ea6b8dca7 100644 --- a/dbms/src/Formats/ProtobufRowInputStream.cpp +++ b/dbms/src/Formats/ProtobufRowInputStream.cpp @@ -1,11 +1,12 @@ -#include +#include "config_formats.h" #if USE_PROTOBUF +#include "ProtobufRowInputStream.h" + #include #include #include #include -#include #include diff --git a/dbms/src/Formats/ProtobufRowInputStream.h b/dbms/src/Formats/ProtobufRowInputStream.h index 43c35e045a7..1dcfeaf0246 100644 --- a/dbms/src/Formats/ProtobufRowInputStream.h +++ b/dbms/src/Formats/ProtobufRowInputStream.h @@ -1,6 +1,6 @@ #pragma once -#include +#include "config_formats.h" #if USE_PROTOBUF #include diff --git a/dbms/src/Formats/ProtobufRowOutputStream.cpp b/dbms/src/Formats/ProtobufRowOutputStream.cpp index 791c419e150..dfa43a1c7e8 100644 --- a/dbms/src/Formats/ProtobufRowOutputStream.cpp +++ b/dbms/src/Formats/ProtobufRowOutputStream.cpp @@ -1,6 +1,6 @@ #include -#include +#include "config_formats.h" #if USE_PROTOBUF #include "ProtobufRowOutputStream.h" diff --git a/dbms/src/Formats/ProtobufSchemas.cpp b/dbms/src/Formats/ProtobufSchemas.cpp index c443ea221c6..377fd5ee0c2 100644 --- a/dbms/src/Formats/ProtobufSchemas.cpp +++ b/dbms/src/Formats/ProtobufSchemas.cpp @@ -1,4 +1,4 @@ -#include +#include "config_formats.h" #if USE_PROTOBUF #include diff --git a/dbms/src/Formats/ProtobufSchemas.h b/dbms/src/Formats/ProtobufSchemas.h index cfc414c1964..6a806de2213 100644 --- a/dbms/src/Formats/ProtobufSchemas.h +++ b/dbms/src/Formats/ProtobufSchemas.h @@ -1,6 +1,6 @@ #pragma once -#include +#include "config_formats.h" #if USE_PROTOBUF #include diff --git a/dbms/src/Formats/ProtobufWriter.cpp b/dbms/src/Formats/ProtobufWriter.cpp index dd4ba7ff6df..bca3449cb59 100644 --- a/dbms/src/Formats/ProtobufWriter.cpp +++ b/dbms/src/Formats/ProtobufWriter.cpp @@ -1,6 +1,8 @@ -#include +#include "config_formats.h" #if USE_PROTOBUF +#include "ProtobufWriter.h" + #include #include #include @@ -11,7 +13,6 @@ #include #include #include -#include "ProtobufWriter.h" namespace DB diff --git a/dbms/src/Formats/ProtobufWriter.h b/dbms/src/Formats/ProtobufWriter.h index aba3a2b2dc6..d133a8b1214 100644 --- a/dbms/src/Formats/ProtobufWriter.h +++ b/dbms/src/Formats/ProtobufWriter.h @@ -4,7 +4,7 @@ #include #include -#include +#include "config_formats.h" #if USE_PROTOBUF #include diff --git a/dbms/src/Formats/config_formats.h.in b/dbms/src/Formats/config_formats.h.in new file mode 100644 index 00000000000..7837bed56d0 --- /dev/null +++ b/dbms/src/Formats/config_formats.h.in @@ -0,0 +1,8 @@ +#pragma once + +// .h autogenerated by cmake! + +#cmakedefine01 USE_CAPNP +#cmakedefine01 USE_SNAPPY +#cmakedefine01 USE_PARQUET +#cmakedefine01 USE_PROTOBUF diff --git a/dbms/src/Functions/CMakeLists.txt b/dbms/src/Functions/CMakeLists.txt index 3b63437ab99..e62a117c88e 100644 --- a/dbms/src/Functions/CMakeLists.txt +++ b/dbms/src/Functions/CMakeLists.txt @@ -1,3 +1,6 @@ +include (${ClickHouse_SOURCE_DIR}/cmake/find_gperf.cmake) +configure_file(config_functions.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/config_functions.h) + include(${ClickHouse_SOURCE_DIR}/cmake/dbms_glob_sources.cmake) add_headers_and_sources(clickhouse_functions ./GatherUtils) @@ -6,7 +9,7 @@ add_headers_and_sources(clickhouse_functions .) if (USE_GPERF) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tldLookup.cpp - COMMAND ${GPERF} ${CMAKE_CURRENT_SOURCE_DIR}/gperf/tldLookup.gperf --output-file=${CMAKE_CURRENT_BINARY_DIR}/tldLookup.cpp + COMMAND ${GPERF} ${CMAKE_CURRENT_SOURCE_DIR}/tldLookup.gperf --output-file=${CMAKE_CURRENT_BINARY_DIR}/tldLookup.cpp ) list(APPEND clickhouse_functions_sources ${CMAKE_CURRENT_BINARY_DIR}/tldLookup.cpp) @@ -34,7 +37,8 @@ if (OPENSSL_CRYPTO_LIBRARY) target_link_libraries(clickhouse_functions PUBLIC ${OPENSSL_CRYPTO_LIBRARY}) endif() -target_include_directories (clickhouse_functions SYSTEM BEFORE PUBLIC ${DIVIDE_INCLUDE_DIR} ${METROHASH_INCLUDE_DIR}) +target_include_directories(clickhouse_functions PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/include) +target_include_directories(clickhouse_functions SYSTEM BEFORE PUBLIC ${DIVIDE_INCLUDE_DIR} ${METROHASH_INCLUDE_DIR}) if (CONSISTENT_HASHING_INCLUDE_DIR) target_include_directories (clickhouse_functions PRIVATE ${CONSISTENT_HASHING_INCLUDE_DIR}) diff --git a/dbms/src/Functions/FunctionBase64Conversion.h b/dbms/src/Functions/FunctionBase64Conversion.h index 5ee6ff8f257..01427212cfa 100644 --- a/dbms/src/Functions/FunctionBase64Conversion.h +++ b/dbms/src/Functions/FunctionBase64Conversion.h @@ -1,4 +1,4 @@ -#include +#include "config_functions.h" #if USE_BASE64 #include #include diff --git a/dbms/src/Functions/FunctionMathBinaryFloat64.h b/dbms/src/Functions/FunctionMathBinaryFloat64.h index af7c8f97eff..c45f4a63814 100644 --- a/dbms/src/Functions/FunctionMathBinaryFloat64.h +++ b/dbms/src/Functions/FunctionMathBinaryFloat64.h @@ -8,7 +8,7 @@ #include #include #include -#include +#include "config_functions.h" /** More efficient implementations of mathematical functions are possible when using a separate library. * Disabled due to license compatibility limitations. diff --git a/dbms/src/Functions/FunctionMathUnaryFloat64.h b/dbms/src/Functions/FunctionMathUnaryFloat64.h index 82ae17a0bb6..04452ab3477 100644 --- a/dbms/src/Functions/FunctionMathUnaryFloat64.h +++ b/dbms/src/Functions/FunctionMathUnaryFloat64.h @@ -7,7 +7,7 @@ #include #include #include -#include +#include "config_functions.h" /** More efficient implementations of mathematical functions are possible when using a separate library. * Disabled due to license compatibility limitations. diff --git a/dbms/src/Functions/FunctionsHashing.cpp b/dbms/src/Functions/FunctionsHashing.cpp index 3f16d07f3df..90b1057ce63 100644 --- a/dbms/src/Functions/FunctionsHashing.cpp +++ b/dbms/src/Functions/FunctionsHashing.cpp @@ -1,7 +1,6 @@ -#include -#include -#include +#include "FunctionsHashing.h" +#include namespace DB { diff --git a/dbms/src/Functions/FunctionsHashing.h b/dbms/src/Functions/FunctionsHashing.h index 9fa5168e695..fc0d72beae3 100644 --- a/dbms/src/Functions/FunctionsHashing.h +++ b/dbms/src/Functions/FunctionsHashing.h @@ -10,11 +10,12 @@ #include #include -#include +#include "config_functions.h" #if USE_XXHASH # include #endif +#include #if USE_SSL # include # include diff --git a/dbms/src/Functions/FunctionsJSON.h b/dbms/src/Functions/FunctionsJSON.h index 8bf69e6c7d7..5781ca4a9fb 100644 --- a/dbms/src/Functions/FunctionsJSON.h +++ b/dbms/src/Functions/FunctionsJSON.h @@ -4,7 +4,7 @@ #include #include #include -#include +#include "config_functions.h" #include #include #include diff --git a/dbms/src/Functions/FunctionsStringRegex.cpp b/dbms/src/Functions/FunctionsStringRegex.cpp index 4abdae40d19..ee619f20fdd 100644 --- a/dbms/src/Functions/FunctionsStringRegex.cpp +++ b/dbms/src/Functions/FunctionsStringRegex.cpp @@ -1,6 +1,6 @@ #include "FunctionsStringRegex.h" -#include "FunctionsStringSearch.h" +#include "FunctionsStringSearch.h" #include #include #include @@ -10,14 +10,13 @@ #include #include #include - #include #include #include #include #include -#include +#include "config_functions.h" #if USE_HYPERSCAN # if __has_include() # include @@ -26,6 +25,7 @@ # endif #endif +#include #if USE_RE2_ST # include #else diff --git a/dbms/src/Functions/IFunction.cpp b/dbms/src/Functions/IFunction.cpp index 527562d825b..f792c40f400 100644 --- a/dbms/src/Functions/IFunction.cpp +++ b/dbms/src/Functions/IFunction.cpp @@ -1,3 +1,5 @@ +#include "IFunction.h" + #include #include #include @@ -13,7 +15,6 @@ #include #include #include -#include #include #include #include diff --git a/dbms/src/Functions/RapidJSONParser.h b/dbms/src/Functions/RapidJSONParser.h index 930f0e4b063..9ffa355b9a9 100644 --- a/dbms/src/Functions/RapidJSONParser.h +++ b/dbms/src/Functions/RapidJSONParser.h @@ -1,6 +1,6 @@ #pragma once -#include +#include "config_functions.h" #if USE_RAPIDJSON #include diff --git a/dbms/src/Functions/Regexps.h b/dbms/src/Functions/Regexps.h index 164f8718cf0..ce81e62ac69 100644 --- a/dbms/src/Functions/Regexps.h +++ b/dbms/src/Functions/Regexps.h @@ -15,7 +15,7 @@ #include -#include +#include "config_functions.h" #if USE_HYPERSCAN # if __has_include() # include diff --git a/dbms/src/Functions/SimdJSONParser.h b/dbms/src/Functions/SimdJSONParser.h index c8e71491ae1..ef43e571635 100644 --- a/dbms/src/Functions/SimdJSONParser.h +++ b/dbms/src/Functions/SimdJSONParser.h @@ -1,6 +1,6 @@ #pragma once -#include +#include "config_functions.h" #if USE_SIMDJSON #include diff --git a/dbms/src/Functions/base64Decode.cpp b/dbms/src/Functions/base64Decode.cpp index a420428b797..35c74ebc041 100644 --- a/dbms/src/Functions/base64Decode.cpp +++ b/dbms/src/Functions/base64Decode.cpp @@ -1,6 +1,6 @@ -#include #include #if USE_BASE64 +#include #include namespace DB diff --git a/dbms/src/Functions/config_functions.h.in b/dbms/src/Functions/config_functions.h.in new file mode 100644 index 00000000000..72ae6d6e2f6 --- /dev/null +++ b/dbms/src/Functions/config_functions.h.in @@ -0,0 +1,11 @@ +#pragma once + +// .h autogenerated by cmake! + +#cmakedefine01 USE_VECTORCLASS +#cmakedefine01 USE_BASE64 +#cmakedefine01 USE_XXHASH +#cmakedefine01 USE_HYPERSCAN +#cmakedefine01 USE_SIMDJSON +#cmakedefine01 USE_RAPIDJSON +#cmakedefine01 USE_GPERF diff --git a/dbms/src/Functions/exp10.cpp b/dbms/src/Functions/exp10.cpp index caf949e0c62..158fa0a88d1 100644 --- a/dbms/src/Functions/exp10.cpp +++ b/dbms/src/Functions/exp10.cpp @@ -1,6 +1,8 @@ #include #include -#include +#if !USE_VECTORCLASS +# include +#endif namespace DB { diff --git a/dbms/src/Functions/firstSignificantSubdomain.h b/dbms/src/Functions/firstSignificantSubdomain.h index 0f56e344755..4765abb30c3 100644 --- a/dbms/src/Functions/firstSignificantSubdomain.h +++ b/dbms/src/Functions/firstSignificantSubdomain.h @@ -1,11 +1,8 @@ #pragma once -#include #include -#include -#if USE_GPERF -# include -#endif +#include "domain.h" +#include "tldLookup.h" namespace DB { diff --git a/dbms/src/Functions/registerFunctionsString.cpp b/dbms/src/Functions/registerFunctionsString.cpp index 7b4bc9d25af..e55e43ba2f9 100644 --- a/dbms/src/Functions/registerFunctionsString.cpp +++ b/dbms/src/Functions/registerFunctionsString.cpp @@ -1,4 +1,4 @@ -#include +#include "config_functions.h" namespace DB { diff --git a/dbms/src/Functions/gperf/tldLookup.gperf b/dbms/src/Functions/tldLookup.gperf similarity index 100% rename from dbms/src/Functions/gperf/tldLookup.gperf rename to dbms/src/Functions/tldLookup.gperf diff --git a/dbms/src/Functions/tldLookup.h b/dbms/src/Functions/tldLookup.h index 1b04580d07a..399243a984a 100644 --- a/dbms/src/Functions/tldLookup.h +++ b/dbms/src/Functions/tldLookup.h @@ -1,6 +1,6 @@ #pragma once -#include +#include "config_functions.h" #if USE_GPERF // Definition of the class generated by gperf, present on gperf/tldLookup.gperf class tldLookupHash diff --git a/dbms/src/Functions/tryBase64Decode.cpp b/dbms/src/Functions/tryBase64Decode.cpp index 0ade3563110..b43ab2cbeea 100644 --- a/dbms/src/Functions/tryBase64Decode.cpp +++ b/dbms/src/Functions/tryBase64Decode.cpp @@ -1,6 +1,6 @@ -#include #include #if USE_BASE64 +#include #include namespace DB diff --git a/dbms/src/Storages/System/StorageSystemBuildOptions.generated.cpp.in b/dbms/src/Storages/System/StorageSystemBuildOptions.generated.cpp.in index 758408114a8..0cce8fe6be0 100644 --- a/dbms/src/Storages/System/StorageSystemBuildOptions.generated.cpp.in +++ b/dbms/src/Storages/System/StorageSystemBuildOptions.generated.cpp.in @@ -61,6 +61,7 @@ const char * auto_config_build[] "USE_SSL", "@USE_SSL@", "USE_HYPERSCAN", "@USE_HYPERSCAN@", "USE_SIMDJSON", "@USE_SIMDJSON@", + "USE_GPERF", "@USE_GPERF@", nullptr, nullptr }; diff --git a/dbms/tests/clickhouse-test b/dbms/tests/clickhouse-test index f9b6cca9e02..8e4e0bcb8fc 100755 --- a/dbms/tests/clickhouse-test +++ b/dbms/tests/clickhouse-test @@ -443,7 +443,7 @@ if __name__ == '__main__': parser.add_argument('--force-color', action='store_true', default=False) parser.add_argument('--database', help='Database for tests (random name test_XXXXXX by default)') parser.add_argument('--parallel', default='1/1', help='One parallel test run number/total') - parser.add_argument('-j', '--jobs', default=1, help='Run all tests in parallel', type=int) # default=multiprocessing.cpu_count() + parser.add_argument('-j', '--jobs', default=1, nargs='?', type=int, help='Run all tests in parallel') parser.add_argument('--no-stateless', action='store_true', help='Disable all stateless tests') parser.add_argument('--no-stateful', action='store_true', help='Disable all stateful tests') @@ -507,4 +507,7 @@ if __name__ == '__main__': else: args.extract_from_config = args.binary + ' extract-from-config' + if args.jobs is None: + args.jobs=multiprocessing.cpu_count() + main(args)