How to Build ClickHouse on Linux for macOS
This is for the case when you have a Linux machine and want to use it to build clickhouse
binary that will run on OS X.
The main use case is continuous integration checks which run on Linux machines.
If you want to build ClickHouse directly on macOS, proceed with the native build instructions.
The cross-build for macOS is based on the Build instructions, follow them first.
The following sections provide a walk-through for building ClickHouse for x86_64
macOS.
If you're targeting ARM architecture, simply substitute all occurrences of x86_64
with aarch64
.
For example, replace x86_64-apple-darwin
with aarch64-apple-darwin
throughout the steps.
Install Cross-Compilation Toolset
Let's remember the path where we install cctools
as ${CCTOOLS}
Also, we need to download macOS X SDK into the working tree.
Build ClickHouse
The resulting binary will have a Mach-O executable format and can't be run on Linux.