Skip to content

Commit

Permalink
Merge pull request #3888 from sysown/v2.4-clickhouse
Browse files Browse the repository at this point in the history
Upgraded clickhouse-cpp to 2.1.0
  • Loading branch information
renecannao authored Jul 22, 2022
2 parents 2c8ac95 + 8cca479 commit 2a5f364
Show file tree
Hide file tree
Showing 28 changed files with 1,308 additions and 294 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ deps/libhttpserver/libhttpserver-master_20191121/
deps/libhttpserver/libhttpserver-0.18.1/

#clickhouse
deps/clickhouse-cpp/clickhouse-cpp/
deps/clickhouse-cpp/clickhouse-cpp-*
deps/cityhash/cityhash/
deps/lz4/lz4-1.7.5/
deps/lz4/lz4/
Expand Down
43 changes: 35 additions & 8 deletions deps/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/make -f


UNAME_S := $(shell uname -s)
UNAME_MS := $(word 2, $(shell uname -ms))
Expand Down Expand Up @@ -35,6 +37,24 @@ endif

endif


# determine good compiler version for stdc++17
IS_CXX17 := 0
ifeq ($(CXX),clang++)
CLANG_VERSION := $(shell clang -dumpversion | tr '.' ' ' | awk '{ printf("%04d.%04d.%04d", $$1, $$2, $$3) }')
CLANG_MIN_VER := $(shell echo 14.0 | tr '.' ' ' | awk '{ printf("%04d.%04d.%04d", $$1, $$2, $$3) }')
ifeq ($(CLANG_MIN_VER),$(firstword $(sort $(CLANG_VERSION) $(CLANG_MIN_VER))))
IS_CXX17 := 1
endif
else
GCC_VERSION := $(shell gcc -dumpversion | tr '.' ' ' | awk '{ printf("%04d.%04d.%04d", $$1, $$2, $$3) }')
GCC_MIN_VER := $(shell echo 8.2.0 | tr '.' ' ' | awk '{ printf("%04d.%04d.%04d", $$1, $$2, $$3) }')
ifeq ($(GCC_MIN_VER),$(firstword $(sort $(GCC_VERSION) $(GCC_MIN_VER))))
IS_CXX17 := 1
endif
endif


PROXYSQLCLICKHOUSE := $(shell echo $(PROXYSQLCLICKHOUSE))
ifeq ($(PROXYSQLCLICKHOUSE),1)
default: libconfig libdaemon jemalloc mariadb_client re2 sqlite3 pcre clickhouse-cpp lz4 cityhash microhttpd curl ev libssl libhttpserver libinjection prometheus-cpp
Expand Down Expand Up @@ -140,17 +160,24 @@ lz4/lz4/liblz4.a:
cd lz4/lz4 && CC=${CC} CXX=${CXX} ${MAKE}
lz4: lz4/lz4/liblz4.a

clickhouse-cpp/clickhouse-cpp/clickhouse/libclickhouse-cpp-lib.a:
cd clickhouse-cpp && rm -rf clickhouse-cpp/ || true
cd clickhouse-cpp && tar -zxf clickhouse-cpp.tar.gz
ifeq ($(CXX),clang++)
cd clickhouse-cpp/clickhouse-cpp && sed -i 's/"-O2 -pthread -Wall -Wextra -Werror"/"-O2 -pthread -Wall -Wextra -Werror -Wno-deprecated-copy"/' CMakeLists.txt

clickhouse-cpp/clickhouse-cpp/clickhouse/libclickhouse-cpp-lib-static.a:
ifeq ($(IS_CXX17), 1)
echo ">>> Clickhouse CXX17"
cd clickhouse-cpp && ln -fs clickhouse-cpp-2.1.0 clickhouse-cpp
cd clickhouse-cpp && rm -rf clickhouse-cpp-*/ || true
cd clickhouse-cpp && tar -zxf v2.1.0.tar.gz
else
echo ">>> Clickhouse CXX11"
cd clickhouse-cpp && ln -fs clickhouse-cpp-1.0.0 clickhouse-cpp
cd clickhouse-cpp && rm -rf clickhouse-cpp-*/ || true
cd clickhouse-cpp && tar -zxf v1.0.0.tar.gz
cd clickhouse-cpp && sed -i 's/SET (CMAKE_CXX_STANDARD_REQUIRED ON)//' clickhouse-cpp/cmake/cpp17.cmake
endif
cd clickhouse-cpp/clickhouse-cpp && cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .
cd clickhouse-cpp/clickhouse-cpp && patch clickhouse/columns/column.h < ../column.h.diff
cd clickhouse-cpp/clickhouse-cpp && CC=${CC} CXX=${CXX} ${MAKE}

clickhouse-cpp: clickhouse-cpp/clickhouse-cpp/clickhouse/libclickhouse-cpp-lib.a
clickhouse-cpp: clickhouse-cpp/clickhouse-cpp/clickhouse/libclickhouse-cpp-lib-static.a


libdaemon/libdaemon/libdaemon/.libs/libdaemon.a:
Expand Down Expand Up @@ -281,7 +308,7 @@ cleanall:
cd re2 && rm -rf re2-*/ || true
cd pcre && rm -rf pcre-*/ || true
cd sqlite3 && rm -rf sqlite-amalgamation-*/ || true
cd clickhouse-cpp/ && rm -rf clickhouse-cpp/ || true
cd clickhouse-cpp/ && rm -rf clickhouse-cpp-* || true
cd lz4 && rm -rf lz4-*/ || true
cd libmicrohttpd && rm -rf libmicrohttpd-*/ || true
cd libmicrohttpd && rm -f libmicrohttpd || true
Expand Down
1 change: 1 addition & 0 deletions deps/clickhouse-cpp/clickhouse-cpp
Binary file removed deps/clickhouse-cpp/clickhouse-cpp.tar.gz
Binary file not shown.
9 changes: 0 additions & 9 deletions deps/clickhouse-cpp/column.h.diff

This file was deleted.

Binary file added deps/clickhouse-cpp/v1.0.0.tar.gz
Binary file not shown.
Binary file added deps/clickhouse-cpp/v2.1.0.tar.gz
Binary file not shown.
Loading

0 comments on commit 2a5f364

Please sign in to comment.