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 19 the analyzer is installed, follow the <a 20 href="/scan-build.html">instructions</a> on using <tt>scan-build</tt> to 21 get 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 26 OS X. These are built to run on OS X 10.7 and later.</p> 27 28 <p>Builds are released frequently. Often the differences between build 29 numbers being a few bug fixes or minor feature improvements. When using 30 the analyzer, we recommend that you check back here occasionally for new 31 builds, especially if the build you are using is more than a couple 32 weeks 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 39 we need volunteers who are willing to help provide such regular builds. 40 If you wish to help contribute regular builds of the analyzer on other 41 platforms, please email the <a 42 href="http://lists.llvm.org/mailman/listinfo/cfe-dev">Clang 43 Developers' 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 48 archive has the name <b><tt>checker-XXX.tar.bz2</tt></b> then the 49 archive will expand to a directory called <b><tt>checker-XXX</tt></b>. 50 You do not need to place this directory or the contents of this 51 directory in any special place. Uninstalling the analyzer is as simple 52 as deleting this directory.</p> 53 54 <p>Most of the files in the <b><tt>checker-XXX</tt></b> directory will 55 be supporting files for the analyzer that you can simply ignore. Most 56 users will only care about two files, which are located at the top of 57 the <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 62 utility to <tt>scan-build</tt>, <tt>scan-view</tt> is used to view 63 analysis results generated by <tt>scan-build</tt>. There is an option 64 that one can pass to <tt>scan-build</tt> to cause <tt>scan-view</tt> to 65 run 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 75 path for <tt>scan-build</tt> when running it. It is also possible to use 76 a symbolic link to <tt>scan-build</tt>, such one located in a directory 77 in your path. When <tt>scan-build</tt> runs it will automatically 78 determine 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 83 so, please follow the instructions for <a 84 href="http://clang.llvm.org/get_started.html#build">building Clang from 85 source 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 94 default), 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 96 can also do <tt>make install</tt> to install the LLVM/Clang libraries and 97 binaries 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> 101 programs. 102 103 <p>These are installed via <tt>make install</tt> into the bin directory 104 when clang is built.</p></li> 105 106 </ul> 107 </div> 108 </div> 109 </body> 110 </html> 111 112