Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save Binjian/0f4e4067d906ba1ab8d1b699de777924 to your computer and use it in GitHub Desktop.

Select an option

Save Binjian/0f4e4067d906ba1ab8d1b699de777924 to your computer and use it in GitHub Desktop.
Configure multiple clang versions on ubuntu
#!/usr/bin/env bash
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt update
sudo update-alternatives --remove-all clang
sudo apt-get install -y clang-3.9 clang-4.0 clang-5.0 clang-6.0
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.9 10
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-4.0 20
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-5.0 30
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-6.0 40
sudo update-alternatives --set clang /usr/bin/clang
sudo update-alternatives --config clang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment