2018-05-14 18:49:51 +00:00
|
|
|
## Build and test ClickHouse on various plaforms
|
2018-05-13 23:12:30 +00:00
|
|
|
|
|
|
|
Quick and dirty scripts.
|
|
|
|
|
|
|
|
Usage example:
|
|
|
|
```
|
|
|
|
./run-with-docker.sh ubuntu:bionic jobs/quick-build/run.sh
|
|
|
|
```
|
|
|
|
|
2018-05-14 00:58:58 +00:00
|
|
|
Another example, check build on ARM 64:
|
|
|
|
```
|
|
|
|
./prepare-docker-image-ubuntu.sh
|
|
|
|
./run-with-docker.sh multiarch/ubuntu-core:arm64-bionic jobs/quick-build/run.sh
|
|
|
|
```
|
|
|
|
|
2018-05-14 18:49:51 +00:00
|
|
|
Another example, check build on FreeBSD:
|
|
|
|
```
|
|
|
|
./prepare-vagrant-image-freebsd.sh
|
|
|
|
./run-with-vagrant.sh freebsd jobs/quick-build/run.sh
|
|
|
|
```
|
|
|
|
|
|
|
|
Look at `default_config` and `jobs/quick-build/run.sh`
|
2018-05-13 23:12:30 +00:00
|
|
|
|
|
|
|
Various possible options. We are not going to automate testing all of them.
|
|
|
|
|
2018-05-14 18:49:51 +00:00
|
|
|
#### CPU architectures:
|
2018-05-13 23:12:30 +00:00
|
|
|
- x86_64;
|
2019-01-23 14:18:19 +00:00
|
|
|
- AArch64;
|
|
|
|
- PowerPC64LE.
|
2018-05-13 23:12:30 +00:00
|
|
|
|
2019-01-23 14:18:19 +00:00
|
|
|
x86_64 is the main CPU architecture. We also have minimal support for AArch64 and PowerPC64LE.
|
2018-05-13 23:12:30 +00:00
|
|
|
|
2018-05-14 18:49:51 +00:00
|
|
|
#### Operating systems:
|
2018-05-13 23:12:30 +00:00
|
|
|
- Linux;
|
|
|
|
- FreeBSD.
|
|
|
|
|
2019-01-23 14:18:19 +00:00
|
|
|
We also target Mac OS X, but it's more difficult to test.
|
|
|
|
Linux is the main. FreeBSD is also supported as production OS.
|
2018-05-13 23:12:30 +00:00
|
|
|
Mac OS is intended only for development and have minimal support: client should work, server should just start.
|
|
|
|
|
2018-05-14 18:49:51 +00:00
|
|
|
#### Linux distributions:
|
2018-05-13 23:12:30 +00:00
|
|
|
For build:
|
|
|
|
- Ubuntu Bionic;
|
|
|
|
- Ubuntu Trusty.
|
|
|
|
|
|
|
|
For run:
|
|
|
|
- Ubuntu Hardy;
|
|
|
|
- CentOS 5
|
|
|
|
|
|
|
|
We should support almost any Linux to run ClickHouse. That's why we test also on old distributions.
|
|
|
|
|
2018-05-14 18:49:51 +00:00
|
|
|
#### How to obtain sources:
|
2018-05-13 23:12:30 +00:00
|
|
|
- use sources from local working copy;
|
|
|
|
- clone sources from github;
|
|
|
|
- download source tarball.
|
|
|
|
|
2018-05-14 18:49:51 +00:00
|
|
|
#### Compilers:
|
2018-05-13 23:12:30 +00:00
|
|
|
- gcc-7;
|
|
|
|
- gcc-8;
|
|
|
|
- clang-6;
|
|
|
|
- clang-svn.
|
|
|
|
|
2018-05-14 18:49:51 +00:00
|
|
|
#### Compiler installation:
|
2018-05-13 23:12:30 +00:00
|
|
|
- from OS packages;
|
|
|
|
- build from sources.
|
|
|
|
|
2018-05-14 18:49:51 +00:00
|
|
|
#### C++ standard library implementation:
|
2018-05-13 23:12:30 +00:00
|
|
|
- libc++;
|
|
|
|
- libstdc++ with C++11 ABI;
|
|
|
|
- libstdc++ with old ABI.
|
|
|
|
|
|
|
|
When building with clang, libc++ is used. When building with gcc, we choose libstdc++ with C++11 ABI.
|
|
|
|
|
2018-05-14 18:49:51 +00:00
|
|
|
#### Linkers:
|
2018-05-13 23:12:30 +00:00
|
|
|
- ldd;
|
|
|
|
- gold;
|
|
|
|
|
|
|
|
When building with clang on x86_64, ldd is used. Otherwise we use gold.
|
|
|
|
|
2018-05-14 18:49:51 +00:00
|
|
|
#### Build types:
|
2018-05-13 23:12:30 +00:00
|
|
|
- RelWithDebInfo;
|
|
|
|
- Debug;
|
|
|
|
- ASan;
|
|
|
|
- TSan.
|
|
|
|
|
2018-05-14 18:49:51 +00:00
|
|
|
#### Build types, extra:
|
2018-05-13 23:12:30 +00:00
|
|
|
- -g0 for quick build;
|
|
|
|
- enable test coverage;
|
|
|
|
- debug tcmalloc.
|
|
|
|
|
2018-05-14 18:49:51 +00:00
|
|
|
#### What to build:
|
2018-05-13 23:12:30 +00:00
|
|
|
- only `clickhouse` target;
|
|
|
|
- all targets;
|
|
|
|
- debian packages;
|
|
|
|
|
|
|
|
We also have intent to build RPM and simple tgz packages.
|
|
|
|
|
2018-05-14 18:49:51 +00:00
|
|
|
#### Where to get third-party libraries:
|
2018-05-13 23:12:30 +00:00
|
|
|
- from contrib directory (submodules);
|
|
|
|
- from OS packages.
|
|
|
|
|
2019-01-23 14:18:19 +00:00
|
|
|
The only production option is to use libraries from contrib directory.
|
2018-05-13 23:12:30 +00:00
|
|
|
Using libraries from OS packages is discouraged, but we also support this option.
|
|
|
|
|
2018-05-14 18:49:51 +00:00
|
|
|
#### Linkage types:
|
2018-05-13 23:12:30 +00:00
|
|
|
- static;
|
|
|
|
- shared;
|
|
|
|
|
2019-01-23 14:18:19 +00:00
|
|
|
Static linking is the only option for production usage.
|
2018-05-13 23:12:30 +00:00
|
|
|
We also have support for shared linking, but it is indended only for developers.
|
|
|
|
|
2018-05-14 18:49:51 +00:00
|
|
|
#### Make tools:
|
2018-05-13 23:12:30 +00:00
|
|
|
- make;
|
|
|
|
- ninja.
|
|
|
|
|
2018-05-14 18:49:51 +00:00
|
|
|
#### Installation options:
|
2018-05-13 23:12:30 +00:00
|
|
|
- run built `clickhouse` binary directly;
|
|
|
|
- install from packages.
|
|
|
|
|
2018-05-14 18:49:51 +00:00
|
|
|
#### How to obtain packages:
|
2018-05-13 23:12:30 +00:00
|
|
|
- build them;
|
|
|
|
- download from repository.
|
|
|
|
|
2018-05-14 18:49:51 +00:00
|
|
|
#### Sanity checks:
|
2018-05-13 23:12:30 +00:00
|
|
|
- check that clickhouse binary has no dependencies on unexpected shared libraries;
|
|
|
|
- check that source code have no style violations.
|
|
|
|
|
2018-05-14 18:49:51 +00:00
|
|
|
#### Tests:
|
2018-05-13 23:12:30 +00:00
|
|
|
- Functional tests;
|
|
|
|
- Integration tests;
|
|
|
|
- Unit tests;
|
|
|
|
- Simple sh/reference tests;
|
|
|
|
- Performance tests (note that they require predictable computing power);
|
|
|
|
- Tests for external dictionaries (should be moved to integration tests);
|
|
|
|
- Jepsen like tests for quorum inserts (not yet available in opensource).
|
|
|
|
|
2018-05-14 18:49:51 +00:00
|
|
|
#### Tests extra:
|
2018-05-13 23:12:30 +00:00
|
|
|
- Run functional tests with Valgrind.
|
|
|
|
|
2018-05-14 18:49:51 +00:00
|
|
|
#### Static analyzers:
|
2018-05-13 23:12:30 +00:00
|
|
|
- CppCheck;
|
|
|
|
- clang-tidy;
|
|
|
|
- Coverity.
|