mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Compile and likk optimize and fixes
This commit is contained in:
parent
0d3c4f4d67
commit
6ff1968196
@ -75,7 +75,7 @@ if (USE_STATIC_LIBRARIES)
|
||||
list(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES)
|
||||
endif ()
|
||||
|
||||
if (CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*")
|
||||
if (CMAKE_LIBRARY_ARCHITECTURE MATCHES "amd64.*|x86_64.*|AMD64.*")
|
||||
option (USE_INTERNAL_MEMCPY "Use internal implementation of 'memcpy' function instead of provided by libc. Only for x86_64." ON)
|
||||
|
||||
if (CMAKE_SYSTEM MATCHES "Linux")
|
||||
|
@ -8,7 +8,7 @@ if (NOT ZLIB_FOUND)
|
||||
set (USE_INTERNAL_ZLIB_LIBRARY 1)
|
||||
set (ZLIB_COMPAT 1) # for zlib-ng, also enables WITH_GZFILEOP
|
||||
set (WITH_NATIVE_INSTRUCTIONS ${ARCHNATIVE})
|
||||
if (CMAKE_SYSTEM MATCHES "FreeBSD")
|
||||
if (CMAKE_SYSTEM MATCHES "FreeBSD" OR ARCH_I386)
|
||||
set (WITH_OPTIM 0 CACHE INTERNAL "") # Bug in assembler
|
||||
endif ()
|
||||
set (ZLIB_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/zlib-ng" "${ClickHouse_BINARY_DIR}/contrib/zlib-ng") # generated zconf.h
|
||||
|
@ -37,7 +37,8 @@ add_library (tcmalloc_minimal_internal
|
||||
./src/memory_region_map.cc
|
||||
)
|
||||
|
||||
target_compile_options (tcmalloc_minimal_internal PUBLIC
|
||||
|
||||
target_compile_options (tcmalloc_minimal_internal
|
||||
-DNO_TCMALLOC_SAMPLES
|
||||
-DNDEBUG
|
||||
-DNO_FRAME_POINTER
|
||||
@ -47,6 +48,8 @@ target_compile_options (tcmalloc_minimal_internal PUBLIC
|
||||
-Wno-deprecated-declarations
|
||||
-Wno-unused-function
|
||||
-Wno-unused-private-field
|
||||
|
||||
PUBLIC
|
||||
-fno-builtin-malloc
|
||||
-fno-builtin-free
|
||||
-fno-builtin-realloc
|
||||
|
@ -26,6 +26,6 @@ list(REMOVE_ITEM clickhouse_aggregate_functions_headers
|
||||
parseAggregateFunctionParameters.h
|
||||
)
|
||||
|
||||
add_library(clickhouse_aggregate_functions ${SPLIT_SHARED} ${clickhouse_aggregate_functions_sources})
|
||||
add_library(clickhouse_aggregate_functions ${clickhouse_aggregate_functions_sources})
|
||||
target_link_libraries(clickhouse_aggregate_functions dbms)
|
||||
target_include_directories (clickhouse_aggregate_functions BEFORE PRIVATE ${COMMON_INCLUDE_DIR})
|
||||
|
@ -70,7 +70,7 @@ add_headers_and_sources(clickhouse_functions ${ClickHouse_BINARY_DIR}/dbms/src/F
|
||||
list(REMOVE_ITEM clickhouse_functions_sources IFunction.cpp FunctionFactory.cpp DataTypeTraits.cpp FunctionHelpers.cpp)
|
||||
list(REMOVE_ITEM clickhouse_functions_headers IFunction.h FunctionFactory.h DataTypeTraits.h FunctionHelpers.h)
|
||||
|
||||
add_library(clickhouse_functions ${SPLIT_SHARED} ${clickhouse_functions_sources})
|
||||
add_library(clickhouse_functions ${clickhouse_functions_sources})
|
||||
target_link_libraries(clickhouse_functions dbms)
|
||||
target_include_directories (clickhouse_functions BEFORE PUBLIC ${ClickHouse_SOURCE_DIR}/contrib/libfarmhash)
|
||||
target_include_directories (clickhouse_functions BEFORE PUBLIC ${ClickHouse_SOURCE_DIR}/contrib/libmetrohash/src)
|
||||
|
@ -16,32 +16,32 @@ add_library(clickhouse-server
|
||||
TCPHandler.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(clickhouse-server daemon clickhouse_storages_system clickhouse_functions clickhouse_aggregate_functions clickhouse_table_functions)
|
||||
target_link_libraries(clickhouse-server clickhouse_common_io daemon clickhouse_storages_system clickhouse_functions clickhouse_aggregate_functions clickhouse_table_functions)
|
||||
target_include_directories (clickhouse-server PUBLIC ${ClickHouse_SOURCE_DIR}/libs/libdaemon/include)
|
||||
|
||||
add_library(clickhouse-local LocalServer.cpp)
|
||||
target_link_libraries(clickhouse-local dbms clickhouse-server clickhouse_functions clickhouse_aggregate_functions clickhouse_table_functions)
|
||||
target_link_libraries(clickhouse-local clickhouse-server clickhouse_functions clickhouse_aggregate_functions clickhouse_table_functions)
|
||||
|
||||
add_library(clickhouse-extract-from-config ExtractFromConfig.cpp)
|
||||
target_link_libraries(clickhouse-extract-from-config dbms ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
add_library(clickhouse-extract-from-config ${SPLIT_SHARED} ExtractFromConfig.cpp)
|
||||
target_link_libraries(clickhouse-extract-from-config clickhouse_common_io ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
|
||||
add_library (clickhouse-client Client.cpp)
|
||||
target_link_libraries (clickhouse-client dbms clickhouse_functions clickhouse_aggregate_functions ${LINE_EDITING_LIBS} ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
target_link_libraries (clickhouse-client clickhouse_functions clickhouse_aggregate_functions ${LINE_EDITING_LIBS} ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
install (FILES clickhouse-client.xml DESTINATION ${CLICKHOUSE_ETC_DIR}/clickhouse-client COMPONENT clickhouse-client RENAME config.xml)
|
||||
|
||||
add_library (clickhouse-benchmark Benchmark.cpp)
|
||||
target_link_libraries (clickhouse-benchmark dbms ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
add_library (clickhouse-benchmark ${SPLIT_SHARED} Benchmark.cpp)
|
||||
target_link_libraries (clickhouse-benchmark clickhouse_common_io ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
target_include_directories (clickhouse-benchmark PRIVATE ${PCG_RANDOM_INCLUDE_DIR})
|
||||
|
||||
add_library (clickhouse-performance-test PerformanceTest.cpp)
|
||||
target_link_libraries (clickhouse-performance-test dbms ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
add_library (clickhouse-performance-test ${SPLIT_SHARED} PerformanceTest.cpp)
|
||||
target_link_libraries (clickhouse-performance-test clickhouse_common_io ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
target_include_directories (clickhouse-performance-test PRIVATE ${PCG_RANDOM_INCLUDE_DIR})
|
||||
|
||||
add_library (clickhouse-compressor-lib Compressor.cpp)
|
||||
target_link_libraries (clickhouse-compressor-lib dbms ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
add_library (clickhouse-compressor-lib ${SPLIT_SHARED} Compressor.cpp)
|
||||
target_link_libraries (clickhouse-compressor-lib clickhouse_common_io ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
|
||||
add_library (clickhouse-format Format.cpp)
|
||||
target_link_libraries (clickhouse-format dbms ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
add_library (clickhouse-format ${SPLIT_SHARED} Format.cpp)
|
||||
target_link_libraries (clickhouse-format clickhouse_common_io ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
|
||||
if (USE_EMBEDDED_COMPILER)
|
||||
link_directories (${LLVM_LIBRARY_DIRS})
|
||||
@ -57,7 +57,9 @@ target_link_libraries(clickhouse
|
||||
clickhouse-performance-test
|
||||
clickhouse-extract-from-config
|
||||
clickhouse-compressor-lib
|
||||
clickhouse-format)
|
||||
clickhouse-format
|
||||
dbms
|
||||
)
|
||||
|
||||
if (USE_EMBEDDED_COMPILER)
|
||||
add_subdirectory (Compiler)
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
include(${ClickHouse_SOURCE_DIR}/cmake/dbms_glob_sources.cmake)
|
||||
add_headers_and_sources(storages_system .)
|
||||
add_library(clickhouse_storages_system ${SPLIT_SHARED} ${storages_system_headers} ${storages_system_sources})
|
||||
add_library(clickhouse_storages_system ${storages_system_headers} ${storages_system_sources})
|
||||
target_link_libraries(clickhouse_storages_system dbms)
|
||||
|
@ -4,5 +4,5 @@ add_headers_and_sources(clickhouse_table_functions .)
|
||||
list(REMOVE_ITEM clickhouse_table_functions_sources TableFunctionFactory.cpp)
|
||||
list(REMOVE_ITEM clickhouse_table_functions_headers ITableFunction.h TableFunctionFactory.h)
|
||||
|
||||
add_library(clickhouse_table_functions ${SPLIT_SHARED} ${clickhouse_table_functions_sources})
|
||||
add_library(clickhouse_table_functions ${clickhouse_table_functions_sources})
|
||||
target_link_libraries(clickhouse_table_functions dbms clickhouse_storages_system ${Poco_Foundation_LIBRARY})
|
||||
|
@ -1,2 +1,2 @@
|
||||
add_executable (check-marks main.cpp)
|
||||
target_link_libraries (check-marks dbms ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
target_link_libraries (check-marks clickhouse_common_io ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
|
@ -1,4 +1,4 @@
|
||||
add_executable (config-processor config-processor.cpp)
|
||||
target_link_libraries (config-processor dbms)
|
||||
target_link_libraries (config-processor clickhouse_common_io)
|
||||
|
||||
INSTALL(TARGETS config-processor RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT config-processor)
|
||||
|
@ -2,7 +2,6 @@
|
||||
add_executable(corrector_utf8 corrector_utf8.cpp)
|
||||
|
||||
# Link the executable to the library.
|
||||
target_link_libraries (corrector_utf8 dbms)
|
||||
add_dependencies(corrector_utf8 dbms)
|
||||
target_link_libraries (corrector_utf8 clickhouse_common_io)
|
||||
|
||||
install( TARGETS corrector_utf8 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT corrector_utf8)
|
||||
|
@ -1,2 +1,2 @@
|
||||
add_executable (fill-factor main.cpp)
|
||||
target_link_libraries (fill-factor dbms)
|
||||
target_link_libraries (fill-factor clickhouse_common_io)
|
||||
|
@ -1,11 +1,11 @@
|
||||
|
||||
add_executable (iotest iotest.cpp ${SRCS})
|
||||
target_link_libraries (iotest dbms)
|
||||
target_link_libraries (iotest clickhouse_common_io)
|
||||
|
||||
add_executable (iotest_nonblock iotest_nonblock.cpp ${SRCS})
|
||||
target_link_libraries (iotest_nonblock dbms)
|
||||
target_link_libraries (iotest_nonblock clickhouse_common_io)
|
||||
|
||||
if (NOT APPLE AND NOT CMAKE_SYSTEM MATCHES "FreeBSD")
|
||||
add_executable (iotest_aio iotest_aio.cpp ${SRCS})
|
||||
target_link_libraries (iotest_aio dbms)
|
||||
target_link_libraries (iotest_aio clickhouse_common_io)
|
||||
endif()
|
||||
|
@ -1,5 +1,5 @@
|
||||
add_executable (test-data-generator main.cpp)
|
||||
target_link_libraries (test-data-generator dbms ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
target_link_libraries (test-data-generator clickhouse_common_io ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
|
||||
add_executable (markov-model markov-model.cpp)
|
||||
target_link_libraries (markov-model dbms ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
target_link_libraries (markov-model clickhouse_common_io ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
|
@ -1,2 +1,2 @@
|
||||
add_executable (wikistat-loader main.cpp ${SRCS})
|
||||
target_link_libraries (wikistat-loader dbms ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
target_link_libraries (wikistat-loader clickhouse_common_io ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
|
@ -1,3 +1,3 @@
|
||||
add_executable(clickhouse-zookeeper-cli zookeeper-cli.cpp)
|
||||
target_link_libraries(clickhouse-zookeeper-cli dbms ${LINE_EDITING_LIBS})
|
||||
target_link_libraries(clickhouse-zookeeper-cli clickhouse_common_io ${LINE_EDITING_LIBS})
|
||||
INSTALL(TARGETS clickhouse-zookeeper-cli RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT clickhouse-utils)
|
||||
|
@ -1,2 +1,2 @@
|
||||
add_executable (zookeeper-dump-tree main.cpp ${SRCS})
|
||||
target_link_libraries (zookeeper-dump-tree dbms ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
target_link_libraries (zookeeper-dump-tree clickhouse_common_io ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
|
@ -1,2 +1,2 @@
|
||||
add_executable (zookeeper-remove-by-list main.cpp ${SRCS})
|
||||
target_link_libraries (zookeeper-remove-by-list dbms ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
target_link_libraries (zookeeper-remove-by-list clickhouse_common_io ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
|
Loading…
Reference in New Issue
Block a user