How to Build ClickHouse on macOS for macOS
You can install pre-built ClickHouse as described in Quick Start.
ClickHouse can be compiled on macOS x86_64 (Intel) and arm64 (Apple Silicon) using on macOS 10.15 (Catalina) or higher.
As compiler, only Clang from homebrew is supported.
Install Prerequisites
First install Homebrew.
Next, run:
Apple uses a case-insensitive file system by default. While this usually does not affect compilation (especially scratch makes will work), it can confuse file operations like git mv
.
For serious development on macOS, make sure that the source code is stored on a case-sensitive disk volume, e.g. see these instructions.
Build ClickHouse
To build you must use Homebrew's Clang compiler:
Caveats
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 /Library/LaunchDaemons/limit.maxfiles.plist
file with the following content:
Give the file correct permissions:
Validate that the file is correct:
Load the file (or reboot):
To check if it's working, use the ulimit -n
or launchctl limit maxfiles
commands.