Search code examples
c++ubuntullvm-clangclion

How to setup CLion with portable Clang on ubuntu?


I want to test Clang with CLion in ubuntu. By default Clion detects my gcc installation, but I want to use clang instead of gcc. Moreover, I don't want to install clang via apt-get. I have downloaded llvm, clang (3.6.2) binary from llvm website. I want to use that portable clang binaries.

Here is my system setup:

  • Ubuntu - 14.04
  • gcc - 4.8.4
  • llvm clang - 3.6.2 (portable)
  • CLion - 1.0.4

So how to set up CLion with llvm-clang here?


Solution

  • The FAQ states the following:

    At present CLion supports GCC and Clang compilers and is guided by these two to get the libraries and headers paths. In the next releases we are planning to extend the list of compilers available in CLion. To change the compiler, go to the Cache tab in CMake tool window and set the compiler’s path to the CMAKE_CXX_COMPILER variable. Then press Enter and click the Apply Changes and Reload button