Last active
May 10, 2022 22:20
-
-
Save zwongeer/a70472459bebcb3440c8f31f0c73e4e2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# on ubuntu 18.04 | |
cat << EOF >/etc/apt/source.list | |
deb http://archive.ubuntu.com/ubuntu bionic main multiverse restricted universe | |
deb http://archive.ubuntu.com/ubuntu bionic-security main multiverse restricted universe | |
deb http://archive.ubuntu.com/ubuntu bionic-updates main multiverse restricted universe | |
EOF | |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | |
cat << EOF > /etc/apt/sources.list.d/clang.list | |
deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic main | |
deb-src http://apt.llvm.org/bionic/ llvm-toolchain-bionic main | |
# 11 | |
deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-11 main | |
deb-src http://apt.llvm.org/bionic/ llvm-toolchain-bionic-11 main | |
# 12 | |
deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-12 main | |
deb-src http://apt.llvm.org/bionic/ llvm-toolchain-bionic-12 main | |
# 13 | |
deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-13 main | |
deb-src http://apt.llvm.org/bionic/ llvm-toolchain-bionic-13 main | |
# 14 | |
deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-14 main | |
deb-src http://apt.llvm.org/bionic/ llvm-toolchain-bionic-14 main | |
EOF | |
add-apt-repository ppa:ubuntu-toolchain-r/test -y | |
apt update | |
sudo apt remove --purge --auto-remove cmake | |
rm -f /usr/local/bin/cmake | |
sudo apt install -y software-properties-common lsb-release && \ | |
sudo apt clean all | |
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null | |
sudo apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" | |
sudo apt update | |
sudo apt install -y kitware-archive-keyring | |
sudo rm /etc/apt/trusted.gpg.d/kitware.gpg | |
sudo apt install -y cmake | |
sudo apt install -y build-essential libtool autoconf unzip wget git curl ninja-build | |
# apt install gcc-11 g++-11 -y | |
# export CC=gcc-11 | |
# export CXX=g++-11 | |
apt install clang-14 | |
export CC=clang-14 | |
export CXX=clang++-14 | |
git clone --recursive --depth=1 https://github.com/yandex/ClickHouse.git | |
export MAKEFLAGS="-j $(nproc)" | |
export NINJAFLAGS="-j $(nproc)" | |
cd ClickHouse && mkdir -p build && cd build && cmake .. | |
clear && time ninja |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment