ClickHouse/docs/en/development/build-cross-riscv.md
Azat Khuzhin a10aa9ad50 Force libunwind usage (removes gcc_eh support)
libunwind is reentrant and signal safe, and works faster then then
gcc_eh (plus it has some custom patches for problems that have been
found during it's usage in ClickHouse).

gcc_eh may be missing in the system (if gcc was not installed), and
even if it exists clickhouse uses -nodefaultlibs, so some care should be
made to make it work.

Also this library is tiny and there shouln't be any problem to require
it always (there is already tendency to require some contrib libraries,
i.e. poco).

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-07-08 20:55:50 +02:00

1.3 KiB

slug sidebar_position title sidebar_label
/en/development/build-cross-riscv 68 How to Build ClickHouse on Linux for RISC-V 64 Architecture Build on Linux for RISC-V 64

As of writing (11.11.2021) building for risc-v considered to be highly experimental. Not all features can be enabled.

This is for the case when you have Linux machine and want to use it to build clickhouse binary that will run on another Linux machine with RISC-V 64 CPU architecture. This is intended for continuous integration checks that run on Linux servers.

The cross-build for RISC-V 64 is based on the Build instructions, follow them first.

Install Clang-16

Follow the instructions from https://apt.llvm.org/ for your Ubuntu or Debian setup or do

sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"

Build ClickHouse

cd ClickHouse
mkdir build-riscv64
CC=clang-16 CXX=clang++-16 cmake . -Bbuild-riscv64 -G Ninja -DCMAKE_TOOLCHAIN_FILE=cmake/linux/toolchain-riscv64.cmake -DGLIBC_COMPATIBILITY=OFF -DENABLE_LDAP=OFF  -DOPENSSL_NO_ASM=ON -DENABLE_JEMALLOC=ON -DENABLE_PARQUET=OFF -DENABLE_GRPC=OFF -DENABLE_HDFS=OFF -DENABLE_MYSQL=OFF
ninja -C build-riscv64

The resulting binary will run only on Linux with the RISC-V 64 CPU architecture.