diff options
Diffstat (limited to 'more/getting_started/unix-variants.html')
-rw-r--r-- | more/getting_started/unix-variants.html | 264 |
1 files changed, 134 insertions, 130 deletions
diff --git a/more/getting_started/unix-variants.html b/more/getting_started/unix-variants.html index 47c29d8588..27e7f4b532 100644 --- a/more/getting_started/unix-variants.html +++ b/more/getting_started/unix-variants.html @@ -3,7 +3,7 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -<meta name="generator" content="Docutils 0.7: http://docutils.sourceforge.net/" /> +<meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" /> <title>Boost Getting Started on Unix Variants</title> <meta content="Getting Started with Boost on Unix Variants (including Linux and MacOS)" name="description" /> <link rel="stylesheet" href="../../rst.css" type="text/css" /> @@ -30,45 +30,45 @@ <div class="contents topic" id="index"> <p class="topic-title first">Index</p> <ul class="auto-toc simple"> -<li><a class="reference internal" href="#get-boost" id="id21">1 Get Boost</a></li> -<li><a class="reference internal" href="#the-boost-distribution" id="id22">2 The Boost Distribution</a></li> -<li><a class="reference internal" href="#header-only-libraries" id="id23">3 Header-Only Libraries</a></li> -<li><a class="reference internal" href="#build-a-simple-program-using-boost" id="id24">4 Build a Simple Program Using Boost</a><ul class="auto-toc"> -<li><a class="reference internal" href="#errors-and-warnings" id="id25">4.1 Errors and Warnings</a></li> +<li><a class="reference internal" href="#get-boost" id="id20">1 Get Boost</a></li> +<li><a class="reference internal" href="#the-boost-distribution" id="id21">2 The Boost Distribution</a></li> +<li><a class="reference internal" href="#header-only-libraries" id="id22">3 Header-Only Libraries</a></li> +<li><a class="reference internal" href="#build-a-simple-program-using-boost" id="id23">4 Build a Simple Program Using Boost</a><ul class="auto-toc"> +<li><a class="reference internal" href="#errors-and-warnings" id="id24">4.1 Errors and Warnings</a></li> </ul> </li> -<li><a class="reference internal" href="#prepare-to-use-a-boost-library-binary" id="id26">5 Prepare to Use a Boost Library Binary</a><ul class="auto-toc"> -<li><a class="reference internal" href="#easy-build-and-install" id="id27">5.1 Easy Build and Install</a></li> -<li><a class="reference internal" href="#or-build-custom-binaries" id="id28">5.2 Or, Build Custom Binaries</a><ul class="auto-toc"> -<li><a class="reference internal" href="#get-bjam" id="id29">5.2.1 Get <tt class="docutils literal">bjam</tt></a></li> -<li><a class="reference internal" href="#identify-your-toolset" id="id30">5.2.2 Identify Your Toolset</a></li> -<li><a class="reference internal" href="#select-a-build-directory" id="id31">5.2.3 Select a Build Directory</a></li> -<li><a class="reference internal" href="#invoke-bjam" id="id32">5.2.4 Invoke <tt class="docutils literal">bjam</tt></a></li> +<li><a class="reference internal" href="#prepare-to-use-a-boost-library-binary" id="id25">5 Prepare to Use a Boost Library Binary</a><ul class="auto-toc"> +<li><a class="reference internal" href="#easy-build-and-install" id="id26">5.1 Easy Build and Install</a></li> +<li><a class="reference internal" href="#or-build-custom-binaries" id="id27">5.2 Or, Build Custom Binaries</a><ul class="auto-toc"> +<li><a class="reference internal" href="#get-bjam" id="id28">5.2.1 Get <tt class="docutils literal"><span class="pre">bjam</span></tt></a></li> +<li><a class="reference internal" href="#identify-your-toolset" id="id29">5.2.2 Identify Your Toolset</a></li> +<li><a class="reference internal" href="#select-a-build-directory" id="id30">5.2.3 Select a Build Directory</a></li> +<li><a class="reference internal" href="#invoke-bjam" id="id31">5.2.4 Invoke <tt class="docutils literal"><span class="pre">bjam</span></tt></a></li> </ul> </li> -<li><a class="reference internal" href="#expected-build-output" id="id33">5.3 Expected Build Output</a></li> -<li><a class="reference internal" href="#in-case-of-build-errors" id="id34">5.4 In Case of Build Errors</a></li> +<li><a class="reference internal" href="#expected-build-output" id="id32">5.3 Expected Build Output</a></li> +<li><a class="reference internal" href="#in-case-of-build-errors" id="id33">5.4 In Case of Build Errors</a></li> </ul> </li> -<li><a class="reference internal" href="#link-your-program-to-a-boost-library" id="id35">6 Link Your Program to a Boost Library</a><ul class="auto-toc"> -<li><a class="reference internal" href="#library-naming" id="id36">6.1 Library Naming</a></li> -<li><a class="reference internal" href="#test-your-program" id="id37">6.2 Test Your Program</a></li> +<li><a class="reference internal" href="#link-your-program-to-a-boost-library" id="id34">6 Link Your Program to a Boost Library</a><ul class="auto-toc"> +<li><a class="reference internal" href="#library-naming" id="id35">6.1 Library Naming</a></li> +<li><a class="reference internal" href="#test-your-program" id="id36">6.2 Test Your Program</a></li> </ul> </li> -<li><a class="reference internal" href="#conclusion-and-further-resources" id="id38">7 Conclusion and Further Resources</a></li> +<li><a class="reference internal" href="#conclusion-and-further-resources" id="id37">7 Conclusion and Further Resources</a></li> </ul> </div> <div class="section" id="get-boost"> -<h1><a class="toc-backref" href="#id21">1 Get Boost</a></h1> +<h1><a class="toc-backref" href="#id20">1 Get Boost</a></h1> <p>The most reliable way to get a copy of Boost is to download a distribution from <a class="reference external" href="http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=8041">SourceForge</a>:</p> <ol class="arabic"> -<li><p class="first">Download <a class="reference external" href="http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=8041"><tt class="docutils literal">boost_1_42_0</tt><tt class="docutils literal">.tar.bz2</tt></a>.</p> +<li><p class="first">Download <a class="reference external" href="http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=8041"><tt class="docutils literal"><span class="pre">boost_1_43_0</span></tt><tt class="docutils literal"><span class="pre">.tar.bz2</span></tt></a>.</p> </li> <li><p class="first">In the directory where you want to put the Boost installation, execute</p> <pre class="literal-block"> -tar --bzip2 -xf <em>/path/to/</em><tt class="docutils literal">boost_1_42_0</tt>.tar.bz2 +tar --bzip2 -xf <em>/path/to/</em><tt class="docutils literal"><span class="pre">boost_1_43_0</span></tt>.tar.bz2 </pre> </li> </ol> @@ -88,10 +88,10 @@ from <a class="reference external" href="http://sourceforge.net/project/showfile <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) --> </div> <div class="section" id="the-boost-distribution"> -<h1><a class="toc-backref" href="#id22">2 The Boost Distribution</a></h1> +<h1><a class="toc-backref" href="#id21">2 The Boost Distribution</a></h1> <p>This is a sketch of the resulting directory structure:</p> <pre class="literal-block"> -<strong>boost_1_42_0</strong><strong>/</strong> .................<em>The “boost root directory”</em> +<strong>boost_1_43_0</strong><strong>/</strong> .................<em>The “boost root directory”</em> <strong>index.htm</strong> .........<em>A copy of www.boost.org starts here</em> <strong>boost</strong><strong>/</strong> .........................<em>All Boost Header files</em> <tt class="docutils literal"> </tt> @@ -112,40 +112,40 @@ from <a class="reference external" href="http://sourceforge.net/project/showfile but most libraries follow a few patterns:</p> <ul class="pre-wrap last"> <li><p class="first">Some older libraries and most very small libraries place all -public headers directly into <tt class="docutils literal">boost</tt><tt class="docutils literal">/</tt>.</p> +public headers directly into <tt class="docutils literal"><span class="pre">boost</span></tt><tt class="docutils literal"><span class="pre">/</span></tt>.</p> </li> <li><p class="first">Most libraries' public headers live in a subdirectory of -<tt class="docutils literal">boost</tt><tt class="docutils literal">/</tt>, named after the library. For example, you'll find -the Python library's <tt class="docutils literal">def.hpp</tt> header in</p> +<tt class="docutils literal"><span class="pre">boost</span></tt><tt class="docutils literal"><span class="pre">/</span></tt>, named after the library. For example, you'll find +the Python library's <tt class="docutils literal"><span class="pre">def.hpp</span></tt> header in</p> <pre class="literal-block"> -<tt class="docutils literal">boost</tt><tt class="docutils literal">/</tt><tt class="docutils literal">python</tt><tt class="docutils literal">/</tt><tt class="docutils literal">def.hpp</tt>. +<tt class="docutils literal"><span class="pre">boost</span></tt><tt class="docutils literal"><span class="pre">/</span></tt><tt class="docutils literal"><span class="pre">python</span></tt><tt class="docutils literal"><span class="pre">/</span></tt><tt class="docutils literal"><span class="pre">def.hpp</span></tt>. </pre> </li> -<li><p class="first">Some libraries have an “aggregate header” in <tt class="docutils literal">boost</tt><tt class="docutils literal">/</tt> that -<tt class="docutils literal">#include</tt>s all of the library's other headers. For +<li><p class="first">Some libraries have an “aggregate header” in <tt class="docutils literal"><span class="pre">boost</span></tt><tt class="docutils literal"><span class="pre">/</span></tt> that +<tt class="docutils literal"><span class="pre">#include</span></tt>s all of the library's other headers. For example, <a class="reference external" href="../../libs/python/doc/building.html">Boost.Python</a>'s aggregate header is</p> <pre class="literal-block"> -<tt class="docutils literal">boost</tt><tt class="docutils literal">/</tt><tt class="docutils literal">python.hpp</tt>. +<tt class="docutils literal"><span class="pre">boost</span></tt><tt class="docutils literal"><span class="pre">/</span></tt><tt class="docutils literal"><span class="pre">python.hpp</span></tt>. </pre> </li> <li><p class="first">Most libraries place private headers in a subdirectory called -<tt class="docutils literal">detail</tt><tt class="docutils literal">/</tt>, or <tt class="docutils literal">aux_</tt><tt class="docutils literal">/</tt>. Don't expect to find +<tt class="docutils literal"><span class="pre">detail</span></tt><tt class="docutils literal"><span class="pre">/</span></tt>, or <tt class="docutils literal"><span class="pre">aux_</span></tt><tt class="docutils literal"><span class="pre">/</span></tt>. Don't expect to find anything you can use in these directories.</p> </li> </ul> </div> <p>It's important to note the following:</p> <ol class="arabic" id="boost-root-directory"> -<li><p class="first">The path to the <strong>boost root directory</strong> (often <tt class="docutils literal">/usr/local/</tt><tt class="docutils literal">boost_1_42_0</tt>) is -sometimes referred to as <tt class="docutils literal">$BOOST_ROOT</tt> in documentation and +<li><p class="first">The path to the <strong>boost root directory</strong> (often <tt class="docutils literal"><span class="pre">/usr/local/</span></tt><tt class="docutils literal"><span class="pre">boost_1_43_0</span></tt>) is +sometimes referred to as <tt class="docutils literal"><span class="pre">$BOOST_ROOT</span></tt> in documentation and mailing lists .</p> </li> <li><p class="first">To compile anything in Boost, you need a directory containing -the <tt class="docutils literal">boost</tt><tt class="docutils literal">/</tt> subdirectory in your <tt class="docutils literal">#include</tt> path. <tt class="docutils literal"> </tt></p> +the <tt class="docutils literal"><span class="pre">boost</span></tt><tt class="docutils literal"><span class="pre">/</span></tt> subdirectory in your <tt class="docutils literal"><span class="pre">#include</span></tt> path. <tt class="docutils literal"> </tt></p> </li> -<li><p class="first">Since all of Boost's header files have the <tt class="docutils literal">.hpp</tt> extension, -and live in the <tt class="docutils literal">boost</tt><tt class="docutils literal">/</tt> subdirectory of the boost root, your -Boost <tt class="docutils literal">#include</tt> directives will look like:</p> +<li><p class="first">Since all of Boost's header files have the <tt class="docutils literal"><span class="pre">.hpp</span></tt> extension, +and live in the <tt class="docutils literal"><span class="pre">boost</span></tt><tt class="docutils literal"><span class="pre">/</span></tt> subdirectory of the boost root, your +Boost <tt class="docutils literal"><span class="pre">#include</span></tt> directives will look like:</p> <pre class="literal-block"> #include <boost/<em>whatever</em>.hpp> </pre> @@ -156,9 +156,9 @@ Boost <tt class="docutils literal">#include</tt> directives will look like:</p> <p>depending on your preference regarding the use of angle bracket includes. <tt class="docutils literal"> </tt></p> </li> -<li><p class="first">Don't be distracted by the <tt class="docutils literal">doc</tt><tt class="docutils literal">/</tt> subdirectory; it only +<li><p class="first">Don't be distracted by the <tt class="docutils literal"><span class="pre">doc</span></tt><tt class="docutils literal"><span class="pre">/</span></tt> subdirectory; it only contains a subset of the Boost documentation. Start with -<tt class="docutils literal">libs</tt><tt class="docutils literal">/</tt><tt class="docutils literal">index.html</tt> if you're looking for the whole enchilada.</p> +<tt class="docutils literal"><span class="pre">libs</span></tt><tt class="docutils literal"><span class="pre">/</span></tt><tt class="docutils literal"><span class="pre">index.html</span></tt> if you're looking for the whole enchilada.</p> </li> </ol> <!-- Copyright David Abrahams 2006. Distributed under the Boost --> @@ -166,7 +166,7 @@ contains a subset of the Boost documentation. Start with <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) --> </div> <div class="section" id="header-only-libraries"> -<h1><a class="toc-backref" href="#id23">3 Header-Only Libraries</a></h1> +<h1><a class="toc-backref" href="#id22">3 Header-Only Libraries</a></h1> <p>The first thing many people want to know is, “how do I build Boost?” The good news is that often, there's nothing to build.</p> <div class="admonition-nothing-to-build admonition"> @@ -194,7 +194,7 @@ before building and installing it)</li> <p>A few libraries have optional separately-compiled binaries:</p> <ul class="simple"> <li><a class="reference external" href="../../libs/date_time/index.html">Boost.DateTime</a> has a binary component that is only needed if -you're using its <tt class="docutils literal">to_string</tt>/<tt class="docutils literal">from_string</tt> or serialization +you're using its <tt class="docutils literal"><span class="pre">to_string</span></tt>/<tt class="docutils literal"><span class="pre">from_string</span></tt> or serialization features, or if you're targeting Visual C++ 6.x or Borland.</li> <li><a class="reference external" href="../../libs/graph/index.html">Boost.Graph</a> also has a binary component that is only needed if you intend to <a class="reference external" href="../../libs/graph/doc/read_graphviz.html">parse GraphViz files</a>.</li> @@ -207,7 +207,7 @@ use</strong>.</li> <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) --> </div> <div class="section" id="build-a-simple-program-using-boost"> -<h1><a class="toc-backref" href="#id24">4 Build a Simple Program Using Boost</a></h1> +<h1><a class="toc-backref" href="#id23">4 Build a Simple Program Using Boost</a></h1> <p>To keep things simple, let's start by using a header-only library. The following program reads a sequence of integers from standard input, uses Boost.Lambda to multiply each number by three, and @@ -227,11 +227,11 @@ int main() in(std::cin), in(), std::cout << (_1 * 3) << " " ); } </pre> -<p>Copy the text of this program into a file called <tt class="docutils literal">example.cpp</tt>.</p> -<p>Now, in the directory where you saved <tt class="docutils literal">example.cpp</tt>, issue the +<p>Copy the text of this program into a file called <tt class="docutils literal"><span class="pre">example.cpp</span></tt>.</p> +<p>Now, in the directory where you saved <tt class="docutils literal"><span class="pre">example.cpp</span></tt>, issue the following command:</p> <pre class="literal-block"> -c++ -I <em>path/to/</em><tt class="docutils literal">boost_1_42_0</tt> example.cpp -o example +c++ -I <em>path/to/</em><tt class="docutils literal"><span class="pre">boost_1_43_0</span></tt> example.cpp -o example </pre> <p>To test the result, type:</p> <pre class="literal-block"> @@ -241,7 +241,7 @@ echo 1 2 3 | ./example <!-- Software License, Version 1.0. (See accompanying --> <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) --> <div class="section" id="errors-and-warnings"> -<h2><a class="toc-backref" href="#id25">4.1 Errors and Warnings</a></h2> +<h2><a class="toc-backref" href="#id24">4.1 Errors and Warnings</a></h2> <p>Don't be alarmed if you see compiler warnings originating in Boost headers. We try to eliminate them, but doing so isn't always practical.<a class="footnote-reference" href="#warnings" id="id5"><sup>3</sup></a> <strong>Errors are another matter</strong>. If you're @@ -254,20 +254,20 @@ correctly identified the <a class="reference internal" href="#boost-root-directo </div> </div> <div class="section" id="prepare-to-use-a-boost-library-binary"> -<h1><a class="toc-backref" href="#id26">5 Prepare to Use a Boost Library Binary</a></h1> +<h1><a class="toc-backref" href="#id25">5 Prepare to Use a Boost Library Binary</a></h1> <p>If you want to use any of the separately-compiled Boost libraries, you'll need to acquire library binaries.</p> <div class="section" id="easy-build-and-install"> -<h2><a class="toc-backref" href="#id27">5.1 Easy Build and Install</a></h2> -<p>Issue the following commands in the shell (don't type <tt class="docutils literal">$</tt>; that +<h2><a class="toc-backref" href="#id26">5.1 Easy Build and Install</a></h2> +<p>Issue the following commands in the shell (don't type <tt class="docutils literal"><span class="pre">$</span></tt>; that represents the shell's prompt):</p> <pre class="literal-block"> -<strong>$</strong> cd <em>path/to/</em><tt class="docutils literal">boost_1_42_0</tt> +<strong>$</strong> cd <em>path/to/</em><tt class="docutils literal"><span class="pre">boost_1_43_0</span></tt> <strong>$</strong> ./bootstrap.sh --help </pre> -<p>Select your configuration options and invoke <tt class="docutils literal">./bootstrap.sh</tt> again +<p>Select your configuration options and invoke <tt class="docutils literal"><span class="pre">./bootstrap.sh</span></tt> again without the <tt class="docutils literal"><span class="pre">--help</span></tt> option. Unless you have write permission in -your system's <tt class="docutils literal">/usr/local/</tt> directory, you'll probably want to at +your system's <tt class="docutils literal"><span class="pre">/usr/local/</span></tt> directory, you'll probably want to at least use</p> <pre class="literal-block"> <strong>$</strong> ./bootstrap.sh <strong>--prefix=</strong><em>path</em>/<em>to</em>/<em>installation</em>/<em>prefix</em> @@ -278,15 +278,15 @@ long wait you'll experience if you build everything. Finally,</p> <pre class="literal-block"> <strong>$</strong> ./bjam install </pre> -<p>will leave Boost binaries in the <tt class="docutils literal">lib/</tt> subdirectory of your +<p>will leave Boost binaries in the <tt class="docutils literal"><span class="pre">lib/</span></tt> subdirectory of your installation prefix. You will also find a copy of the Boost -headers in the <tt class="docutils literal">include/</tt> subdirectory of the installation -prefix, so you can henceforth use that directory as an <tt class="docutils literal">#include</tt> +headers in the <tt class="docutils literal"><span class="pre">include/</span></tt> subdirectory of the installation +prefix, so you can henceforth use that directory as an <tt class="docutils literal"><span class="pre">#include</span></tt> path in place of the Boost root directory.</p> <p><a class="reference internal" href="#link-your-program-to-a-boost-library"><em>skip to the next step</em></a></p> </div> <div class="section" id="or-build-custom-binaries"> -<h2><a class="toc-backref" href="#id28">5.2 Or, Build Custom Binaries</a></h2> +<h2><a class="toc-backref" href="#id27">5.2 Or, Build Custom Binaries</a></h2> <p>If you're using a compiler other than your system's default, you'll need to use <a class="reference external" href="../../tools/build/index.html">Boost.Build</a> to create binaries.</p> <p>You'll also @@ -302,22 +302,22 @@ separately. See the <a class="reference external" href="https://svn.boost.org/t <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) --> <p><a class="reference external" href="../../tools/build/index.html">Boost.Build</a> is a text-based system for developing, testing, and installing software. To use it, you'll need an executable called -<tt class="docutils literal">bjam</tt>.</p> +<tt class="docutils literal"><span class="pre">bjam</span></tt>.</p> <!-- .. _Boost.Jam documentation: Boost.Jam_ --> <div class="section" id="get-bjam"> -<h3><a class="toc-backref" href="#id29">5.2.1 Get <tt class="docutils literal">bjam</tt></a></h3> -<p><tt class="docutils literal">bjam</tt> is the command-line tool that drives the Boost Build -system. To build Boost binaries, you'll invoke <tt class="docutils literal">bjam</tt> from the +<h3><a class="toc-backref" href="#id28">5.2.1 Get <tt class="docutils literal"><span class="pre">bjam</span></tt></a></h3> +<p><tt class="docutils literal"><span class="pre">bjam</span></tt> is the command-line tool that drives the Boost Build +system. To build Boost binaries, you'll invoke <tt class="docutils literal"><span class="pre">bjam</span></tt> from the Boost root.</p> -<p>We suggest you <a class="reference external" href="http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=72941">download a pre-built <tt class="docutils literal">bjam</tt> executable</a> for your platform. -Alternatively, you can build <tt class="docutils literal">bjam</tt> yourself using <a class="reference external" href="../../doc/html/jam/building.html">these +<p>We suggest you <a class="reference external" href="http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=72941">download a pre-built <tt class="docutils literal"><span class="pre">bjam</span></tt> executable</a> for your platform. +Alternatively, you can build <tt class="docutils literal"><span class="pre">bjam</span></tt> yourself using <a class="reference external" href="../../doc/html/jam/building.html">these instructions</a>.</p> -<p>Move the <tt class="docutils literal">bjam</tt> executable into a directory in your PATH. You can +<p>Move the <tt class="docutils literal"><span class="pre">bjam</span></tt> executable into a directory in your PATH. You can see the list of directories in your PATH, separated by colons, -by typing “<tt class="docutils literal">echo $PATH</tt>” at the command prompt.</p> +by typing “<tt class="docutils literal"><span class="pre">echo</span> <span class="pre">$PATH</span></tt>” at the command prompt.</p> </div> <div class="section" id="identify-your-toolset"> -<span id="toolset-name"></span><span id="toolset"></span><h3><a class="toc-backref" href="#id30">5.2.2 Identify Your Toolset</a></h3> +<span id="toolset-name"></span><span id="toolset"></span><h3><a class="toc-backref" href="#id29">5.2.2 Identify Your Toolset</a></h3> <p>First, find the toolset corresponding to your compiler in the following table (an up-to-date list is always available <a class="reference external" href="http://www.boost.org/boost-build2/doc/html/bbv2/reference/tools.html">in the Boost.Build documentation</a>).</p> @@ -341,70 +341,70 @@ Name</th> </tr> </thead> <tbody valign="top"> -<tr><td><tt class="docutils literal">acc</tt></td> +<tr><td><tt class="docutils literal"><span class="pre">acc</span></tt></td> <td>Hewlett Packard</td> <td>Only very recent versions are known to work well with Boost</td> </tr> -<tr><td><tt class="docutils literal">borland</tt></td> +<tr><td><tt class="docutils literal"><span class="pre">borland</span></tt></td> <td>Borland</td> <td> </td> </tr> -<tr><td><tt class="docutils literal">como</tt></td> +<tr><td><tt class="docutils literal"><span class="pre">como</span></tt></td> <td>Comeau Computing</td> <td>Using this toolset may require <a class="reference external" href="../../tools/build/index.html">configuring</a> another toolset to act as its backend</td> </tr> -<tr><td><tt class="docutils literal">cw</tt></td> +<tr><td><tt class="docutils literal"><span class="pre">cw</span></tt></td> <td>Metrowerks/Freescale</td> <td>The CodeWarrior compiler. We have not tested versions of this compiler produced since it was sold to Freescale.</td> </tr> -<tr><td><tt class="docutils literal">dmc</tt></td> +<tr><td><tt class="docutils literal"><span class="pre">dmc</span></tt></td> <td>Digital Mars</td> <td>As of this Boost release, no version of dmc is known to handle Boost well.</td> </tr> -<tr><td><tt class="docutils literal">darwin</tt></td> +<tr><td><tt class="docutils literal"><span class="pre">darwin</span></tt></td> <td>Apple Computer</td> <td>Apple's version of the GCC toolchain with support for Darwin and MacOS X features such as frameworks.</td> </tr> -<tr><td><tt class="docutils literal">gcc</tt></td> +<tr><td><tt class="docutils literal"><span class="pre">gcc</span></tt></td> <td>The Gnu Project</td> <td>Includes support for Cygwin and MinGW compilers.</td> </tr> -<tr><td><tt class="docutils literal">hp_cxx</tt></td> +<tr><td><tt class="docutils literal"><span class="pre">hp_cxx</span></tt></td> <td>Hewlett Packard</td> <td>Targeted at the Tru64 operating system.</td> </tr> -<tr><td><tt class="docutils literal">intel</tt></td> +<tr><td><tt class="docutils literal"><span class="pre">intel</span></tt></td> <td>Intel</td> <td> </td> </tr> -<tr><td><tt class="docutils literal">msvc</tt></td> +<tr><td><tt class="docutils literal"><span class="pre">msvc</span></tt></td> <td>Microsoft</td> <td> </td> </tr> -<tr><td><tt class="docutils literal">qcc</tt></td> +<tr><td><tt class="docutils literal"><span class="pre">qcc</span></tt></td> <td>QNX Software Systems</td> <td> </td> </tr> -<tr><td><tt class="docutils literal">sun</tt></td> +<tr><td><tt class="docutils literal"><span class="pre">sun</span></tt></td> <td>Sun</td> <td>Only very recent versions are known to work well with Boost.</td> </tr> -<tr><td><tt class="docutils literal">vacpp</tt></td> +<tr><td><tt class="docutils literal"><span class="pre">vacpp</span></tt></td> <td>IBM</td> <td>The VisualAge C++ compiler.</td> </tr> @@ -416,17 +416,17 @@ a hyphen, e.g. <tt class="docutils literal"><span class="pre">intel-9.0</span></ <tt class="docutils literal"><span class="pre">borland-5.4.3</span></tt>. <tt class="docutils literal"> </tt></p> </div> <div class="section" id="select-a-build-directory"> -<span id="id11"></span><span id="build-directory"></span><h3><a class="toc-backref" href="#id31">5.2.3 Select a Build Directory</a></h3> +<span id="id11"></span><span id="build-directory"></span><h3><a class="toc-backref" href="#id30">5.2.3 Select a Build Directory</a></h3> <p><a class="reference external" href="../../tools/build/index.html">Boost.Build</a> will place all intermediate files it generates while building into the <strong>build directory</strong>. If your Boost root directory is writable, this step isn't strictly necessary: by -default Boost.Build will create a <tt class="docutils literal">bin.v2/</tt> subdirectory for that +default Boost.Build will create a <tt class="docutils literal"><span class="pre">bin.v2/</span></tt> subdirectory for that purpose in your current working directory.</p> </div> <div class="section" id="invoke-bjam"> -<h3><a class="toc-backref" href="#id32">5.2.4 Invoke <tt class="docutils literal">bjam</tt></a></h3> +<h3><a class="toc-backref" href="#id31">5.2.4 Invoke <tt class="docutils literal"><span class="pre">bjam</span></tt></a></h3> <p>Change your current directory to the Boost root directory and -invoke <tt class="docutils literal">bjam</tt> as follows:</p> +invoke <tt class="docutils literal"><span class="pre">bjam</span></tt> as follows:</p> <pre class="literal-block"> bjam <strong>--build-dir=</strong><a class="reference internal" href="#id11"><em>build-directory</em></a> <strong>toolset=</strong><a class="reference internal" href="#toolset-name"><em>toolset-name</em></a> <tt class="docutils literal"> </tt> stage </pre> @@ -434,23 +434,23 @@ bjam <strong>--build-dir=</strong><a class="reference internal" href="#id11"><em please see the <a class="reference external" href="http://www.boost.org/boost-build2/doc/html/bbv2/advanced/invocation.html">Boost.Build documentation</a>.</p> <p>For example, your session might look like this:</p> <pre class="literal-block"> -$ cd ~/<tt class="docutils literal">boost_1_42_0</tt> +$ cd ~/<tt class="docutils literal"><span class="pre">boost_1_43_0</span></tt> $ bjam <strong>--build-dir=</strong>/tmp/build-boost <strong>toolset=</strong>gcc stage </pre> -<p>That will build static and shared non-debug multi-threaded variants of the libraries. To build all variants, pass the additional option, “<tt class="docutils literal"><span class="pre">--build-type=complete</span></tt>”.</p> +<p>That will build static and shared non-debug multi-threaded variants of the libraries. To build all variants, pass the additional option, “``--build-type=complete``”.</p> <!-- Copyright David Abrahams 2006. Distributed under the Boost --> <!-- Software License, Version 1.0. (See accompanying --> <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) --> -<p>Building the special <tt class="docutils literal">stage</tt> target places Boost -library binaries in the <tt class="docutils literal">stage</tt><tt class="docutils literal">/</tt><tt class="docutils literal">lib</tt><tt class="docutils literal">/</tt> subdirectory of your <a class="reference internal" href="#build-directory">build +<p>Building the special <tt class="docutils literal"><span class="pre">stage</span></tt> target places Boost +library binaries in the <tt class="docutils literal"><span class="pre">stage</span></tt><tt class="docutils literal"><span class="pre">/</span></tt><tt class="docutils literal"><span class="pre">lib</span></tt><tt class="docutils literal"><span class="pre">/</span></tt> subdirectory of your <a class="reference internal" href="#build-directory">build directory</a>.</p> <div class="note"> <p class="first admonition-title">Note</p> -<p class="last"><tt class="docutils literal">bjam</tt> is case-sensitive; it is important that all the +<p class="last"><tt class="docutils literal"><span class="pre">bjam</span></tt> is case-sensitive; it is important that all the parts shown in <strong>bold</strong> type above be entirely lower-case.</p> </div> <p>For a description of other options you can pass when invoking -<tt class="docutils literal">bjam</tt>, type:</p> +<tt class="docutils literal"><span class="pre">bjam</span></tt>, type:</p> <pre class="literal-block"> bjam --help </pre> @@ -459,20 +459,20 @@ be interested in:</p> <ul class="simple"> <li>reviewing the list of library names with <tt class="docutils literal"><span class="pre">--show-libraries</span></tt></li> <li>limiting which libraries get built with the <tt class="docutils literal"><span class="pre">--with-</span></tt><em>library-name</em> or <tt class="docutils literal"><span class="pre">--without-</span></tt><em>library-name</em> options</li> -<li>choosing a specific build variant by adding <tt class="docutils literal">release</tt> or -<tt class="docutils literal">debug</tt> to the command line.</li> +<li>choosing a specific build variant by adding <tt class="docutils literal"><span class="pre">release</span></tt> or +<tt class="docutils literal"><span class="pre">debug</span></tt> to the command line.</li> </ul> <div class="note"> <p class="first admonition-title">Note</p> <p class="last">Boost.Build can produce a great deal of output, which can make it easy to miss problems. If you want to make sure everything is went well, you might redirect the output into a -file by appending “<tt class="docutils literal">>build.log <span class="pre">2>&1</span></tt>” to your command line.</p> +file by appending “``>build.log 2>&1``” to your command line.</p> </div> </div> </div> <div class="section" id="expected-build-output"> -<h2><a class="toc-backref" href="#id33">5.3 Expected Build Output</a></h2> +<h2><a class="toc-backref" href="#id32">5.3 Expected Build Output</a></h2> <p>During the process of building Boost libraries, you can expect to see some messages printed on the console. These may include</p> <ul> @@ -496,7 +496,7 @@ look something like:</p> </ul> </div> <div class="section" id="in-case-of-build-errors"> -<h2><a class="toc-backref" href="#id34">5.4 In Case of Build Errors</a></h2> +<h2><a class="toc-backref" href="#id33">5.4 In Case of Build Errors</a></h2> <p>The only error messages you see when building Boost—if any—should be related to the IOStreams library's support of zip and bzip2 formats as described <a class="reference external" href="../../libs/iostreams/doc/installation.html">here</a>. Install the relevant development @@ -513,7 +513,7 @@ for your compiler to the <a class="reference external" href="http://www.boost.or </div> </div> <div class="section" id="link-your-program-to-a-boost-library"> -<h1><a class="toc-backref" href="#id35">6 Link Your Program to a Boost Library</a></h1> +<h1><a class="toc-backref" href="#id34">6 Link Your Program to a Boost Library</a></h1> <p>To demonstrate linking with a Boost binary library, we'll use the following simple program that extracts the subject lines from emails. It uses the <a class="reference external" href="../../libs/regex/index.html">Boost.Regex</a> library, which has a @@ -549,21 +549,21 @@ project.</li> <ol class="upperalpha"> <li><p class="first">You can specify the full path to each library:</p> <pre class="literal-block"> -$ c++ -I <em>path/to/</em><tt class="docutils literal">boost_1_42_0</tt> example.cpp -o example <strong>\</strong> +$ c++ -I <em>path/to/</em><tt class="docutils literal"><span class="pre">boost_1_43_0</span></tt> example.cpp -o example <strong>\</strong> <strong>~/boost/stage/lib/libboost_regex-gcc34-mt-d-1_36.a</strong> </pre> </li> -<li><p class="first">You can separately specify a directory to search (with <tt class="docutils literal"><span class="pre">-L</span></tt><em>directory</em>) and a library name to search for (with <tt class="docutils literal"><span class="pre">-l</span></tt><em>library</em>,<a class="footnote-reference" href="#lowercase-l" id="id15"><sup>2</sup></a> dropping the filename's leading <tt class="docutils literal">lib</tt> and trailing -suffix (<tt class="docutils literal">.a</tt> in this case):</p> +<li><p class="first">You can separately specify a directory to search (with <tt class="docutils literal"><span class="pre">-L</span></tt><em>directory</em>) and a library name to search for (with <tt class="docutils literal"><span class="pre">-l</span></tt><em>library</em>,<a class="footnote-reference" href="#lowercase-l" id="id15"><sup>2</sup></a> dropping the filename's leading <tt class="docutils literal"><span class="pre">lib</span></tt> and trailing +suffix (<tt class="docutils literal"><span class="pre">.a</span></tt> in this case):</p> <pre class="literal-block"> -$ c++ -I <em>path/to/</em><tt class="docutils literal">boost_1_42_0</tt> example.cpp -o example <strong>\</strong> +$ c++ -I <em>path/to/</em><tt class="docutils literal"><span class="pre">boost_1_43_0</span></tt> example.cpp -o example <strong>\</strong> <strong>-L~/boost/stage/lib/ -lboost_regex-gcc34-mt-d-1_36</strong> </pre> <p>As you can see, this method is just as terse as method A for one library; it <em>really</em> pays off when you're using multiple libraries from the same directory. Note, however, that if you -use this method with a library that has both static (<tt class="docutils literal">.a</tt>) and -dynamic (<tt class="docutils literal">.so</tt>) builds, the system may choose one +use this method with a library that has both static (<tt class="docutils literal"><span class="pre">.a</span></tt>) and +dynamic (<tt class="docutils literal"><span class="pre">.so</span></tt>) builds, the system may choose one automatically for you unless you pass a special option such as <tt class="docutils literal"><span class="pre">-static</span></tt> on the command line.</p> </li> @@ -571,7 +571,7 @@ automatically for you unless you pass a special option such as <p>In both cases above, the bold text is what you'd add to <a class="reference internal" href="#build-a-simple-program-using-boost">the command lines we explored earlier</a>.</p> <div class="section" id="library-naming"> -<h2><a class="toc-backref" href="#id36">6.1 Library Naming</a></h2> +<h2><a class="toc-backref" href="#id35">6.1 Library Naming</a></h2> <!-- Copyright David Abrahams 2006. Distributed under the Boost --> <!-- Software License, Version 1.0. (See accompanying --> <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) --> @@ -582,13 +582,13 @@ how it was built. For example, <tt class="docutils literal"><span class="pre">libboost_regex-vc71-mt-d-1_34.lib</span></tt> can be broken down into the following elements:</p> <dl class="docutils"> -<dt><tt class="docutils literal">lib</tt></dt> +<dt><tt class="docutils literal"><span class="pre">lib</span></tt></dt> <dd><em>Prefix</em>: except on Microsoft Windows, every Boost library name begins with this string. On Windows, only ordinary static -libraries use the <tt class="docutils literal">lib</tt> prefix; import libraries and DLLs do +libraries use the <tt class="docutils literal"><span class="pre">lib</span></tt> prefix; import libraries and DLLs do not.<a class="footnote-reference" href="#distinct" id="id17"><sup>4</sup></a></dd> -<dt><tt class="docutils literal">boost_regex</tt></dt> -<dd><em>Library name</em>: all boost library filenames begin with <tt class="docutils literal">boost_</tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">boost_regex</span></tt></dt> +<dd><em>Library name</em>: all boost library filenames begin with <tt class="docutils literal"><span class="pre">boost_</span></tt>.</dd> <dt><tt class="docutils literal"><span class="pre">-vc71</span></tt></dt> <dd><em>Toolset tag</em>: identifies the <a class="reference internal" href="#toolset">toolset</a> and version used to build the binary.</dd> @@ -604,34 +604,38 @@ feature, a single letter is added to the tag:</p> <blockquote> <table border="1" class="docutils"> <colgroup> -<col width="6%" /> -<col width="94%" /> +<col width="5%" /> +<col width="75%" /> +<col width="20%" /> </colgroup> <thead valign="bottom"> <tr><th class="head">Key</th> <th class="head">Use this library when:</th> +<th class="head">Boost.Build option</th> </tr> </thead> <tbody valign="top"> -<tr><td><tt class="docutils literal">s</tt></td> +<tr><td><tt class="docutils literal"><span class="pre">s</span></tt></td> <td>linking statically to the C++ standard library and compiler runtime support libraries.</td> +<td>runtime-link=static</td> </tr> -<tr><td><tt class="docutils literal">g</tt></td> +<tr><td><tt class="docutils literal"><span class="pre">g</span></tt></td> <td>using debug versions of the standard and runtime support libraries.</td> +<td>runtime-debugging=on</td> </tr> -<tr><td><tt class="docutils literal">y</tt></td> +<tr><td><tt class="docutils literal"><span class="pre">y</span></tt></td> <td>using a special <a class="reference external" href="../../libs/python/doc/building.html#variants">debug build of Python</a>.</td> +<td>python-debugging=on</td> </tr> -<tr><td><tt class="docutils literal">d</tt></td> +<tr><td><tt class="docutils literal"><span class="pre">d</span></tt></td> <td>building a debug version of your code.<a class="footnote-reference" href="#debug-abi" id="id18"><sup>5</sup></a></td> +<td>variant=debug</td> </tr> -<tr><td><tt class="docutils literal">p</tt></td> +<tr><td><tt class="docutils literal"><span class="pre">p</span></tt></td> <td>using the STLPort standard library rather than the default one supplied with your compiler.</td> -</tr> -<tr><td><tt class="docutils literal">n</tt></td> -<td>using STLPort's deprecated “native iostreams” feature.<a class="footnote-reference" href="#native" id="id19"><sup>6</sup></a></td> +<td>stdlib=stlport</td> </tr> </tbody> </table> @@ -646,12 +650,12 @@ ABI tag is ommitted.</p> <dd><em>Version tag</em>: the full Boost release number, with periods replaced by underscores. For example, version 1.31.1 would be tagged as "-1_31_1".</dd> -<dt><tt class="docutils literal">.lib</tt></dt> +<dt><tt class="docutils literal"><span class="pre">.lib</span></tt></dt> <dd><em>Extension</em>: determined according to the operating system's usual convention. On most unix-style platforms the extensions are -<tt class="docutils literal">.a</tt> and <tt class="docutils literal">.so</tt> for static libraries (archives) and shared -libraries, respectively. On Windows, <tt class="docutils literal">.dll</tt> indicates a shared -library and <tt class="docutils literal">.lib</tt> indicates a +<tt class="docutils literal"><span class="pre">.a</span></tt> and <tt class="docutils literal"><span class="pre">.so</span></tt> for static libraries (archives) and shared +libraries, respectively. On Windows, <tt class="docutils literal"><span class="pre">.dll</span></tt> indicates a shared +library and <tt class="docutils literal"><span class="pre">.lib</span></tt> indicates a static or import library. Where supported by toolsets on unix variants, a full version extension is added (e.g. ".so.1.34") and a symbolic link to the library file, named without the trailing @@ -663,9 +667,9 @@ version number, will also be created.</dd> <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) --> </div> <div class="section" id="test-your-program"> -<h2><a class="toc-backref" href="#id37">6.2 Test Your Program</a></h2> +<h2><a class="toc-backref" href="#id36">6.2 Test Your Program</a></h2> <p>To test our subject extraction, we'll filter the following text -file. Copy it out of your browser and save it as <tt class="docutils literal">jayne.txt</tt>:</p> +file. Copy it out of your browser and save it as <tt class="docutils literal"><span class="pre">jayne.txt</span></tt>:</p> <pre class="literal-block"> To: George Shmidlap From: Rita Marlowe @@ -678,15 +682,15 @@ platform-specific settings so that the system will be able to find and load it when your program is run. Most platforms have an environment variable to which you can add the directory containing the library. On many platforms (Linux, FreeBSD) that variable is -<tt class="docutils literal">LD_LIBRARY_PATH</tt>, but on MacOS it's <tt class="docutils literal">DYLD_LIBRARY_PATH</tt>, and -on Cygwin it's simply <tt class="docutils literal">PATH</tt>. In most shells other than <tt class="docutils literal">csh</tt> -and <tt class="docutils literal">tcsh</tt>, you can adjust the variable as follows (again, don't -type the <tt class="docutils literal">$</tt>—that represents the shell prompt):</p> +<tt class="docutils literal"><span class="pre">LD_LIBRARY_PATH</span></tt>, but on MacOS it's <tt class="docutils literal"><span class="pre">DYLD_LIBRARY_PATH</span></tt>, and +on Cygwin it's simply <tt class="docutils literal"><span class="pre">PATH</span></tt>. In most shells other than <tt class="docutils literal"><span class="pre">csh</span></tt> +and <tt class="docutils literal"><span class="pre">tcsh</span></tt>, you can adjust the variable as follows (again, don't +type the <tt class="docutils literal"><span class="pre">$</span></tt>—that represents the shell prompt):</p> <pre class="literal-block"> <strong>$</strong> <em>VARIABLE_NAME</em>=<em>path/to/lib/directory</em>:${<em>VARIABLE_NAME</em>} <strong>$</strong> export <em>VARIABLE_NAME</em> </pre> -<p>On <tt class="docutils literal">csh</tt> and <tt class="docutils literal">tcsh</tt>, it's</p> +<p>On <tt class="docutils literal"><span class="pre">csh</span></tt> and <tt class="docutils literal"><span class="pre">tcsh</span></tt>, it's</p> <pre class="literal-block"> <strong>$</strong> setenv <em>VARIABLE_NAME</em> <em>path/to/lib/directory</em>:${<em>VARIABLE_NAME</em>} </pre> @@ -703,7 +707,7 @@ Spoil Rock Hunter?”</p> </div> </div> <div class="section" id="conclusion-and-further-resources"> -<h1><a class="toc-backref" href="#id38">7 Conclusion and Further Resources</a></h1> +<h1><a class="toc-backref" href="#id37">7 Conclusion and Further Resources</a></h1> <p>This concludes your introduction to Boost and to integrating it with your programs. As you start using Boost in earnest, there are surely a few additional points you'll wish we had covered. One day @@ -772,7 +776,7 @@ same name.</td></tr> <tbody valign="top"> <tr><td class="label"><a class="fn-backref" href="#id18">[5]</a></td><td>These libraries were compiled without optimization or inlining, with full debug symbols enabled, and without -<tt class="docutils literal">NDEBUG</tt> <tt class="docutils literal">#define</tt>d. Although it's true that sometimes +<tt class="docutils literal"><span class="pre">NDEBUG</span></tt> <tt class="docutils literal"><span class="pre">#define</span></tt>d. Although it's true that sometimes these choices don't affect binary compatibility with other compiled code, you can't count on that with Boost libraries.</td></tr> </tbody> @@ -780,7 +784,7 @@ compiled code, you can't count on that with Boost libraries.</td></tr> <table class="docutils footnote" frame="void" id="native" rules="none"> <colgroup><col class="label" /><col /></colgroup> <tbody valign="top"> -<tr><td class="label"><a class="fn-backref" href="#id19">[6]</a></td><td>This feature of STLPort is deprecated because it's +<tr><td class="label">[6]</td><td>This feature of STLPort is deprecated because it's impossible to make it work transparently to the user; we don't recommend it.</td></tr> </tbody> |