How to Build ClickHouse on Mac OS X

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, it should also work on any other Linux distribution.

Install Homebrew

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

Install Required Compilers, Tools, and Libraries

brew install cmake ninja gcc icu4c mariadb-connector-c openssl libtool gettext readline

Checkout ClickHouse Sources

git clone --recursive
# or: 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`
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.