Search code examples
llvmllvm-clangclang-format

latest clang-format on centos


I would like to use clang-format in my project, however, the version that comes with centos 7 seems to be very old. Where can I download the latest version ? I looked at llvm/clang svn repo (and also git repo - https://github.com/llvm-mirror/clang/tree/master/tools/clang-format) , but I don't understand if it is something that I need to compile myself or if it is just a script that I can download and use.

Can someone please help how to get going on this ? I do have a .clang-format file ready, but the older version is not recognizing many keywords in the file.

Thanks, S.K


Solution

  • I was able to figure this out by following the instructions at http://clang.llvm.org/get_started.html. I had to include to clang extra tools, which are put under "optional" category in that link. Once I compiled the whole tree, bin/ directory had the clang-format executable.