2018-08-10 14:44:49 +00:00
|
|
|
# How to Build ClickHouse Release Package
|
2017-12-28 15:13:23 +00:00
|
|
|
|
2018-08-10 14:44:49 +00:00
|
|
|
## Install Git and Pbuilder
|
2018-08-06 16:31:47 +00:00
|
|
|
|
|
|
|
```bash
|
2019-09-23 15:31:46 +00:00
|
|
|
$ sudo apt-get update
|
|
|
|
$ sudo apt-get install git pbuilder debhelper lsb-release fakeroot sudo debian-archive-keyring debian-keyring
|
2018-08-06 16:31:47 +00:00
|
|
|
```
|
|
|
|
|
2018-08-10 14:44:49 +00:00
|
|
|
## Checkout ClickHouse Sources
|
2018-08-06 16:31:47 +00:00
|
|
|
|
|
|
|
```bash
|
2019-09-23 15:31:46 +00:00
|
|
|
$ git clone --recursive --branch stable https://github.com/yandex/ClickHouse.git
|
|
|
|
$ cd ClickHouse
|
2018-08-06 16:31:47 +00:00
|
|
|
```
|
|
|
|
|
2018-08-10 14:44:49 +00:00
|
|
|
## Run Release Script
|
2018-08-06 16:31:47 +00:00
|
|
|
|
|
|
|
```bash
|
2019-09-23 15:31:46 +00:00
|
|
|
$ ./release
|
2018-08-06 16:31:47 +00:00
|
|
|
```
|
|
|
|
|
2018-08-10 14:44:49 +00:00
|
|
|
# How to Build ClickHouse for Development
|
2018-08-06 16:31:47 +00:00
|
|
|
|
2018-12-10 09:19:32 +00:00
|
|
|
The following tutorial is based on the Ubuntu Linux system.
|
2017-12-28 15:13:23 +00:00
|
|
|
With appropriate changes, it should also work on any other Linux distribution.
|
|
|
|
Only x86_64 with SSE 4.2 is supported. Support for AArch64 is experimental.
|
|
|
|
|
|
|
|
To test for SSE 4.2, do
|
|
|
|
|
|
|
|
```bash
|
2019-09-23 15:31:46 +00:00
|
|
|
$ grep -q sse4_2 /proc/cpuinfo && echo "SSE 4.2 supported" || echo "SSE 4.2 not supported"
|
2017-12-28 15:13:23 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Install Git and CMake
|
|
|
|
|
|
|
|
```bash
|
2019-09-23 15:31:46 +00:00
|
|
|
$ sudo apt-get install git cmake ninja-build
|
2017-12-28 15:13:23 +00:00
|
|
|
```
|
|
|
|
|
2018-05-10 14:45:52 +00:00
|
|
|
Or cmake3 instead of cmake on older systems.
|
2017-12-28 15:13:23 +00:00
|
|
|
|
2019-09-06 09:07:23 +00:00
|
|
|
## Install GCC 9
|
2017-12-28 15:13:23 +00:00
|
|
|
|
|
|
|
There are several ways to do this.
|
|
|
|
|
2018-08-10 14:44:49 +00:00
|
|
|
### Install from a PPA Package
|
2017-12-28 15:13:23 +00:00
|
|
|
|
|
|
|
```bash
|
2019-09-23 15:31:46 +00:00
|
|
|
$ sudo apt-get install software-properties-common
|
|
|
|
$ sudo apt-add-repository ppa:ubuntu-toolchain-r/test
|
|
|
|
$ sudo apt-get update
|
|
|
|
$ sudo apt-get install gcc-9 g++-9
|
2017-12-28 15:13:23 +00:00
|
|
|
```
|
|
|
|
|
2018-08-10 14:44:49 +00:00
|
|
|
### Install from Sources
|
2017-12-28 15:13:23 +00:00
|
|
|
|
2019-08-04 19:11:27 +00:00
|
|
|
Look at [utils/ci/build-gcc-from-sources.sh](https://github.com/yandex/ClickHouse/blob/master/utils/ci/build-gcc-from-sources.sh)
|
2017-12-28 15:13:23 +00:00
|
|
|
|
2019-09-06 09:07:23 +00:00
|
|
|
## Use GCC 9 for Builds
|
2017-12-28 15:13:23 +00:00
|
|
|
|
|
|
|
```bash
|
2019-09-23 15:31:46 +00:00
|
|
|
$ export CC=gcc-9
|
|
|
|
$ export CXX=g++-9
|
2017-12-28 15:13:23 +00:00
|
|
|
```
|
|
|
|
|
2018-08-10 14:44:49 +00:00
|
|
|
## Install Required Libraries from Packages
|
2017-12-28 15:13:23 +00:00
|
|
|
|
|
|
|
```bash
|
2019-09-23 15:31:46 +00:00
|
|
|
$ sudo apt-get install libicu-dev libreadline-dev gperf
|
2019-04-17 06:21:26 +00:00
|
|
|
```
|
|
|
|
|
2018-08-10 14:44:49 +00:00
|
|
|
## Checkout ClickHouse Sources
|
2017-12-28 15:13:23 +00:00
|
|
|
|
|
|
|
```bash
|
2019-09-23 15:31:46 +00:00
|
|
|
$ git clone --recursive git@github.com:yandex/ClickHouse.git
|
|
|
|
```
|
|
|
|
or
|
|
|
|
```bash
|
|
|
|
$ git clone --recursive https://github.com/yandex/ClickHouse.git
|
|
|
|
$ cd ClickHouse
|
2017-12-28 15:13:23 +00:00
|
|
|
```
|
|
|
|
|
2018-08-05 05:52:46 +00:00
|
|
|
For the latest stable version, switch to the `stable` branch.
|
2017-12-28 15:13:23 +00:00
|
|
|
|
|
|
|
## Build ClickHouse
|
|
|
|
|
|
|
|
```bash
|
2019-09-23 15:31:46 +00:00
|
|
|
$ mkdir build
|
|
|
|
$ cd build
|
|
|
|
$ cmake ..
|
|
|
|
$ ninja
|
|
|
|
$ cd ..
|
2017-12-28 15:13:23 +00:00
|
|
|
```
|
|
|
|
|
2018-06-08 16:18:07 +00:00
|
|
|
To create an executable, run `ninja clickhouse`.
|
2018-06-05 20:09:51 +00:00
|
|
|
This will create the `dbms/programs/clickhouse` executable, which can be used with `client` or `server` arguments.
|
2017-12-28 15:13:23 +00:00
|
|
|
|
2018-10-16 10:47:17 +00:00
|
|
|
|
|
|
|
[Original article](https://clickhouse.yandex/docs/en/development/build/) <!--hide-->
|