How to Build ClickHouse on Mac OS X 

Build should work on Mac OS X 10.15 (Catalina).

Install Homebrew 

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

Install Required Compilers, Tools, and Libraries 

$ brew install cmake ninja libtool gettext

Checkout ClickHouse Sources 

$ git clone --recursive gi[email protected]:ClickHouse/ClickHouse.git


$ git clone --recursive

$ cd ClickHouse

Build ClickHouse 

Please note: ClickHouse doesn't support build with native Apple Clang compiler, we need use clang from LLVM.

$ mkdir build
$ cd build
$ cmake ..-DCMAKE_C_COMPILER=`brew --prefix llvm`/bin/clang -DCMAKE_CXX_COMPILER=`brew --prefix llvm`/bin/clang++ -DCMAKE_PREFIX_PATH=`brew --prefix llvm`
$ ninja
$ cd ..


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

To do so, create the /Library/LaunchDaemons/limit.maxfiles.plist file with the following content:

<?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.

Original article

Rating: 2.7 - 22 votes

Was this content helpful?