Skip to content

Commit

Permalink
v1.0.1-hotfix1 arm version
Browse files Browse the repository at this point in the history
  • Loading branch information
frankye1982 committed Dec 10, 2024
1 parent c4b08eb commit 122b90b
Show file tree
Hide file tree
Showing 13 changed files with 69 additions and 19 deletions.
14 changes: 7 additions & 7 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@
url = https://github.com/ClickHouse-Extras/libcxx.git
[submodule "contrib/libcxxabi"]
path = contrib/libcxxabi
url = git@github.com:ByConity/clickhouse-libcxxabi.git
url = https://github.com/ByConity/clickhouse-libcxxabi.git
[submodule "contrib/snappy"]
path = contrib/snappy
url = https://github.com/google/snappy
url = https://github.com/google/snappy.git
[submodule "contrib/cppkafka"]
path = contrib/cppkafka
url = https://github.com/mfontanini/cppkafka.git
Expand Down Expand Up @@ -262,7 +262,7 @@
url = https://github.com/gflags/gflags.git
[submodule "contrib/libhdfs3-open"]
path = contrib/libhdfs3-open
url = https://github.com/ByConity/libhdfs3-open.git
url = https://github.com/frankye1982/libhdfs3-open.git
[submodule "contrib/boost"]
path = contrib/boost
url = https://github.com/ClickHouse-Extras/boost.git
Expand Down Expand Up @@ -328,16 +328,16 @@
url = https://github.com/ClickHouse/libstemmer_c.git
[submodule "contrib/wordnet-blast"]
path = contrib/wordnet-blast
url = https://github.com/ClickHouse/wordnet-blast
url = https://github.com/ClickHouse/wordnet-blast.git
[submodule "contrib/lemmagen-c"]
path = contrib/lemmagen-c
url = https://github.com/ClickHouse/lemmagen-c
url = https://github.com/ClickHouse/lemmagen-c.git
[submodule "contrib/cld2"]
path = contrib/cld2
url = https://github.com/ClickHouse/cld2
url = https://github.com/ClickHouse/cld2.git
[submodule "contrib/nlp-data"]
path = contrib/nlp-data
url = https://github.com/ClickHouse/nlp-data
url = https://github.com/ClickHouse/nlp-data.git
[submodule "contrib/libdeflate"]
path = contrib/libdeflate
url = https://github.com/ByConity/libdeflate.git
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ endforeach()

project(ClickHouse)


execute_process(COMMAND llvm-config --cxxflags --libs
OUTPUT_VARIABLE LLVM_FLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE)
add_compile_options(${LLVM_FLAGS})
add_link_options(${LLVM_FLAGS})
add_compile_definitions(LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING=1)


# If turned off: e.g. when ENABLE_FOO is ON, but FOO tool was not found, the CMake will continue.
option(FAIL_ON_UNSUPPORTED_OPTIONS_COMBINATION
"Stop/Fail CMake configuration if some ENABLE_XXX option is defined (either ON or OFF)
Expand Down
10 changes: 10 additions & 0 deletions base/common/itoa.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ struct SelectType<1, T, Ts...>
};


// Add a specialized template to handle the case where N is 0. Although the program intention is
//that 0 will not appear, but logic such as 4, 8, 16, 32, 64,
//an error "error: too few template arguments" will be reported on the ARM compiler. for class template 'SelectType'" ,
// it is necessary to add 0, although this situation is actually impossible
template <typename T, typename... Ts>
struct SelectType<0, T, Ts...>
{
using Result = T;
};

