Skip to content

Instantly share code, notes, and snippets.

@CodeMouse92
Last active May 3, 2018 08:57
Show Gist options
  • Save CodeMouse92/db4853223585940f1bd143debab0c87e to your computer and use it in GitHub Desktop.
Save CodeMouse92/db4853223585940f1bd143debab0c87e to your computer and use it in GitHub Desktop.
Install Clang 5.0
sudo add-apt-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-5.0 main"
wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
sudo apt update
sudo apt install python-lldb-5.0
sudo apt install clang-5.0 clang-5.0-doc libclang-common-5.0-dev libclang-5.0-dev libclang1-5.0 libclang1-5.0-dbg libllvm-5.0-ocaml-dev libllvm5.0 libllvm5.0-dbg lldb-5.0 llvm-5.0 llvm-5.0-dev llvm-5.0-doc llvm-5.0-examples llvm-5.0-runtime clang-format-5.0 python-clang-5.0 libfuzzer-5.0-dev
sudo ln -sf /usr/bin/llvm-symbolizer-5.0 /usr/bin/llvm-symbolizer
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/clang-5.0 60
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 50
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-5.0 60
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 50
sudo apt install build-essential cmake valgrind kcachegrind vim cccc
# OPTIONAL: Code::Blocks IDE
sudo apt install codeblocks codeblocks-contrib
# You can follow the guide from https://mousepawmedia.net/help/tools/cpp.html#trimming-down-on-plugins onward to configure C::B
@jep-dev
Copy link

jep-dev commented May 3, 2018

This does what I needed it to, so thanks for the help. (I needed L6 through L11 - the Debian packages haven't caused me trouble, unless you include this providers issue, and since your solution continued after the repo/key to updating alternatives and symlinks as usual, can I assume the first steps are not related to the solution like the IDE and so on at the bottom?) Before finding your snippet, I found this bug report from 2011 at version 2.8.1; any idea if this is still occurring because of some deliberate choice, e.g. Clang should not provide CC/C++/etc. between X.Y.0 and X.Y.1? Needless to say, plugging in Clang like this feels Wrong, especially if the cause is considered a bug and not just a feature held back slightly. (I can't imagine the migration from 4.Y.Z to 5.0.0 ever (a) missing lines like update-alternatives ... 4.Y.Z or (b) accidentally deleting them.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment