How to Build ClickHouse on Mac OS X

Build should work on Mac OS X 10.12.

Install Homebrew

$ /usr/bin/ruby -e "$(curl -fsSL"

Install Required Compilers, Tools, and Libraries

$ brew install cmake ninja gcc icu4c openssl libtool gettext readline gperf

Checkout ClickHouse Sources

$ git clone --recursive


$ git clone --recursive

$ cd ClickHouse

For the latest stable version, switch to the stable branch.

Build ClickHouse

$ mkdir build
$ cd build
$ cmake .. -DCMAKE_CXX_COMPILER=`which g++-8` -DCMAKE_C_COMPILER=`which gcc-8`
$ ninja
$ cd ..


If you intend to run clickhouse-server, make sure to increase the system's maxfiles variable.


You'll need to use sudo.

To do so, create the following file:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
<plist version="1.0">

Execute the following command:

$ sudo chown root:wheel /Library/LaunchDaemons/limit.maxfiles.plist


To check if it's working, you can use ulimit -n command.