/// Division by 10^N where N is the size of the type.
template <size_t N>
using DivisionBy10PowN = typename SelectType
Expand Down
2 changes: 1 addition & 1 deletion cmake/find/hdfs3.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if(NOT ARCH_ARM AND NOT OS_FREEBSD AND NOT APPLE AND USE_PROTOBUF AND NOT ARCH_PPC64LE)
if(NOT OS_FREEBSD AND NOT APPLE AND USE_PROTOBUF AND NOT ARCH_PPC64LE)
option(ENABLE_HDFS "Enable HDFS" ${ENABLE_LIBRARIES})
elseif(ENABLE_HDFS OR USE_INTERNAL_HDFS3_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot use HDFS3 with current configuration")
Expand Down
4 changes: 2 additions & 2 deletions cmake/version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ if (VERSION_EXTRA)
string(CONCAT VERSION_STRING ${VERSION_STRING} "." ${VERSION_EXTRA})
endif ()

set (VERSION_NAME "ByConity")
set (VERSION_NAME ByConity)
set (VERSION_FULL "${VERSION_NAME} ${VERSION_STRING}")
set (VERSION_SO "${VERSION_STRING}")
set (VERSION_STRING_SHORT "${VERSION_MAJOR}.${VERSION_MINOR}")

set (VERSION_SCM 1.0.0.0)
set (VERSION_SCM latest)
set (KERNEL_VERSION "")

# Get the latest abbreviated commit hash of the working branch
Expand Down
2 changes: 1 addition & 1 deletion contrib/librdkafka-cmake/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
#cmakedefine WITH_SASL_OAUTHBEARER 1
#cmakedefine WITH_SASL_CYRUS 1
// crc32chw
#if !defined(__PPC__) && (!defined(__aarch64__) || defined(__ARM_FEATURE_CRC32)) && !(defined(__aarch64__) && defined(__APPLE__))
#if !defined(__PPC__) && (!defined(__aarch64__)) && !(defined(__aarch64__) && defined(__APPLE__))
#define WITH_CRC32C_HW 1
#endif
// regex
Expand Down
19 changes: 14 additions & 5 deletions docker/debian/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@ FROM alpine as downloader
ARG FDB_VERSION=7.1.27
WORKDIR /downloads
RUN apk --no-cache add wget
RUN wget -qO cmake.3.17.tar.gz https://cmake.org/files/v3.17/cmake-3.17.0-Linux-x86_64.tar.gz
RUN if [ "$(uname -m)" = "x86_64" ]; then \
wget -qO cmake.3.17.tar.gz https://cmake.org/files/v3.17/cmake-3.17.0-Linux-x86_64.tar.gz; \
fi
# RUN wget https://apt.llvm.org/llvm.sh
RUN wget -q https://mirrors.tuna.tsinghua.edu.cn/llvm-apt/llvm.sh
RUN wget -qO foundationdb-clients.deb https://github.com/apple/foundationdb/releases/download/${FDB_VERSION}/foundationdb-clients_${FDB_VERSION}-1_amd64.deb
RUN if [ "$(uname -m)" = "aarch64" ]; then \
wget -qO foundationdb-clients.deb https://github.com/frankye1982/fdb-build-support/releases/download/v1.0-arm/foundationdb-clients_7.1.27-1_aarch64.deb; \
else \
wget -qO foundationdb-clients.deb https://github.com/apple/foundationdb/releases/download/${FDB_VERSION}/foundationdb-clients_${FDB_VERSION}-1_amd64.deb; \
fi
RUN wget -qO tini https://github.com/krallin/tini/releases/download/v0.19.0/tini

# Debian builder
Expand All @@ -18,13 +24,16 @@ RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
binutils gettext-base strace bpftrace sysstat gdb maven default-jdk ninja-build \
lsb-release wget curl software-properties-common gnupg ccache git vim zlib1g-dev \
autoconf automake m4 bison flex \
autoconf automake m4 bison flex && \
if [ "$(uname -m)" = "aarch64" ]; then apt-get install --no-install-recommends -y cmake; fi \
&& rm -rf /var/lib/apt/lists/*

COPY --from=downloader /downloads /downloads
WORKDIR /downloads
RUN tar --strip-components=1 -xzf cmake.3.17.tar.gz -C /usr/local
RUN chmod +x llvm.sh && ./llvm.sh 11 -m https://mirrors.tuna.tsinghua.edu.cn/llvm-apt
RUN if [ "$(uname -m)" = "x86_64" ]; then \
tar --strip-components=1 -xzf cmake.3.17.tar.gz -C /usr/local; \
fi
RUN chmod +x llvm.sh && ./llvm.sh 11
RUN dpkg -i foundationdb-clients.deb
RUN rm -rf /downloads

Expand Down
15 changes: 15 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
set (ENABLE_EMBEDDED_COMPILER 0)
set (USE_EMBEDDED_COMPILER 0)
#add_compile_definitions(USE_EMBEDDED_COMPILER=0)
#add_compile_definitions(LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING)
#add_compile_definitions(LLVM_ENABLE_ABI_BREAKING_CHECKS)

add_compile_definitions(LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING=1)

execute_process(COMMAND llvm-config --cxxflags --libs
OUTPUT_VARIABLE LLVM_FLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE)
add_compile_options(${LLVM_FLAGS})
add_link_options(${LLVM_FLAGS})


if (USE_INCLUDE_WHAT_YOU_USE)
set (CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${IWYU_PATH})
endif ()
Expand Down
5 changes: 5 additions & 0 deletions src/Functions/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
set (ENABLE_EMBEDDED_COMPILER 0)
set (USE_EMBEDDED_COMPILER 0)
add_compile_definitions(USE_EMBEDDED_COMPILER=0)
add_compile_definitions(ENABLE_EMBEDDED_COMPILER=0)

configure_file(config_functions.h.in ${ConfigIncludePath}/config_functions.h)

add_subdirectory(divide)
Expand Down
2 changes: 2 additions & 0 deletions src/Functions/FunctionStringOrArrayToT.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include <Columns/ColumnsNumber.h>
#include <Interpreters/Context_fwd.h>

#undef USE_EMBEDDED_COMPILER


namespace DB
{
Expand Down
2 changes: 1 addition & 1 deletion src/Functions/array/length.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <Functions/FunctionHelpers.h>
#include <Functions/FunctionStringOrArrayToT.h>
#include <common/map.h>
#include <llvm/llvm/include/llvm/IR/IRBuilder.h>
#include <llvm/IR/IRBuilder.h>

namespace DB
{
Expand Down
2 changes: 1 addition & 1 deletion src/Interpreters/JIT/JITContext.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once
#include <vector>
#include <llvm/llvm/include/llvm/IR/Module.h>
#include <llvm/IR/Module.h>

namespace DB
{
Expand Down

0 comments on commit 122b90b

Please sign in to comment.