blob: 6a855999c5fff7c68e2412a8359b165e0c21d012 [file] [log] [blame]
Ted Kremenekf9f689b2009-06-08 21:21:24 +00001<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
3<html>
4<head>
5 <title>Obtaining the Static Analyzer</title>
Benjamin Kramereaa262b2012-01-15 15:26:07 +00006 <link type="text/css" rel="stylesheet" href="menu.css">
7 <link type="text/css" rel="stylesheet" href="content.css">
Ted Kremenek8f8dcba2010-02-12 21:05:44 +00008 <script type="text/javascript" src="scripts/menu.js"></script>
Ted Kremenekf9f689b2009-06-08 21:21:24 +00009</head>
10<body>
11
Ted Kremenekc6ee3762010-02-09 23:05:59 +000012<div id="page">
Ted Kremenekf9f689b2009-06-08 21:21:24 +000013<!--#include virtual="menu.html.incl"-->
Ted Kremenekf9f689b2009-06-08 21:21:24 +000014<div id="content">
15
16<h1>Obtaining the Static Analyzer</h1>
17
18<p>This page describes how to download and install the analyzer. Once
19the analyzer is installed, follow the <a
20href="/scan-build.html">instructions</a> on using <tt>scan-build</tt> to
21get started analyzing your code.</p>
22
23<h2>Packaged Builds (Mac OS X)</h2>
24
25<p>Semi-regular pre-built binaries of the analyzer are available on Mac
Devin Coughlin97f78cf2015-10-29 01:23:57 +000026OS X. These are built to run on OS X 10.7 and later.</p>
Ted Kremenekf9f689b2009-06-08 21:21:24 +000027
28<p>Builds are released frequently. Often the differences between build
29numbers being a few bug fixes or minor feature improvements. When using
30the analyzer, we recommend that you check back here occasionally for new
31builds, especially if the build you are using is more than a couple
32weeks old.</p>
33
34<p>The latest build is:
35 <!--#include virtual="latest_checker.html.incl"-->
36</p>
37
38<p>Packaged builds for other platforms may eventually be provided, but
39we need volunteers who are willing to help provide such regular builds.
40If you wish to help contribute regular builds of the analyzer on other
41platforms, please email the <a
Tanya Lattner4a08e932015-08-05 03:55:23 +000042href="http://lists.llvm.org/mailman/listinfo/cfe-dev">Clang
Ted Kremenekf9f689b2009-06-08 21:21:24 +000043Developers' mailing list</a>.</p>
44
45<h3>Using Packaged Builds</h3>
46
47<p>To use a package build, simply unpack it anywhere. If the build
48archive has the name <b><tt>checker-XXX.tar.bz2</tt></b> then the
49archive will expand to a directory called <b><tt>checker-XXX</tt></b>.
50You do not need to place this directory or the contents of this
51directory in any special place. Uninstalling the analyzer is as simple
52as deleting this directory.</p>
53
54<p>Most of the files in the <b><tt>checker-XXX</tt></b> directory will
55be supporting files for the analyzer that you can simply ignore. Most
56users will only care about two files, which are located at the top of
57the <b><tt>checker-XXX</tt></b> directory:</p>
58
59<ul>
60<li><b>scan-build</b>: <tt>scan-build</tt> is the high-level command line utility for running the analyzer</li>
61<li><b>scan-view</b>: <tt>scan-view</tt> a companion comannd line
62utility to <tt>scan-build</tt>, <tt>scan-view</tt> is used to view
63analysis results generated by <tt>scan-build</tt>. There is an option
64that one can pass to <tt>scan-build</tt> to cause <tt>scan-view</tt> to
65run as soon as it the analysis of a build completes</li>
66</ul>
67
68<h4>Running scan-build</h4>
69
70<p>For specific details on using <tt>scan-build</tt>, please see
71<tt>scan-build</tt>'s <a href="/scan-build">documentation</a>.</p>
72
73<p>To run <tt>scan-build</tt>, either add the
74<b><tt>checker-XXX</tt></b> directory to your path or specify a complete
75path for <tt>scan-build</tt> when running it. It is also possible to use
76a symbolic link to <tt>scan-build</tt>, such one located in a directory
77in your path. When <tt>scan-build</tt> runs it will automatically
78determine where to find its accompanying files.</p>
79
80<h2 id="OtherPlatforms">Other Platforms (Building the Analyzer from Source)</h2>
81
82<p>For other platforms, you must build Clang and LLVM manually. To do
83so, please follow the instructions for <a
84href="http://clang.llvm.org/get_started.html#build">building Clang from
85source code</a>.<p>
86
87<p>Once the Clang is built, you need to add the following to your path:</p>
88
89<ul>
90
Daniel Dunbar520d1e62009-12-11 23:04:35 +000091<li>The location of the <tt>clang</tt> binary.
Ted Kremenekf9f689b2009-06-08 21:21:24 +000092
Duncan Sandsb69d4ce2010-07-08 08:31:28 +000093<p>For example, if you built a <em>Debug+Asserts</em> build of LLVM/Clang (the
Ted Kremenek2e0c7cc2010-09-29 21:41:56 +000094default), the resultant <tt>clang</tt> binary will be in <tt>$(OBJDIR)/Debug+Asserts/bin</tt>
Daniel Dunbar520d1e62009-12-11 23:04:35 +000095(where <tt>$(OBJDIR)</tt> is often the same as the root source directory). You
Sylvestre Ledrua5202662012-07-31 06:56:50 +000096can also do <tt>make install</tt> to install the LLVM/Clang libraries and
Daniel Dunbar520d1e62009-12-11 23:04:35 +000097binaries to the installation directory of your choice (specified when you run
Ted Kremenekf9f689b2009-06-08 21:21:24 +000098<tt>configure</tt>).</p></li>
99
100<li>The locations of the <tt>scan-build</tt> and <tt>scan-view</tt>
101programs.
102
Jonathan Roelofse9614322015-11-09 16:12:56 +0000103<p>These are installed via <tt>make install</tt> into the bin directory
104when clang is built.</p></li>
Ted Kremenekf9f689b2009-06-08 21:21:24 +0000105
106</ul>
Ted Kremenekc6ee3762010-02-09 23:05:59 +0000107</div>
Ted Kremenekf9f689b2009-06-08 21:21:24 +0000108</div>
109</body>
110</html>
111