提交 dac5889b 编写于 作者: I Ivan Lezhankin

Add build instruction

上级 6cc2f8da
......@@ -10,7 +10,7 @@ sudo apt-get install git pbuilder debhelper lsb-release fakeroot sudo debian-arc
## Checkout ClickHouse Sources
```bash
git clone --recursive --branch stable https://github.com/yandex/ClickHouse.git
git clone --recursive --branch master https://github.com/ClickHouse/ClickHouse.git
cd ClickHouse
```
......@@ -55,7 +55,7 @@ sudo apt-get install gcc-9 g++-9
### Install from Sources
Look at [utils/ci/build-gcc-from-sources.sh](https://github.com/yandex/ClickHouse/blob/master/utils/ci/build-gcc-from-sources.sh)
Look at [utils/ci/build-gcc-from-sources.sh](https://github.com/ClickHouse/ClickHouse/blob/master/utils/ci/build-gcc-from-sources.sh)
## Use GCC 9 for Builds
......@@ -73,14 +73,12 @@ sudo apt-get install libicu-dev libreadline-dev gperf
## Checkout ClickHouse Sources
```bash
git clone --recursive git@github.com:yandex/ClickHouse.git
# or: git clone --recursive https://github.com/yandex/ClickHouse.git
git clone --recursive git@github.com:ClickHouse/ClickHouse.git
# or: git clone --recursive https://github.com/ClickHouse/ClickHouse.git
cd ClickHouse
```
For the latest stable version, switch to the `stable` branch.
## Build ClickHouse
```bash
......
# How to Build ClickHouse on Linux for Mac OS X
The cross-build for Mac OS X is based on the Build instructions, follow them first.
# Install Clang-8
Follow the instructions from https://apt.llvm.org/ for your Ubuntu or Debian setup.
For example the commands for Bionic are like:
```bash
sudo echo "deb [trusted=yes] http://apt.llvm.org/bionic/ llvm-toolchain-bionic-8 main" >> /etc/apt/sources.list
sudo apt-get install clang-8
```
# Install Cross-Compilation Toolset
```bash
mkdir cctools
git clone https://github.com/tpoechtrager/apple-libtapi.git
cd apple-libtapi
INSTALLPREFIX=../cctools ./build.sh
./install.sh
cd ..
git clone https://github.com/tpoechtrager/cctools-port.git
cd cctools-port/cctools
./configure --prefix=../cctools --with-libtapi=../cctools --target=x86_64-apple-darwin
make install
cd ..
cd cctools
wget https://github.com/phracker/MacOSX-SDKs/releases/download/10.14-beta4/MacOSX10.14.sdk.tar.xz
tar xJf MacOSX10.14.sdk.tar.xz
```
Let's remember the path where we created `cctools` directory as ${CCTOOLS_PARENT}
# Build ClickHouse
```bash
cd ClickHouse
mkdir build-osx
CC=clang-8 CXX=clang++-8 cmake . -Bbuild-osx -DCMAKE_SYSTEM_NAME=Darwin \
-DCMAKE_AR:FILEPATH=${CCTOOLS_PARENT}/cctools/bin/x86_64-apple-darwin-ar \
-DCMAKE_RANLIB:FILEPATH=${CCTOOLS_PARENT}/cctools/bin/x86_64-apple-darwin-ranlib \
-DLINKER_NAME=${CCTOOLS_PARENT}/cctools/bin/x86_64-apple-darwin-ld \
-DSDK_PATH=${CCTOOLS_PARENT}/cctools/MacOSX10.14.sdk \
-DUSE_SNAPPY=OFF -DENABLE_SSL=OFF -DENABLE_PROTOBUF=OFF -DENABLE_PARQUET=OFF -DENABLE_READLINE=OFF -DENABLE_ICU=OFF -DENABLE_FASTOPS=OFF
ninja -C build-osx
```
The resulting binary will have Mach-O executable format and can't be run on Linux.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册