2016-11-02 09:29:39 +00:00
# How to build ClickHouse
Build should work on Mac OS X 10.12. If you're using earlier version, you can try to build ClickHouse using Gentoo Prefix and clang sl in this instruction.
With appropriate changes, build should work on any other OS X distribution.
## Install Homebrew
```
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
```
2017-04-14 14:37:41 +00:00
## Install required compilers, tools, libraries
2016-11-02 09:29:39 +00:00
```
2017-04-14 14:37:41 +00:00
brew install cmake gcc icu4c mysql openssl unixodbc libtool gettext homebrew/dupes/zlib readline boost --cc=gcc-6
2016-11-03 19:59:53 +00:00
```
2016-11-02 09:29:39 +00:00
# Checkout ClickHouse sources
2016-12-13 18:07:56 +00:00
To get the latest stable version:
2016-11-02 09:29:39 +00:00
```
2017-04-14 14:37:41 +00:00
git clone -b stable --recursive --depth=10 git@github.com:yandex/ClickHouse.git
# or: git clone -b stable --recursive --depth=10 https://github.com/yandex/ClickHouse.git
2016-11-02 09:29:39 +00:00
cd ClickHouse
```
2016-12-13 18:07:56 +00:00
For development, switch to the `master` branch.
For the latest release candidate, switch to the `testing` branch.
2016-11-02 09:29:39 +00:00
# Build ClickHouse
```
mkdir build
cd build
2017-04-14 14:37:41 +00:00
cmake .. -DCMAKE_CXX_COMPILER=`which g++-6` -DCMAKE_C_COMPILER=`which gcc-6`
make -j `sysctl -n hw.ncpu`
2016-11-02 09:29:39 +00:00
cd ..
```
2016-12-07 08:21:53 +00:00
# Caveats
If you intend to run clickhouse-server, make sure to increase system's maxfiles variable. See [MacOS.md ](https://github.com/yandex/ClickHouse/blob/master/MacOS.md ) for more details.