Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions c/clickhouse/clickhouse-v25.8.16.34-lts.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
diff --git a/cmake/cpu_features.cmake b/cmake/cpu_features.cmake
index fa58a739611..a8a495d0389 100644
--- a/cmake/cpu_features.cmake
+++ b/cmake/cpu_features.cmake
@@ -116,10 +116,10 @@ elseif (ARCH_PPC64LE)
# Note that gcc and clang have support for x86 SSE2 intrinsics when building for PowerPC
option (POWER9 "Build for Power 9 CPU and above" 0)
if(POWER9)
- set (COMPILER_FLAGS "${COMPILER_FLAGS} -maltivec -mcpu=power9 -D__SSE2__=1 -DNO_WARN_X86_INTRINSICS")
+ set (COMPILER_FLAGS "${COMPILER_FLAGS} -maltivec -mcpu=power9")
list(APPEND RUSTFLAGS_CPU "-C" "target_feature=+power9-altivec")
else ()
- set (COMPILER_FLAGS "${COMPILER_FLAGS} -maltivec -mcpu=power8 -D__SSE2__=1 -DNO_WARN_X86_INTRINSICS")
+ set (COMPILER_FLAGS "${COMPILER_FLAGS} -maltivec -mcpu=power8")
list(APPEND RUSTFLAGS_CPU "-C" "target_feature=+power8-altivec")
endif ()

diff --git a/src/Common/CurrentMetrics.h b/src/Common/CurrentMetrics.h
index 6466bde2dfd..1ef7c6a22f6 100644
--- a/src/Common/CurrentMetrics.h
+++ b/src/Common/CurrentMetrics.h
@@ -76,7 +76,12 @@ namespace CurrentMetrics
explicit Increment(Metric metric, Value amount_ = 1)
: Increment(&values[metric], amount_)
{
- assert(metric < CurrentMetrics::end());
+ // in src/Core/tests/gtest_BackgroundSchedulePool.cpp we create pool as
+ // auto pool = BackgroundSchedulePool::create(4, 0, CurrentMetrics::end(), CurrentMetrics::end(), "tests");
+ // which leads as to creation of Increment with metric == CurrentMetrics::end()
+ // actually this is not a real metric, however it is presented in CurrentMetrics::values array
+ // so we are able to increment it and we should not assert here when metric == CurrentMetrics::end()
+ assert(metric <= CurrentMetrics::end());
}

~Increment()
79 changes: 79 additions & 0 deletions c/clickhouse/clickhouse-v25.8.16.34-lts_ubi9.6.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#!/bin/bash -ex
# ----------------------------------------------------------------------------
# Package : ClickHouse
# Version : v25.8.16.34-lts
# Source repo : https://github.com/ClickHouse/ClickHouse.git
# Tested on : UBI 9.6
# Language : C++
# Ci-Check : false
# Maintainer : Sumit Dubey <sumit.dubey2@ibm.com>
# Script License : Apache License, Version 2.0 or later
#
# Disclaimer : This script has been tested in root mode on the specified
# platform and package version. Functionality with newer
# versions of the package or OS is not guaranteed.
# ----------------------------------------------------------------------------

#Configuration
PACKAGE_NAME="ClickHouse"
PACKAGE_ORG="ClickHouse"
PACKAGE_VERSION="v25.8.16.34-lts"
PACKAGE_URL="https://github.com/${PACKAGE_ORG}/${PACKAGE_NAME}.git"
BUILD_HOME=$(pwd)
SCRIPT_PATH=$(dirname $(realpath $0))

#Install repos and dependencies
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
dnf install -y https://rpmfind.net/linux/centos-stream/9-stream/CRB/ppc64le/os/Packages/nasm-2.15.03-7.el9.ppc64le.rpm
dnf install -y git cmake ccache python3 ninja-build yasm gawk wget gcc gcc-c++ xz gnupg kernel-headers expect python3-jinja2 clang-20.1.8-3.el9.ppc64le llvm-20.1.8-3.el9.ppc64le lld-20.1.8-3.el9.ppc64le hostname perl-FindBin perl-IPC-Cmd perl-File-Compare perl-File-Copy perl-Time-Piece perl-Pod-Html
export CC=clang
export CXX=clang++

#Install rust
cd $BUILD_HOME
curl https://sh.rustup.rs -sSf | sh -s -- -y
source "$HOME/.cargo/env"
rustup toolchain install nightly-2025-07-07
rustup default nightly-2025-07-07
rustup component add rust-src

#Clone
cd $BUILD_HOME
git clone $PACKAGE_URL -b $PACKAGE_VERSION
cd $PACKAGE_NAME
git submodule update --init --recursive --jobs $(nproc)
git apply ${SCRIPT_PATH}/${PACKAGE_NAME,,}-${PACKAGE_VERSION}.patch
cp /usr/include/linux/vm_sockets.h contrib/sysroot/linux-powerpc64le/powerpc64le-linux-gnu/libc/usr/include/linux/

#Build openssl
pushd contrib/openssl
./config
make -j$(nproc)
make install
popd

#Build
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Debug -D ENABLE_TESTS=ON -D ENABLE_OPENSSL_DYNAMIC=ON ..
ninja -j$(nproc)
rm -rf programs/libcrypto.so.3 programs/libssl.so.3
cp /usr/local/lib/libcrypto.so.3 /usr/local/lib/libssl.so.3 programs/

#Unit test
./src/unit_tests_dbms

#Conclude
set +ex
echo "Buid and tests complete!"
echo "Binaries available at [$BUILD_HOME/$PACKAGE_NAME/build/programs/]"


#Functional Test
#export MALLOC_CONF="narenas:$(nproc)"
#./programs/clickhouse-server > /dev/null 2>&1 &
#sleep 5
#ln -sf /usr/share/zoneinfo/Asia/Kolkata /etc/localtime
#cd ..
#./tests/clickhouse-test