From dd7c0e13d867cc485a75c59d5aaa5a4c8a6bb119 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Sun, 16 Feb 2020 13:45:15 +0300 Subject: [PATCH] Better build instruction #9054 --- docs/en/development/build.md | 104 ++++++++++++++++++++++++++--------- 1 file changed, 79 insertions(+), 25 deletions(-) diff --git a/docs/en/development/build.md b/docs/en/development/build.md index 107116e6a7c..2e45a25517d 100644 --- a/docs/en/development/build.md +++ b/docs/en/development/build.md @@ -1,35 +1,13 @@ -# How to Build ClickHouse Release Package - -## Install Git and Pbuilder - -```bash -$ sudo apt-get update -$ sudo apt-get install git pbuilder debhelper lsb-release fakeroot sudo debian-archive-keyring debian-keyring -``` - -## Checkout ClickHouse Sources - -```bash -$ git clone --recursive --branch master https://github.com/ClickHouse/ClickHouse.git -$ cd ClickHouse -``` - -## Run Release Script - -```bash -$ ./release -``` - # How to Build ClickHouse for Development The following tutorial is based on the Ubuntu Linux system. With appropriate changes, it should also work on any other Linux distribution. Supported platforms: x86_64 and AArch64. Support for Power9 is experimental. -## Install Git, CMake and Ninja +## Install Git, CMake, Python and Ninja ```bash -$ sudo apt-get install git cmake ninja-build +$ sudo apt-get install git cmake python ninja-build ``` Or cmake3 instead of cmake on older systems. @@ -66,12 +44,12 @@ $ git clone --recursive git@github.com:ClickHouse/ClickHouse.git or ```bash $ git clone --recursive https://github.com/ClickHouse/ClickHouse.git -$ cd ClickHouse ``` ## Build ClickHouse ```bash +$ cd ClickHouse $ mkdir build $ cd build $ cmake .. @@ -83,4 +61,80 @@ To create an executable, run `ninja clickhouse`. This will create the `dbms/programs/clickhouse` executable, which can be used with `client` or `server` arguments. +# How to Build ClickHouse on Any Linux + +The build requires the following componenets: + +- Git (is used only to checkout the sources, it's not needed for build) +- CMake 3.10 or newer +- Ninja (recommended) or Make +- C++ compiler: gcc 9 or clang 8 or newer +- Linker: lld or gold (the classic GNU ld won't work) +- Python (is only used inside LLVM build and it is optional) + +If all the components are installed, you may build in the same way as the steps above. + +Example for Ubuntu Eoan: + +``` +sudo apt update +sudo apt install git cmake ninja-build g++ python +git clone --recursive https://github.com/ClickHouse/ClickHouse.git +mkdir build && cd build +cmake ../ClickHouse +ninja +``` + +Example for OpenSUSE Tumbleweed: + +``` +sudo zypper install git cmake ninja gcc-c++ python lld +git clone --recursive https://github.com/ClickHouse/ClickHouse.git +mkdir build && cd build +cmake ../ClickHouse +ninja +``` + +Example for CentOS 8: + +``` +sudo yum update +yum install git cmake make gcc-c++ python2 +git clone --recursive https://github.com/ClickHouse/ClickHouse.git +cmake ../ClickHouse +make +``` + +# You Don't Have to Build ClickHouse + +ClickHouse is available in pre-built binaries and packages. Binaries are portable and can be run on any Linux flavour. + +They are build for stable, prestable and testing releases as long as for every commit to master and for every pull request. + +To find the most fresh build from `master`, go to [commits page](https://github.com/ClickHouse/ClickHouse/commits/master), click on the first green check mark or red cross near commit, and click to the "Details" link right after "ClickHouse Build Check". + + +# How to Build ClickHouse Debian Package + +## Install Git and Pbuilder + +```bash +$ sudo apt-get update +$ sudo apt-get install git python pbuilder debhelper lsb-release fakeroot sudo debian-archive-keyring debian-keyring +``` + +## Checkout ClickHouse Sources + +```bash +$ git clone --recursive --branch master https://github.com/ClickHouse/ClickHouse.git +$ cd ClickHouse +``` + +## Run Release Script + +```bash +$ ./release +``` + + [Original article](https://clickhouse.tech/docs/en/development/build/)