xref: /llvm-project/clang/docs/analyzer/user-docs/Installation.rst (revision 093aaca2b0ad23ded5dcb45e8f837ffb7b21ffb3)
1*093aaca2SEndre FülöpObtaining the Static Analyzer
2*093aaca2SEndre Fülöp=============================
3*093aaca2SEndre Fülöp
4*093aaca2SEndre FülöpThis page describes how to download and install the analyzer. Once the analyzer is installed, follow the :doc:`CommandLineUsage` on using the command line to get started analyzing your code.
5*093aaca2SEndre Fülöp
6*093aaca2SEndre Fülöp.. contents::
7*093aaca2SEndre Fülöp   :local:
8*093aaca2SEndre Fülöp
9*093aaca2SEndre Fülöp
10*093aaca2SEndre FülöpBuilding the Analyzer from Source
11*093aaca2SEndre Fülöp---------------------------------
12*093aaca2SEndre Fülöp
13*093aaca2SEndre FülöpCurrently there are no officially supported binary distributions for the static analyzer.
14*093aaca2SEndre FülöpYou must build Clang and LLVM manually.
15*093aaca2SEndre FülöpTo do so, please follow the instructions for `building Clang from source code <https://clang.llvm.org/get_started.html#build>`_.
16*093aaca2SEndre Fülöp
17*093aaca2SEndre FülöpOnce the Clang is built, you need to add the location of the ``clang`` binary and the locations of the command line utilities (`CodeChecker` or ``scan-build`` and ``scan-view``) to you PATH for :doc:`CommandLineUsage`.
18*093aaca2SEndre Fülöp
19*093aaca2SEndre Fülöp[Legacy] Packaged Builds (Mac OS X)
20*093aaca2SEndre Fülöp-----------------------------------
21*093aaca2SEndre Fülöp
22*093aaca2SEndre FülöpSemi-regular pre-built binaries of the analyzer used to be available on Mac OS X. These were built to run on OS X 10.7 and later.
23*093aaca2SEndre Fülöp
24*093aaca2SEndre FülöpFor older builds for MacOS visit https://clang-analyzer.llvm.org/release_notes.html.
25*093aaca2SEndre Fülöp
26*093aaca2SEndre FülöpPackaged builds for other platforms may eventually be provided, but we need volunteers who are willing to help provide such regular builds. If you wish to help contribute regular builds of the analyzer on other platforms, please get in touch via `LLVM Discourse <https://discourse.llvm.org/>`_.
27*093aaca2SEndre Fülöp
28*093aaca2SEndre Fülöp[Legacy] Using Packaged Builds
29*093aaca2SEndre Fülöp------------------------------
30*093aaca2SEndre Fülöp
31*093aaca2SEndre FülöpTo use the legacy pacakge builds, simply unpack it anywhere. If the build archive has the name **``checker-XXX.tar.bz2``** then the archive will expand to a directory called **``checker-XXX``**. You do not need to place this directory or the contents of this directory in any special place. Uninstalling the analyzer is as simple as deleting this directory.
32*093aaca2SEndre Fülöp
33*093aaca2SEndre FülöpMost of the files in the **``checker-XXX``** directory will be supporting files for the analyzer that you can simply ignore. Most users will only care about two files, which are located at the top of the **``checker-XXX``** directory:
34*093aaca2SEndre Fülöp
35*093aaca2SEndre Fülöp* **scan-build**: ``scan-build`` is the high-level command line utility for running the analyzer
36*093aaca2SEndre Fülöp* **scan-view**: ``scan-view`` a companion command line utility to ``scan-build``, ``scan-view`` is used to view analysis results generated by ``scan-build``. There is an option that one can pass to ``scan-build`` to cause ``scan-view`` to run as soon as it the analysis of a build completes
37*093aaca2SEndre Fülöp
38