Merge pull request #39002 from pkit/patch-1

fix wrong OSX building instructions
This commit is contained in:
Alexey Milovidov 2022-07-09 01:02:33 +03:00 committed by GitHub
commit 6995bc11f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,6 +25,7 @@ sudo apt-get install clang-14
Lets remember the path where we install `cctools` as ${CCTOOLS} Lets remember the path where we install `cctools` as ${CCTOOLS}
``` bash ``` bash
export CCTOOLS=$(cd ~/cctools && pwd)
mkdir ${CCTOOLS} mkdir ${CCTOOLS}
cd ${CCTOOLS} cd ${CCTOOLS}
@ -43,10 +44,8 @@ make install
Also, we need to download macOS X SDK into the working tree. Also, we need to download macOS X SDK into the working tree.
``` bash ``` bash
cd ClickHouse cd ClickHouse/cmake/toolchain/darwin-x86_64
wget 'https://github.com/phracker/MacOSX-SDKs/releases/download/10.15/MacOSX10.15.sdk.tar.xz' curl -L 'https://github.com/phracker/MacOSX-SDKs/releases/download/10.15/MacOSX10.15.sdk.tar.xz' | tar xJ --strip-components=1
mkdir -p build-darwin/cmake/toolchain/darwin-x86_64
tar xJf MacOSX10.15.sdk.tar.xz -C build-darwin/cmake/toolchain/darwin-x86_64 --strip-components=1
``` ```
## Build ClickHouse {#build-clickhouse} ## Build ClickHouse {#build-clickhouse}
@ -55,7 +54,7 @@ tar xJf MacOSX10.15.sdk.tar.xz -C build-darwin/cmake/toolchain/darwin-x86_64 --s
cd ClickHouse cd ClickHouse
mkdir build-darwin mkdir build-darwin
cd build-darwin cd build-darwin
CC=clang-13 CXX=clang++-13 cmake -DCMAKE_AR:FILEPATH=${CCTOOLS}/bin/aarch64-apple-darwin-ar -DCMAKE_INSTALL_NAME_TOOL=${CCTOOLS}/bin/aarch64-apple-darwin-install_name_tool -DCMAKE_RANLIB:FILEPATH=${CCTOOLS}/bin/aarch64-apple-darwin-ranlib -DLINKER_NAME=${CCTOOLS}/bin/aarch64-apple-darwin-ld -DCMAKE_TOOLCHAIN_FILE=cmake/darwin/toolchain-x86_64.cmake .. CC=clang-14 CXX=clang++-14 cmake -DCMAKE_AR:FILEPATH=${CCTOOLS}/bin/x86_64-apple-darwin-ar -DCMAKE_INSTALL_NAME_TOOL=${CCTOOLS}/bin/x86_64-apple-darwin-install_name_tool -DCMAKE_RANLIB:FILEPATH=${CCTOOLS}/bin/x86_64-apple-darwin-ranlib -DLINKER_NAME=${CCTOOLS}/bin/x86_64-apple-darwin-ld -DCMAKE_TOOLCHAIN_FILE=cmake/darwin/toolchain-x86_64.cmake ..
ninja ninja
``` ```