ClickHouse/docs/en/development/build.md

99 lines
2.0 KiB
Markdown
Raw Normal View History

# How to Build ClickHouse Release Package
## Install Git and Pbuilder
2018-08-06 16:31:47 +00:00
```bash
2018-08-06 20:59:14 +00:00
sudo apt-get update
2018-08-07 01:50:25 +00:00
sudo apt-get install git pbuilder debhelper lsb-release fakeroot sudo debian-archive-keyring debian-keyring
2018-08-06 16:31:47 +00:00
```
## Checkout ClickHouse Sources
2018-08-06 16:31:47 +00:00
```bash
2018-08-06 16:40:57 +00:00
git clone --recursive --branch stable https://github.com/yandex/ClickHouse.git
2018-08-06 16:31:47 +00:00
cd ClickHouse
```
## Run Release Script
2018-08-06 16:31:47 +00:00
```bash
./release
```
# How to Build ClickHouse for Development
2018-08-06 16:31:47 +00:00
The following tutorial is based on the Ubuntu Linux system.
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
grep -q sse4_2 /proc/cpuinfo && echo "SSE 4.2 supported" || echo "SSE 4.2 not supported"
```
## Install Git and CMake
```bash
sudo apt-get install git cmake ninja-build
```
Or cmake3 instead of cmake on older systems.
## Install GCC 7
There are several ways to do this.
### Install from a PPA Package
```bash
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-7 g++-7
```
### Install from Sources
2018-07-15 18:07:47 +00:00
Look at [ci/build-gcc-from-sources.sh](https://github.com/yandex/ClickHouse/blob/master/ci/build-gcc-from-sources.sh)
## Use GCC 7 for Builds
```bash
export CC=gcc-7
export CXX=g++-7
```
## Install Required Libraries from Packages
```bash
2018-08-05 08:40:31 +00:00
sudo apt-get install libicu-dev libreadline-dev
```
## Checkout ClickHouse Sources
```bash
git clone --recursive git@github.com:yandex/ClickHouse.git
# or: git clone --recursive https://github.com/yandex/ClickHouse.git
cd ClickHouse
```
For the latest stable version, switch to the `stable` branch.
## Build ClickHouse
```bash
mkdir build
cd build
cmake ..
ninja
cd ..
```
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.
[Original article](https://clickhouse.yandex/docs/en/development/build/) <!--hide-->