diff --git a/cmake/find/capnp.cmake b/cmake/find/capnp.cmake index 1ac6241a5f1..0620a66808b 100644 --- a/cmake/find/capnp.cmake +++ b/cmake/find/capnp.cmake @@ -4,6 +4,14 @@ if (ENABLE_CAPNP) option (USE_INTERNAL_CAPNP_LIBRARY "Set to FALSE to use system capnproto library instead of bundled" ${NOT_UNBUNDLED}) +if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/capnproto/CMakeLists.txt") + if(USE_INTERNAL_CAPNP_LIBRARY) + message(WARNING "submodule contrib/capnproto is missing. to fix try run: \n git submodule update --init --recursive") + endif() + set(MISSING_INTERNAL_CAPNP_LIBRARY 1) + set(USE_INTERNAL_CAPNP_LIBRARY 0) +endif() + # FIXME: refactor to use `add_library(… IMPORTED)` if possible. if (NOT USE_INTERNAL_CAPNP_LIBRARY) find_library (KJ kj) @@ -11,7 +19,7 @@ if (NOT USE_INTERNAL_CAPNP_LIBRARY) find_library (CAPNPC capnpc) set (CAPNP_LIBRARIES ${CAPNPC} ${CAPNP} ${KJ}) -else () +elseif(NOT MISSING_INTERNAL_CAPNP_LIBRARY) add_subdirectory(contrib/capnproto-cmake) set (CAPNP_LIBRARIES capnpc) @@ -23,4 +31,4 @@ endif () endif () -message (STATUS "Using capnp: ${CAPNP_LIBRARIES}") +message (STATUS "Using capnp=${USE_CAPNP}: ${CAPNP_LIBRARIES}") diff --git a/cmake/find/orc.cmake b/cmake/find/orc.cmake index 613016c6ba7..26253687c80 100644 --- a/cmake/find/orc.cmake +++ b/cmake/find/orc.cmake @@ -1,7 +1,8 @@ option (ENABLE_ORC "Enable ORC" ${ENABLE_LIBRARIES}) if(ENABLE_ORC) -option (USE_INTERNAL_ORC_LIBRARY "Set to FALSE to use system ORC instead of bundled" ${NOT_UNBUNDLED}) +include(cmake/find/snappy.cmake) +option(USE_INTERNAL_ORC_LIBRARY "Set to FALSE to use system ORC instead of bundled" ${NOT_UNBUNDLED}) if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/orc/c++/include/orc/OrcFile.hh") if(USE_INTERNAL_ORC_LIBRARY) @@ -25,7 +26,7 @@ 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) +elseif(NOT MISSING_INTERNAL_ORC_LIBRARY AND ARROW_LIBRARY AND SNAPPY_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) diff --git a/cmake/find/parquet.cmake b/cmake/find/parquet.cmake index 14332fc9caf..d302fd64e1e 100644 --- a/cmake/find/parquet.cmake +++ b/cmake/find/parquet.cmake @@ -24,7 +24,10 @@ endif() if(ARROW_INCLUDE_DIR AND PARQUET_INCLUDE_DIR) elseif(NOT MISSING_INTERNAL_PARQUET_LIBRARY AND NOT OS_FREEBSD) include(cmake/find/snappy.cmake) - set(CAN_USE_INTERNAL_PARQUET_LIBRARY 1) + if(SNAPPY_LIBRARY) + set(CAN_USE_INTERNAL_PARQUET_LIBRARY 1) + endif() + include(CheckCXXSourceCompiles) if(NOT USE_INTERNAL_DOUBLE_CONVERSION_LIBRARY) set(CMAKE_REQUIRED_LIBRARIES ${DOUBLE_CONVERSION_LIBRARIES}) diff --git a/cmake/find/unwind.cmake b/cmake/find/unwind.cmake index efa7618a53b..d3653973082 100644 --- a/cmake/find/unwind.cmake +++ b/cmake/find/unwind.cmake @@ -4,6 +4,11 @@ if (NOT CMAKE_SYSTEM MATCHES "Linux" OR ARCH_ARM OR ARCH_32) set (USE_UNWIND OFF) endif () +if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/libunwind/CMakeLists.txt") + message(WARNING "submodule contrib/libunwind is missing. to fix try run: \n git submodule update --init --recursive") + set (USE_UNWIND OFF) +endif () + if (USE_UNWIND) add_subdirectory(contrib/libunwind-cmake) set (UNWIND_LIBRARIES unwind) diff --git a/dbms/CMakeLists.txt b/dbms/CMakeLists.txt index c70f3d8a068..1d5f4af645b 100644 --- a/dbms/CMakeLists.txt +++ b/dbms/CMakeLists.txt @@ -425,6 +425,11 @@ endif() if (USE_JEMALLOC) dbms_target_include_directories (SYSTEM BEFORE PRIVATE ${JEMALLOC_INCLUDE_DIR}) # used in Interpreters/AsynchronousMetrics.cpp target_include_directories (clickhouse_new_delete SYSTEM BEFORE PRIVATE ${JEMALLOC_INCLUDE_DIR}) + + if(NOT MAKE_STATIC_LIBRARIES AND ${JEMALLOC_LIBRARIES} MATCHES "${CMAKE_STATIC_LIBRARY_SUFFIX}$") + # mallctl in dbms/src/Interpreters/AsynchronousMetrics.cpp + target_link_libraries(clickhouse_interpreters PRIVATE ${JEMALLOC_LIBRARIES}) + endif() endif () dbms_target_include_directories (PUBLIC ${DBMS_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src/Formats/include) diff --git a/utils/build/build_no_submodules.sh b/utils/build/build_no_submodules.sh index 63349882128..fae10ab3270 100755 --- a/utils/build/build_no_submodules.sh +++ b/utils/build/build_no_submodules.sh @@ -7,7 +7,7 @@ CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) cd ${CUR_DIR}/../.. BRANCH=`git rev-parse --abbrev-ref HEAD` BRANCH=${BRANCH:=master} -ROOT_DIR=${CUR_DIR}/../build_no_submodules +ROOT_DIR=${CUR_DIR}/../../build_no_submodules mkdir -p $ROOT_DIR cd $ROOT_DIR URL=`git remote get-url origin | sed 's/.git$//'`