Downloading and Installing Clang-Analyzer
Download LLVM, Clang, Clang-tools-extra and Compiler-RT from - http://llvm.org/releases/download.html.- Extract the LLVM tarball. I'm going to use the variable LLVM to point to this directory going forward.
- Go to $LLVM/tools/src. Extract the clang release tarball. Rename the extracted directory as clang
- Go to $LLVM/tools/src/clang/tools/. Extract the clang-tools-extra and rename it as extra.
- Go to $LLVM/projects/. Extract the compiler-rt tarball and rename it as compiler-rt.
For more information look at http://clang.llvm.org/get_started.html. The instructions are for svn but they apply for the release tarballs as well.
Building and Installing Clang
Go to $LLVM directory and then you can configure, build and install clang.$ ./configure $ make $ make installIf you want to install clang in a specific directory then pass --prefix=
Note! make install will not install scan-build and scan-view. They remain in $LLVM/tools/clang/tools/scan-build and $LLVM/tools/clang/tools/scan-view. So you will need to add these directories into your path.