blob: 891353562136ce36cc62c6909ea824d0736af0b0 [file] [log] [blame]
Ted Kremenek591b9072009-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>
6 <link type="text/css" rel="stylesheet" href="menu.css" />
7 <link type="text/css" rel="stylesheet" href="content.css" />
8</head>
9<body>
10
11<!--#include virtual="menu.html.incl"-->
12
13<div id="content">
14
15<h1>Obtaining the Static Analyzer</h1>
16
17<p>This page describes how to download and install the analyzer. Once
18the analyzer is installed, follow the <a
19href="/scan-build.html">instructions</a> on using <tt>scan-build</tt> to
20get started analyzing your code.</p>
21
22<h2>Packaged Builds (Mac OS X)</h2>
23
24<p>Semi-regular pre-built binaries of the analyzer are available on Mac
25OS X. These are built to run on Mac OS 10.5 and later.</p>
26
27<p>Builds are released frequently. Often the differences between build
28numbers being a few bug fixes or minor feature improvements. When using
29the analyzer, we recommend that you check back here occasionally for new
30builds, especially if the build you are using is more than a couple
31weeks old.</p>
32
33<p>The latest build is:
34 <!--#include virtual="latest_checker.html.incl"-->
35</p>
36
37<p>Packaged builds for other platforms may eventually be provided, but
38we need volunteers who are willing to help provide such regular builds.
39If you wish to help contribute regular builds of the analyzer on other
40platforms, please email the <a
41href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">Clang
42Developers' mailing list</a>.</p>
43
44<h3>Using Packaged Builds</h3>
45
46<p>To use a package build, simply unpack it anywhere. If the build
47archive has the name <b><tt>checker-XXX.tar.bz2</tt></b> then the
48archive will expand to a directory called <b><tt>checker-XXX</tt></b>.
49You do not need to place this directory or the contents of this
50directory in any special place. Uninstalling the analyzer is as simple
51as deleting this directory.</p>
52
53<p>Most of the files in the <b><tt>checker-XXX</tt></b> directory will
54be supporting files for the analyzer that you can simply ignore. Most
55users will only care about two files, which are located at the top of
56the <b><tt>checker-XXX</tt></b> directory:</p>
57
58<ul>
59<li><b>scan-build</b>: <tt>scan-build</tt> is the high-level command line utility for running the analyzer</li>
60<li><b>scan-view</b>: <tt>scan-view</tt> a companion comannd line
61utility to <tt>scan-build</tt>, <tt>scan-view</tt> is used to view
62analysis results generated by <tt>scan-build</tt>. There is an option
63that one can pass to <tt>scan-build</tt> to cause <tt>scan-view</tt> to
64run as soon as it the analysis of a build completes</li>
65</ul>
66
67<h4>Running scan-build</h4>
68
69<p>For specific details on using <tt>scan-build</tt>, please see
70<tt>scan-build</tt>'s <a href="/scan-build">documentation</a>.</p>
71
72<p>To run <tt>scan-build</tt>, either add the
73<b><tt>checker-XXX</tt></b> directory to your path or specify a complete
74path for <tt>scan-build</tt> when running it. It is also possible to use
75a symbolic link to <tt>scan-build</tt>, such one located in a directory
76in your path. When <tt>scan-build</tt> runs it will automatically
77determine where to find its accompanying files.</p>
78
79<h2 id="OtherPlatforms">Other Platforms (Building the Analyzer from Source)</h2>
80
81<p>For other platforms, you must build Clang and LLVM manually. To do
82so, please follow the instructions for <a
83href="http://clang.llvm.org/get_started.html#build">building Clang from
84source code</a>.<p>
85
86<p>Once the Clang is built, you need to add the following to your path:</p>
87
88<ul>
89
90<li>The locations of the <tt>clang-cc</tt> and <tt>clang</tt> binaries.
91
92<p>For example, if you built a <em>Debug</em> build of LLVM/Clang, the
93resultant binaries will be in $(OBJDIR)/Debug (where <tt>$(OBJDIR)</tt>
94is often the same as the root source directory). You can also do
95<tt>make install</tt> to install the LLVM/Clang libaries and binaries to
96the installation directory of your choice (specified when you run
97<tt>configure</tt>).</p></li>
98
99<li>The locations of the <tt>scan-build</tt> and <tt>scan-view</tt>
100programs.
101
102<p>Currently these are not installed using <tt>make install</tt>, and
103are located in <tt>$(SRCDIR)/tools/clang/util</tt> and
104<tt>$(SRCDIR)/tools/clang/tools/scan-view</tt> respectively (where
105<tt>$(SRCDIR)</tt> is the root LLVM source directory). These locations
106are subject to change.</p></li>
107
108</ul>
109
110</div>
111</body>
112</html>
113