• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!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>
6  <link type="text/css" rel="stylesheet" href="menu.css">
7  <link type="text/css" rel="stylesheet" href="content.css">
8  <script type="text/javascript" src="scripts/menu.js"></script>
9</head>
10<body>
11
12<div id="page">
13<!--#include virtual="menu.html.incl"-->
14<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
26OS X.  These are built to run on Mac OS 10.5 and later.</p>
27
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
42href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">Clang
43Developers' 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
91<li>The location of the <tt>clang</tt> binary.
92
93<p>For example, if you built a <em>Debug+Asserts</em> build of LLVM/Clang (the
94default), the resultant <tt>clang</tt> binary will be in <tt>$(OBJDIR)/Debug+Asserts/bin</tt>
95(where <tt>$(OBJDIR)</tt> is often the same as the root source directory).  You
96can also do <tt>make install</tt> to install the LLVM/Clang libraries and
97binaries to the installation directory of your choice (specified when you run
98<tt>configure</tt>).</p></li>
99
100<li>The locations of the <tt>scan-build</tt> and <tt>scan-view</tt>
101programs.
102
103<p>Currently these are not installed using <tt>make install</tt>, and
104are located in <tt>$(SRCDIR)/tools/clang/tools/scan-build</tt> and
105<tt>$(SRCDIR)/tools/clang/tools/scan-view</tt> respectively (where
106<tt>$(SRCDIR)</tt> is the root LLVM source directory).  These locations
107are subject to change.</p></li>
108
109</ul>
110</div>
111</div>
112</body>
113</html>
114
115