unix-variants.html 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <meta name="generator" content="Docutils 0.7: http://docutils.sourceforge.net/" />
  7. <title>Boost Getting Started on Unix Variants</title>
  8. <meta content="Getting Started with Boost on Unix Variants (including Linux and MacOS)" name="description" />
  9. <link rel="stylesheet" href="../../rst.css" type="text/css" />
  10. </head>
  11. <body>
  12. <div class="document" id="logo-getting-started-on-unix-variants">
  13. <h1 class="title"><a class="reference external" href="../../index.htm"><img alt="Boost" class="boost-logo" src="../../boost.png" /></a> Getting Started on Unix Variants</h1>
  14. <!-- Copyright David Abrahams 2006. Distributed under the Boost -->
  15. <!-- Software License, Version 1.0. (See accompanying -->
  16. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  17. <!-- maybe we don't need this
  18. .. Admonition:: A note to Cygwin_ and MinGW_ users
  19. If you plan to build from the Cygwin_ bash shell, you're in the
  20. right place. If you plan to use your tools from the Windows
  21. command prompt, you should follow the instructions for `getting
  22. started on Windows`_. Other command shells, such as MinGW_\ 's
  23. MSYS, are not supported—they may or may not work.
  24. .. _`Getting Started on Windows`: windows.html
  25. .. _Cygwin: http://www.cygwin.com
  26. .. _MinGW: http://mingw.org -->
  27. <div class="contents topic" id="index">
  28. <p class="topic-title first">Index</p>
  29. <ul class="auto-toc simple">
  30. <li><a class="reference internal" href="#get-boost" id="id20">1&nbsp;&nbsp;&nbsp;Get Boost</a></li>
  31. <li><a class="reference internal" href="#the-boost-distribution" id="id21">2&nbsp;&nbsp;&nbsp;The Boost Distribution</a></li>
  32. <li><a class="reference internal" href="#header-only-libraries" id="id22">3&nbsp;&nbsp;&nbsp;Header-Only Libraries</a></li>
  33. <li><a class="reference internal" href="#build-a-simple-program-using-boost" id="id23">4&nbsp;&nbsp;&nbsp;Build a Simple Program Using Boost</a><ul class="auto-toc">
  34. <li><a class="reference internal" href="#errors-and-warnings" id="id24">4.1&nbsp;&nbsp;&nbsp;Errors and Warnings</a></li>
  35. </ul>
  36. </li>
  37. <li><a class="reference internal" href="#prepare-to-use-a-boost-library-binary" id="id25">5&nbsp;&nbsp;&nbsp;Prepare to Use a Boost Library Binary</a><ul class="auto-toc">
  38. <li><a class="reference internal" href="#easy-build-and-install" id="id26">5.1&nbsp;&nbsp;&nbsp;Easy Build and Install</a></li>
  39. <li><a class="reference internal" href="#or-build-custom-binaries" id="id27">5.2&nbsp;&nbsp;&nbsp;Or, Build Custom Binaries</a><ul class="auto-toc">
  40. <li><a class="reference internal" href="#get-bjam" id="id28">5.2.1&nbsp;&nbsp;&nbsp;Get <tt class="docutils literal">bjam</tt></a></li>
  41. <li><a class="reference internal" href="#identify-your-toolset" id="id29">5.2.2&nbsp;&nbsp;&nbsp;Identify Your Toolset</a></li>
  42. <li><a class="reference internal" href="#select-a-build-directory" id="id30">5.2.3&nbsp;&nbsp;&nbsp;Select a Build Directory</a></li>
  43. <li><a class="reference internal" href="#invoke-bjam" id="id31">5.2.4&nbsp;&nbsp;&nbsp;Invoke <tt class="docutils literal">bjam</tt></a></li>
  44. </ul>
  45. </li>
  46. <li><a class="reference internal" href="#expected-build-output" id="id32">5.3&nbsp;&nbsp;&nbsp;Expected Build Output</a></li>
  47. <li><a class="reference internal" href="#in-case-of-build-errors" id="id33">5.4&nbsp;&nbsp;&nbsp;In Case of Build Errors</a></li>
  48. </ul>
  49. </li>
  50. <li><a class="reference internal" href="#link-your-program-to-a-boost-library" id="id34">6&nbsp;&nbsp;&nbsp;Link Your Program to a Boost Library</a><ul class="auto-toc">
  51. <li><a class="reference internal" href="#library-naming" id="id35">6.1&nbsp;&nbsp;&nbsp;Library Naming</a></li>
  52. <li><a class="reference internal" href="#test-your-program" id="id36">6.2&nbsp;&nbsp;&nbsp;Test Your Program</a></li>
  53. </ul>
  54. </li>
  55. <li><a class="reference internal" href="#conclusion-and-further-resources" id="id37">7&nbsp;&nbsp;&nbsp;Conclusion and Further Resources</a></li>
  56. </ul>
  57. </div>
  58. <div class="section" id="get-boost">
  59. <h1><a class="toc-backref" href="#id20">1&nbsp;&nbsp;&nbsp;Get Boost</a></h1>
  60. <p>The most reliable way to get a copy of Boost is to download a
  61. distribution from <a class="reference external" href="http://sourceforge.net/project/showfiles.php?group_id=7586&amp;package_id=8041">SourceForge</a>:</p>
  62. <ol class="arabic">
  63. <li><p class="first">Download <a class="reference external" href="http://sourceforge.net/project/showfiles.php?group_id=7586&amp;package_id=8041"><tt class="docutils literal">boost_1_45_0</tt><tt class="docutils literal">.tar.bz2</tt></a>.</p>
  64. </li>
  65. <li><p class="first">In the directory where you want to put the Boost installation,
  66. execute</p>
  67. <pre class="literal-block">
  68. tar --bzip2 -xf <em>/path/to/</em><tt class="docutils literal">boost_1_45_0</tt>.tar.bz2
  69. </pre>
  70. </li>
  71. </ol>
  72. <div class="admonition-other-packages admonition">
  73. <p class="first admonition-title">Other Packages</p>
  74. <p class="last">RedHat, Debian, and other distribution packagers supply Boost
  75. library packages, however you may need to adapt these
  76. instructions if you use third-party packages, because their
  77. creators usually choose to break Boost up into several packages,
  78. reorganize the directory structure of the Boost distribution,
  79. and/or rename the library binaries.<a class="footnote-reference" href="#packagers" id="id2"><sup>1</sup></a> If you have
  80. any trouble, we suggest using an official Boost distribution
  81. from <a class="reference external" href="http://sourceforge.net/project/showfiles.php?group_id=7586&amp;package_id=8041">SourceForge</a>.</p>
  82. </div>
  83. <!-- Copyright David Abrahams 2006. Distributed under the Boost -->
  84. <!-- Software License, Version 1.0. (See accompanying -->
  85. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  86. </div>
  87. <div class="section" id="the-boost-distribution">
  88. <h1><a class="toc-backref" href="#id21">2&nbsp;&nbsp;&nbsp;The Boost Distribution</a></h1>
  89. <p>This is a sketch of the resulting directory structure:</p>
  90. <pre class="literal-block">
  91. <strong>boost_1_45_0</strong><strong>/</strong> .................<em>The “boost root directory”</em>
  92. <strong>index.htm</strong> .........<em>A copy of www.boost.org starts here</em>
  93. <strong>boost</strong><strong>/</strong> .........................<em>All Boost Header files</em>
  94. <tt class="docutils literal"> </tt>
  95. <strong>libs</strong><strong>/</strong> ............<em>Tests, .cpp</em>s<em>, docs, etc., by library</em>
  96. <strong>index.html</strong> ........<em>Library documentation starts here</em>
  97. <strong>algorithm</strong><strong>/</strong>
  98. <strong>any</strong><strong>/</strong>
  99. <strong>array</strong><strong>/</strong>
  100. <em>…more libraries…</em>
  101. <strong>status</strong><strong>/</strong> .........................<em>Boost-wide test suite</em>
  102. <strong>tools</strong><strong>/</strong> ...........<em>Utilities, e.g. bjam, quickbook, bcp</em>
  103. <strong>more</strong><strong>/</strong> ..........................<em>Policy documents, etc.</em>
  104. <strong>doc</strong><strong>/</strong> ...............<em>A subset of all Boost library docs</em>
  105. </pre>
  106. <div class="sidebar">
  107. <p class="first sidebar-title">Header Organization</p>
  108. <p class="pre-wrap">The organization of Boost library headers isn't entirely uniform,
  109. but most libraries follow a few patterns:</p>
  110. <ul class="pre-wrap last">
  111. <li><p class="first">Some older libraries and most very small libraries place all
  112. public headers directly into <tt class="docutils literal">boost</tt><tt class="docutils literal">/</tt>.</p>
  113. </li>
  114. <li><p class="first">Most libraries' public headers live in a subdirectory of
  115. <tt class="docutils literal">boost</tt><tt class="docutils literal">/</tt>, named after the library. For example, you'll find
  116. the Python library's <tt class="docutils literal">def.hpp</tt> header in</p>
  117. <pre class="literal-block">
  118. <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>.
  119. </pre>
  120. </li>
  121. <li><p class="first">Some libraries have an “aggregate header” in <tt class="docutils literal">boost</tt><tt class="docutils literal">/</tt> that
  122. <tt class="docutils literal">#include</tt>s all of the library's other headers. For
  123. example, <a class="reference external" href="../../libs/python/doc/building.html">Boost.Python</a>'s aggregate header is</p>
  124. <pre class="literal-block">
  125. <tt class="docutils literal">boost</tt><tt class="docutils literal">/</tt><tt class="docutils literal">python.hpp</tt>.
  126. </pre>
  127. </li>
  128. <li><p class="first">Most libraries place private headers in a subdirectory called
  129. <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
  130. anything you can use in these directories.</p>
  131. </li>
  132. </ul>
  133. </div>
  134. <p>It's important to note the following:</p>
  135. <ol class="arabic" id="boost-root-directory">
  136. <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_45_0</tt>) is
  137. sometimes referred to as <tt class="docutils literal">$BOOST_ROOT</tt> in documentation and
  138. mailing lists .</p>
  139. </li>
  140. <li><p class="first">To compile anything in Boost, you need a directory containing
  141. 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>
  142. </li>
  143. <li><p class="first">Since all of Boost's header files have the <tt class="docutils literal">.hpp</tt> extension,
  144. and live in the <tt class="docutils literal">boost</tt><tt class="docutils literal">/</tt> subdirectory of the boost root, your
  145. Boost <tt class="docutils literal">#include</tt> directives will look like:</p>
  146. <pre class="literal-block">
  147. #include &lt;boost/<em>whatever</em>.hpp&gt;
  148. </pre>
  149. <p>or</p>
  150. <pre class="literal-block">
  151. #include &quot;boost/<em>whatever</em>.hpp&quot;
  152. </pre>
  153. <p>depending on your preference regarding the use of angle bracket
  154. includes. <tt class="docutils literal"> </tt></p>
  155. </li>
  156. <li><p class="first">Don't be distracted by the <tt class="docutils literal">doc</tt><tt class="docutils literal">/</tt> subdirectory; it only
  157. contains a subset of the Boost documentation. Start with
  158. <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>
  159. </li>
  160. </ol>
  161. <!-- Copyright David Abrahams 2006. Distributed under the Boost -->
  162. <!-- Software License, Version 1.0. (See accompanying -->
  163. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  164. </div>
  165. <div class="section" id="header-only-libraries">
  166. <h1><a class="toc-backref" href="#id22">3&nbsp;&nbsp;&nbsp;Header-Only Libraries</a></h1>
  167. <p>The first thing many people want to know is, “how do I build
  168. Boost?” The good news is that often, there's nothing to build.</p>
  169. <div class="admonition-nothing-to-build admonition">
  170. <p class="first admonition-title">Nothing to Build?</p>
  171. <p class="last">Most Boost libraries are <strong>header-only</strong>: they consist <em>entirely
  172. of header files</em> containing templates and inline functions, and
  173. require no separately-compiled library binaries or special
  174. treatment when linking.</p>
  175. </div>
  176. <!-- .. _separate: -->
  177. <p>The only Boost libraries that <em>must</em> be built separately are:</p>
  178. <ul class="simple">
  179. <li><a class="reference external" href="../../libs/filesystem/index.html">Boost.Filesystem</a></li>
  180. <li><a class="reference external" href="../../libs/graph_parallel/index.html">Boost.GraphParallel</a></li>
  181. <li><a class="reference external" href="../../libs/iostreams/index.html">Boost.IOStreams</a></li>
  182. <li><a class="reference external" href="../../libs/mpi/index.html">Boost.MPI</a></li>
  183. <li><a class="reference external" href="../../libs/program_options/index.html">Boost.ProgramOptions</a></li>
  184. <li><a class="reference external" href="../../libs/python/doc/building.html">Boost.Python</a> (see the <a class="reference external" href="../../libs/python/doc/building.html">Boost.Python build documentation</a>
  185. before building and installing it)</li>
  186. <li><a class="reference external" href="../../libs/regex/index.html">Boost.Regex</a></li>
  187. <li><a class="reference external" href="../../libs/serialization/index.html">Boost.Serialization</a></li>
  188. <li><a class="reference external" href="../../libs/signals/index.html">Boost.Signals</a></li>
  189. <li><a class="reference external" href="../../libs/system/index.html">Boost.System</a></li>
  190. <li><a class="reference external" href="../../doc/html/thread.html">Boost.Thread</a></li>
  191. <li><a class="reference external" href="../../libs/wave/index.html">Boost.Wave</a></li>
  192. </ul>
  193. <p>A few libraries have optional separately-compiled binaries:</p>
  194. <ul class="simple">
  195. <li><a class="reference external" href="../../libs/date_time/index.html">Boost.DateTime</a> has a binary component that is only needed if
  196. you're using its <tt class="docutils literal">to_string</tt>/<tt class="docutils literal">from_string</tt> or serialization
  197. features, or if you're targeting Visual C++ 6.x or Borland.</li>
  198. <li><a class="reference external" href="../../libs/graph/index.html">Boost.Graph</a> also has a binary component that is only needed if
  199. you intend to <a class="reference external" href="../../libs/graph/doc/read_graphviz.html">parse GraphViz files</a>.</li>
  200. <li><a class="reference external" href="../../libs/math/index.html">Boost.Math</a> has binary components for the TR1 and C99
  201. cmath functions.</li>
  202. <li><a class="reference external" href="../../libs/random/index.html">Boost.Random</a> has a binary component which is only needed if
  203. you're using <tt class="docutils literal">random_device</tt>.</li>
  204. <li><a class="reference external" href="../../libs/test/index.html">Boost.Test</a> can be used in “header-only” or “separately compiled”
  205. mode, although <strong>separate compilation is recommended for serious
  206. use</strong>.</li>
  207. </ul>
  208. <!-- Copyright David Abrahams 2006. Distributed under the Boost -->
  209. <!-- Software License, Version 1.0. (See accompanying -->
  210. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  211. </div>
  212. <div class="section" id="build-a-simple-program-using-boost">
  213. <h1><a class="toc-backref" href="#id23">4&nbsp;&nbsp;&nbsp;Build a Simple Program Using Boost</a></h1>
  214. <p>To keep things simple, let's start by using a header-only library.
  215. The following program reads a sequence of integers from standard
  216. input, uses Boost.Lambda to multiply each number by three, and
  217. writes them to standard output:</p>
  218. <pre class="literal-block">
  219. #include &lt;boost/lambda/lambda.hpp&gt;
  220. #include &lt;iostream&gt;
  221. #include &lt;iterator&gt;
  222. #include &lt;algorithm&gt;
  223. int main()
  224. {
  225. using namespace boost::lambda;
  226. typedef std::istream_iterator&lt;int&gt; in;
  227. std::for_each(
  228. in(std::cin), in(), std::cout &lt;&lt; (_1 * 3) &lt;&lt; &quot; &quot; );
  229. }
  230. </pre>
  231. <p>Copy the text of this program into a file called <tt class="docutils literal">example.cpp</tt>.</p>
  232. <p>Now, in the directory where you saved <tt class="docutils literal">example.cpp</tt>, issue the
  233. following command:</p>
  234. <pre class="literal-block">
  235. c++ -I <em>path/to/</em><tt class="docutils literal">boost_1_45_0</tt> example.cpp -o example
  236. </pre>
  237. <p>To test the result, type:</p>
  238. <pre class="literal-block">
  239. echo 1 2 3 | ./example
  240. </pre>
  241. <!-- Copyright David Abrahams 2006. Distributed under the Boost -->
  242. <!-- Software License, Version 1.0. (See accompanying -->
  243. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  244. <div class="section" id="errors-and-warnings">
  245. <h2><a class="toc-backref" href="#id24">4.1&nbsp;&nbsp;&nbsp;Errors and Warnings</a></h2>
  246. <p>Don't be alarmed if you see compiler warnings originating in Boost
  247. headers. We try to eliminate them, but doing so isn't always
  248. practical.<a class="footnote-reference" href="#warnings" id="id5"><sup>3</sup></a> <strong>Errors are another matter</strong>. If you're
  249. seeing compilation errors at this point in the tutorial, check to
  250. be sure you've copied the <a class="reference internal" href="#build-a-simple-program-using-boost">example program</a> correctly and that you've
  251. correctly identified the <a class="reference internal" href="#boost-root-directory">Boost root directory</a>.</p>
  252. <!-- Copyright David Abrahams 2006. Distributed under the Boost -->
  253. <!-- Software License, Version 1.0. (See accompanying -->
  254. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  255. </div>
  256. </div>
  257. <div class="section" id="prepare-to-use-a-boost-library-binary">
  258. <h1><a class="toc-backref" href="#id25">5&nbsp;&nbsp;&nbsp;Prepare to Use a Boost Library Binary</a></h1>
  259. <p>If you want to use any of the separately-compiled Boost libraries,
  260. you'll need to acquire library binaries.</p>
  261. <div class="section" id="easy-build-and-install">
  262. <h2><a class="toc-backref" href="#id26">5.1&nbsp;&nbsp;&nbsp;Easy Build and Install</a></h2>
  263. <p>Issue the following commands in the shell (don't type <tt class="docutils literal">$</tt>; that
  264. represents the shell's prompt):</p>
  265. <pre class="literal-block">
  266. <strong>$</strong> cd <em>path/to/</em><tt class="docutils literal">boost_1_45_0</tt>
  267. <strong>$</strong> ./bootstrap.sh --help
  268. </pre>
  269. <p>Select your configuration options and invoke <tt class="docutils literal">./bootstrap.sh</tt> again
  270. without the <tt class="docutils literal"><span class="pre">--help</span></tt> option. Unless you have write permission in
  271. your system's <tt class="docutils literal">/usr/local/</tt> directory, you'll probably want to at
  272. least use</p>
  273. <pre class="literal-block">
  274. <strong>$</strong> ./bootstrap.sh <strong>--prefix=</strong><em>path</em>/<em>to</em>/<em>installation</em>/<em>prefix</em>
  275. </pre>
  276. <p>to install somewhere else. Also, consider using the
  277. <tt class="docutils literal"><span class="pre">--show-libraries</span></tt> and <tt class="docutils literal"><span class="pre">--with-libraries=</span></tt><em>library-name-list</em> options to limit the
  278. long wait you'll experience if you build everything. Finally,</p>
  279. <pre class="literal-block">
  280. <strong>$</strong> ./bjam install
  281. </pre>
  282. <p>will leave Boost binaries in the <tt class="docutils literal">lib/</tt> subdirectory of your
  283. installation prefix. You will also find a copy of the Boost
  284. headers in the <tt class="docutils literal">include/</tt> subdirectory of the installation
  285. prefix, so you can henceforth use that directory as an <tt class="docutils literal">#include</tt>
  286. path in place of the Boost root directory.</p>
  287. <p><a class="reference internal" href="#link-your-program-to-a-boost-library"><em>skip to the next step</em></a></p>
  288. </div>
  289. <div class="section" id="or-build-custom-binaries">
  290. <h2><a class="toc-backref" href="#id27">5.2&nbsp;&nbsp;&nbsp;Or, Build Custom Binaries</a></h2>
  291. <p>If you're using a compiler other than your system's default, you'll
  292. need to use <a class="reference external" href="../../tools/build/index.html">Boost.Build</a> to create binaries.</p>
  293. <p>You'll also
  294. use this method if you need a nonstandard build variant (see the
  295. <a class="reference external" href="../../tools/build/index.html">Boost.Build documentation</a> for more details).</p>
  296. <div class="admonition-boost-cmake admonition">
  297. <p class="first admonition-title">Boost.CMake</p>
  298. <p class="last">There is also an experimental CMake build for boost, supported and distributed
  299. separately. See the <a class="reference external" href="https://svn.boost.org/trac/boost/wiki/CMake">Boost.CMake</a> wiki page for more information.</p>
  300. </div>
  301. <!-- Copyright David Abrahams 2006. Distributed under the Boost -->
  302. <!-- Software License, Version 1.0. (See accompanying -->
  303. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  304. <p><a class="reference external" href="../../tools/build/index.html">Boost.Build</a> is a text-based system for developing, testing, and
  305. installing software. To use it, you'll need an executable called
  306. <tt class="docutils literal">bjam</tt>.</p>
  307. <!-- .. _Boost.Jam documentation: Boost.Jam_ -->
  308. <div class="section" id="get-bjam">
  309. <h3><a class="toc-backref" href="#id28">5.2.1&nbsp;&nbsp;&nbsp;Get <tt class="docutils literal">bjam</tt></a></h3>
  310. <p><tt class="docutils literal">bjam</tt> is the command-line tool that drives the Boost Build
  311. system. To build Boost binaries, you'll invoke <tt class="docutils literal">bjam</tt> from the
  312. Boost root.</p>
  313. <p>We suggest you <a class="reference external" href="http://sourceforge.net/project/showfiles.php?group_id=7586&amp;package_id=72941">download a pre-built <tt class="docutils literal">bjam</tt> executable</a> for your platform.
  314. Alternatively, you can build <tt class="docutils literal">bjam</tt> yourself using <a class="reference external" href="../../doc/html/jam/building.html">these
  315. instructions</a>.</p>
  316. <p>Move the <tt class="docutils literal">bjam</tt> executable into a directory in your PATH. You can
  317. see the list of directories in your PATH, separated by colons,
  318. by typing “<tt class="docutils literal">echo $PATH</tt>” at the command prompt.</p>
  319. </div>
  320. <div class="section" id="identify-your-toolset">
  321. <span id="toolset-name"></span><span id="toolset"></span><h3><a class="toc-backref" href="#id29">5.2.2&nbsp;&nbsp;&nbsp;Identify Your Toolset</a></h3>
  322. <p>First, find the toolset corresponding to your compiler in the
  323. 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
  324. Boost.Build documentation</a>).</p>
  325. <div class="note">
  326. <p class="first admonition-title">Note</p>
  327. <p class="last">If you previously chose a toolset for the purposes of
  328. <a class="reference external" href="../../doc/html/jam/building.html">building bjam</a>, you should assume it won't work and instead
  329. choose newly from the table below.</p>
  330. </div>
  331. <table border="1" class="docutils">
  332. <colgroup>
  333. <col width="18%" />
  334. <col width="33%" />
  335. <col width="48%" />
  336. </colgroup>
  337. <thead valign="bottom">
  338. <tr><th class="head">Toolset
  339. Name</th>
  340. <th class="head">Vendor</th>
  341. <th class="head">Notes</th>
  342. </tr>
  343. </thead>
  344. <tbody valign="top">
  345. <tr><td><tt class="docutils literal">acc</tt></td>
  346. <td>Hewlett Packard</td>
  347. <td>Only very recent versions are
  348. known to work well with Boost</td>
  349. </tr>
  350. <tr><td><tt class="docutils literal">borland</tt></td>
  351. <td>Borland</td>
  352. <td>&nbsp;</td>
  353. </tr>
  354. <tr><td><tt class="docutils literal">como</tt></td>
  355. <td>Comeau Computing</td>
  356. <td>Using this toolset may
  357. require <a class="reference external" href="../../tools/build/index.html">configuring</a> another
  358. toolset to act as its backend</td>
  359. </tr>
  360. <tr><td><tt class="docutils literal">cw</tt></td>
  361. <td>Metrowerks/Freescale</td>
  362. <td>The CodeWarrior compiler. We
  363. have not tested versions of
  364. this compiler produced since
  365. it was sold to Freescale.</td>
  366. </tr>
  367. <tr><td><tt class="docutils literal">dmc</tt></td>
  368. <td>Digital Mars</td>
  369. <td>As of this Boost release, no
  370. version of dmc is known to
  371. handle Boost well.</td>
  372. </tr>
  373. <tr><td><tt class="docutils literal">darwin</tt></td>
  374. <td>Apple Computer</td>
  375. <td>Apple's version of the GCC
  376. toolchain with support for
  377. Darwin and MacOS X features
  378. such as frameworks.</td>
  379. </tr>
  380. <tr><td><tt class="docutils literal">gcc</tt></td>
  381. <td>The Gnu Project</td>
  382. <td>Includes support for Cygwin
  383. and MinGW compilers.</td>
  384. </tr>
  385. <tr><td><tt class="docutils literal">hp_cxx</tt></td>
  386. <td>Hewlett Packard</td>
  387. <td>Targeted at the Tru64
  388. operating system.</td>
  389. </tr>
  390. <tr><td><tt class="docutils literal">intel</tt></td>
  391. <td>Intel</td>
  392. <td>&nbsp;</td>
  393. </tr>
  394. <tr><td><tt class="docutils literal">msvc</tt></td>
  395. <td>Microsoft</td>
  396. <td>&nbsp;</td>
  397. </tr>
  398. <tr><td><tt class="docutils literal">qcc</tt></td>
  399. <td>QNX Software Systems</td>
  400. <td>&nbsp;</td>
  401. </tr>
  402. <tr><td><tt class="docutils literal">sun</tt></td>
  403. <td>Sun</td>
  404. <td>Only very recent versions are
  405. known to work well with
  406. Boost.</td>
  407. </tr>
  408. <tr><td><tt class="docutils literal">vacpp</tt></td>
  409. <td>IBM</td>
  410. <td>The VisualAge C++ compiler.</td>
  411. </tr>
  412. </tbody>
  413. </table>
  414. <p>If you have multiple versions of a particular compiler installed,
  415. you can append the version number to the toolset name, preceded by
  416. a hyphen, e.g. <tt class="docutils literal"><span class="pre">intel-9.0</span></tt> or
  417. <tt class="docutils literal"><span class="pre">borland-5.4.3</span></tt>. <tt class="docutils literal"> </tt></p>
  418. </div>
  419. <div class="section" id="select-a-build-directory">
  420. <span id="id11"></span><span id="build-directory"></span><h3><a class="toc-backref" href="#id30">5.2.3&nbsp;&nbsp;&nbsp;Select a Build Directory</a></h3>
  421. <p><a class="reference external" href="../../tools/build/index.html">Boost.Build</a> will place all intermediate files it generates while
  422. building into the <strong>build directory</strong>. If your Boost root
  423. directory is writable, this step isn't strictly necessary: by
  424. default Boost.Build will create a <tt class="docutils literal">bin.v2/</tt> subdirectory for that
  425. purpose in your current working directory.</p>
  426. </div>
  427. <div class="section" id="invoke-bjam">
  428. <h3><a class="toc-backref" href="#id31">5.2.4&nbsp;&nbsp;&nbsp;Invoke <tt class="docutils literal">bjam</tt></a></h3>
  429. <p>Change your current directory to the Boost root directory and
  430. invoke <tt class="docutils literal">bjam</tt> as follows:</p>
  431. <pre class="literal-block">
  432. 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
  433. </pre>
  434. <p>For a complete description of these and other invocation options,
  435. 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>
  436. <p>For example, your session might look like this:</p>
  437. <pre class="literal-block">
  438. $ cd ~/<tt class="docutils literal">boost_1_45_0</tt>
  439. $ bjam <strong>--build-dir=</strong>/tmp/build-boost <strong>toolset=</strong>gcc stage
  440. </pre>
  441. <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>
  442. <!-- Copyright David Abrahams 2006. Distributed under the Boost -->
  443. <!-- Software License, Version 1.0. (See accompanying -->
  444. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  445. <p>Building the special <tt class="docutils literal">stage</tt> target places Boost
  446. 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
  447. the Boost tree. To use a different directory pass the
  448. <tt class="docutils literal"><span class="pre">--stagedir=</span></tt><em>directory</em> option to <tt class="docutils literal">bjam</tt>.</p>
  449. <div class="note">
  450. <p class="first admonition-title">Note</p>
  451. <p class="last"><tt class="docutils literal">bjam</tt> is case-sensitive; it is important that all the
  452. parts shown in <strong>bold</strong> type above be entirely lower-case.</p>
  453. </div>
  454. <p>For a description of other options you can pass when invoking
  455. <tt class="docutils literal">bjam</tt>, type:</p>
  456. <pre class="literal-block">
  457. bjam --help
  458. </pre>
  459. <p>In particular, to limit the amount of time spent building, you may
  460. be interested in:</p>
  461. <ul class="simple">
  462. <li>reviewing the list of library names with <tt class="docutils literal"><span class="pre">--show-libraries</span></tt></li>
  463. <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>
  464. <li>choosing a specific build variant by adding <tt class="docutils literal">release</tt> or
  465. <tt class="docutils literal">debug</tt> to the command line.</li>
  466. </ul>
  467. <div class="note">
  468. <p class="first admonition-title">Note</p>
  469. <p class="last">Boost.Build can produce a great deal of output, which can
  470. make it easy to miss problems. If you want to make sure
  471. everything is went well, you might redirect the output into a
  472. file by appending “<tt class="docutils literal">&gt;build.log <span class="pre">2&gt;&amp;1</span></tt>” to your command line.</p>
  473. </div>
  474. </div>
  475. </div>
  476. <div class="section" id="expected-build-output">
  477. <h2><a class="toc-backref" href="#id32">5.3&nbsp;&nbsp;&nbsp;Expected Build Output</a></h2>
  478. <p>During the process of building Boost libraries, you can expect to
  479. see some messages printed on the console. These may include</p>
  480. <ul>
  481. <li><p class="first">Notices about Boost library configuration—for example, the Regex
  482. library outputs a message about ICU when built without Unicode
  483. support, and the Python library may be skipped without error (but
  484. with a notice) if you don't have Python installed.</p>
  485. </li>
  486. <li><p class="first">Messages from the build tool that report the number of targets
  487. that were built or skipped. Don't be surprised if those numbers
  488. don't make any sense to you; there are many targets per library.</p>
  489. </li>
  490. <li><p class="first">Build action messages describing what the tool is doing, which
  491. look something like:</p>
  492. <pre class="literal-block">
  493. <em>toolset-name</em>.c++ <em>long</em>/<em>path</em>/<em>to</em>/<em>file</em>/<em>being</em>/<em>built</em>
  494. </pre>
  495. </li>
  496. <li><p class="first">Compiler warnings.</p>
  497. </li>
  498. </ul>
  499. </div>
  500. <div class="section" id="in-case-of-build-errors">
  501. <h2><a class="toc-backref" href="#id33">5.4&nbsp;&nbsp;&nbsp;In Case of Build Errors</a></h2>
  502. <p>The only error messages you see when building Boost—if any—should
  503. be related to the IOStreams library's support of zip and bzip2
  504. formats as described <a class="reference external" href="../../libs/iostreams/doc/installation.html">here</a>. Install the relevant development
  505. packages for libz and libbz2 if you need those features. Other
  506. errors when building Boost libraries are cause for concern.</p>
  507. <p>If it seems like the build system can't find your compiler and/or
  508. linker, consider setting up a <tt class="docutils literal"><span class="pre">user-config.jam</span></tt> file as described
  509. <a class="reference external" href="http://www.boost.org/boost-build2/doc/html/bbv2/advanced/configuration.html">here</a>. If that isn't your problem or the <tt class="docutils literal"><span class="pre">user-config.jam</span></tt> file
  510. doesn't work for you, please address questions about configuring Boost
  511. for your compiler to the <a class="reference external" href="http://www.boost.org/more/mailing_lists.htm#jamboost">Boost.Build mailing list</a>.</p>
  512. <!-- Copyright David Abrahams 2006. Distributed under the Boost -->
  513. <!-- Software License, Version 1.0. (See accompanying -->
  514. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  515. </div>
  516. </div>
  517. <div class="section" id="link-your-program-to-a-boost-library">
  518. <h1><a class="toc-backref" href="#id34">6&nbsp;&nbsp;&nbsp;Link Your Program to a Boost Library</a></h1>
  519. <p>To demonstrate linking with a Boost binary library, we'll use the
  520. following simple program that extracts the subject lines from
  521. emails. It uses the <a class="reference external" href="../../libs/regex/index.html">Boost.Regex</a> library, which has a
  522. separately-compiled binary component.</p>
  523. <pre class="literal-block">
  524. #include &lt;boost/regex.hpp&gt;
  525. #include &lt;iostream&gt;
  526. #include &lt;string&gt;
  527. int main()
  528. {
  529. std::string line;
  530. boost::regex pat( &quot;^Subject: (Re: |Aw: )*(.*)&quot; );
  531. while (std::cin)
  532. {
  533. std::getline(std::cin, line);
  534. boost::smatch matches;
  535. if (boost::regex_match(line, matches, pat))
  536. std::cout &lt;&lt; matches[2] &lt;&lt; std::endl;
  537. }
  538. }
  539. </pre>
  540. <p>There are two main challenges associated with linking:</p>
  541. <ol class="arabic simple">
  542. <li>Tool configuration, e.g. choosing command-line options or IDE
  543. build settings.</li>
  544. <li>Identifying the library binary, among all the build variants,
  545. whose compile configuration is compatible with the rest of your
  546. project.</li>
  547. </ol>
  548. <p>There are two main ways to link to libraries:</p>
  549. <ol class="upperalpha">
  550. <li><p class="first">You can specify the full path to each library:</p>
  551. <pre class="literal-block">
  552. $ c++ -I <em>path/to/</em><tt class="docutils literal">boost_1_45_0</tt> example.cpp -o example <strong>\</strong>
  553. <strong>~/boost/stage/lib/libboost_regex-gcc34-mt-d-1_36.a</strong>
  554. </pre>
  555. </li>
  556. <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
  557. suffix (<tt class="docutils literal">.a</tt> in this case):</p>
  558. <pre class="literal-block">
  559. $ c++ -I <em>path/to/</em><tt class="docutils literal">boost_1_45_0</tt> example.cpp -o example <strong>\</strong>
  560. <strong>-L~/boost/stage/lib/ -lboost_regex-gcc34-mt-d-1_36</strong>
  561. </pre>
  562. <p>As you can see, this method is just as terse as method A for one
  563. library; it <em>really</em> pays off when you're using multiple
  564. libraries from the same directory. Note, however, that if you
  565. use this method with a library that has both static (<tt class="docutils literal">.a</tt>) and
  566. dynamic (<tt class="docutils literal">.so</tt>) builds, the system may choose one
  567. automatically for you unless you pass a special option such as
  568. <tt class="docutils literal"><span class="pre">-static</span></tt> on the command line.</p>
  569. </li>
  570. </ol>
  571. <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
  572. command lines we explored earlier</a>.</p>
  573. <div class="section" id="library-naming">
  574. <h2><a class="toc-backref" href="#id35">6.1&nbsp;&nbsp;&nbsp;Library Naming</a></h2>
  575. <!-- Copyright David Abrahams 2006. Distributed under the Boost -->
  576. <!-- Software License, Version 1.0. (See accompanying -->
  577. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  578. <p>In order to choose the right binary for your build configuration
  579. you need to know how Boost binaries are named. Each library
  580. filename is composed of a common sequence of elements that describe
  581. how it was built. For example,
  582. <tt class="docutils literal"><span class="pre">libboost_regex-vc71-mt-d-1_34.lib</span></tt> can be broken down into the
  583. following elements:</p>
  584. <dl class="docutils">
  585. <dt><tt class="docutils literal">lib</tt></dt>
  586. <dd><em>Prefix</em>: except on Microsoft Windows, every Boost library
  587. name begins with this string. On Windows, only ordinary static
  588. libraries use the <tt class="docutils literal">lib</tt> prefix; import libraries and DLLs do
  589. not.<a class="footnote-reference" href="#distinct" id="id17"><sup>4</sup></a></dd>
  590. <dt><tt class="docutils literal">boost_regex</tt></dt>
  591. <dd><em>Library name</em>: all boost library filenames begin with <tt class="docutils literal">boost_</tt>.</dd>
  592. <dt><tt class="docutils literal"><span class="pre">-vc71</span></tt></dt>
  593. <dd><em>Toolset tag</em>: identifies the <a class="reference internal" href="#toolset">toolset</a> and version used to build
  594. the binary.</dd>
  595. <dt><tt class="docutils literal"><span class="pre">-mt</span></tt></dt>
  596. <dd><em>Threading tag</em>: indicates that the library was
  597. built with multithreading support enabled. Libraries built
  598. without multithreading support can be identified by the absence
  599. of <tt class="docutils literal"><span class="pre">-mt</span></tt>.</dd>
  600. <dt><tt class="docutils literal"><span class="pre">-d</span></tt></dt>
  601. <dd><p class="first"><em>ABI tag</em>: encodes details that affect the library's
  602. interoperability with other compiled code. For each such
  603. feature, a single letter is added to the tag:</p>
  604. <blockquote>
  605. <table border="1" class="docutils">
  606. <colgroup>
  607. <col width="5%" />
  608. <col width="75%" />
  609. <col width="20%" />
  610. </colgroup>
  611. <thead valign="bottom">
  612. <tr><th class="head">Key</th>
  613. <th class="head">Use this library when:</th>
  614. <th class="head">Boost.Build option</th>
  615. </tr>
  616. </thead>
  617. <tbody valign="top">
  618. <tr><td><tt class="docutils literal">s</tt></td>
  619. <td>linking statically to the C++ standard library and compiler runtime support
  620. libraries.</td>
  621. <td>runtime-link=static</td>
  622. </tr>
  623. <tr><td><tt class="docutils literal">g</tt></td>
  624. <td>using debug versions of the standard and runtime support libraries.</td>
  625. <td>runtime-debugging=on</td>
  626. </tr>
  627. <tr><td><tt class="docutils literal">y</tt></td>
  628. <td>using a special <a class="reference external" href="../../libs/python/doc/building.html#variants">debug build of Python</a>.</td>
  629. <td>python-debugging=on</td>
  630. </tr>
  631. <tr><td><tt class="docutils literal">d</tt></td>
  632. <td>building a debug version of your code.<a class="footnote-reference" href="#debug-abi" id="id18"><sup>5</sup></a></td>
  633. <td>variant=debug</td>
  634. </tr>
  635. <tr><td><tt class="docutils literal">p</tt></td>
  636. <td>using the STLPort standard library rather than the default one supplied with
  637. your compiler.</td>
  638. <td>stdlib=stlport</td>
  639. </tr>
  640. </tbody>
  641. </table>
  642. </blockquote>
  643. <p class="last">For example, if you build a debug version of your code for use
  644. with debug versions of the static runtime library and the
  645. STLPort standard library in “native iostreams” mode,
  646. the tag would be: <tt class="docutils literal"><span class="pre">-sgdpn</span></tt>. If none of the above apply, the
  647. ABI tag is ommitted.</p>
  648. </dd>
  649. <dt><tt class="docutils literal"><span class="pre">-1_34</span></tt></dt>
  650. <dd><em>Version tag</em>: the full Boost release number, with periods
  651. replaced by underscores. For example, version 1.31.1 would be
  652. tagged as &quot;-1_31_1&quot;.</dd>
  653. <dt><tt class="docutils literal">.lib</tt></dt>
  654. <dd><em>Extension</em>: determined according to the operating system's usual
  655. convention. On most unix-style platforms the extensions are
  656. <tt class="docutils literal">.a</tt> and <tt class="docutils literal">.so</tt> for static libraries (archives) and shared
  657. libraries, respectively. On Windows, <tt class="docutils literal">.dll</tt> indicates a shared
  658. library and <tt class="docutils literal">.lib</tt> indicates a
  659. static or import library. Where supported by toolsets on unix
  660. variants, a full version extension is added (e.g. &quot;.so.1.34&quot;) and
  661. a symbolic link to the library file, named without the trailing
  662. version number, will also be created.</dd>
  663. </dl>
  664. <!-- .. _Boost.Build toolset names: toolset-name_ -->
  665. <!-- Copyright David Abrahams 2006. Distributed under the Boost -->
  666. <!-- Software License, Version 1.0. (See accompanying -->
  667. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  668. </div>
  669. <div class="section" id="test-your-program">
  670. <h2><a class="toc-backref" href="#id36">6.2&nbsp;&nbsp;&nbsp;Test Your Program</a></h2>
  671. <p>To test our subject extraction, we'll filter the following text
  672. file. Copy it out of your browser and save it as <tt class="docutils literal">jayne.txt</tt>:</p>
  673. <pre class="literal-block">
  674. To: George Shmidlap
  675. From: Rita Marlowe
  676. Subject: Will Success Spoil Rock Hunter?
  677. ---
  678. See subject.
  679. </pre>
  680. <p>If you linked to a shared library, you may need to prepare some
  681. platform-specific settings so that the system will be able to find
  682. and load it when your program is run. Most platforms have an
  683. environment variable to which you can add the directory containing
  684. the library. On many platforms (Linux, FreeBSD) that variable is
  685. <tt class="docutils literal">LD_LIBRARY_PATH</tt>, but on MacOS it's <tt class="docutils literal">DYLD_LIBRARY_PATH</tt>, and
  686. on Cygwin it's simply <tt class="docutils literal">PATH</tt>. In most shells other than <tt class="docutils literal">csh</tt>
  687. and <tt class="docutils literal">tcsh</tt>, you can adjust the variable as follows (again, don't
  688. type the <tt class="docutils literal">$</tt>—that represents the shell prompt):</p>
  689. <pre class="literal-block">
  690. <strong>$</strong> <em>VARIABLE_NAME</em>=<em>path/to/lib/directory</em>:${<em>VARIABLE_NAME</em>}
  691. <strong>$</strong> export <em>VARIABLE_NAME</em>
  692. </pre>
  693. <p>On <tt class="docutils literal">csh</tt> and <tt class="docutils literal">tcsh</tt>, it's</p>
  694. <pre class="literal-block">
  695. <strong>$</strong> setenv <em>VARIABLE_NAME</em> <em>path/to/lib/directory</em>:${<em>VARIABLE_NAME</em>}
  696. </pre>
  697. <p>Once the necessary variable (if any) is set, you can run your
  698. program as follows:</p>
  699. <pre class="literal-block">
  700. <strong>$</strong> <em>path</em>/<em>to</em>/<em>compiled</em>/example &lt; <em>path</em>/<em>to</em>/jayne.txt
  701. </pre>
  702. <p>The program should respond with the email subject, “Will Success
  703. Spoil Rock Hunter?”</p>
  704. <!-- Copyright David Abrahams 2006. Distributed under the Boost -->
  705. <!-- Software License, Version 1.0. (See accompanying -->
  706. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  707. </div>
  708. </div>
  709. <div class="section" id="conclusion-and-further-resources">
  710. <h1><a class="toc-backref" href="#id37">7&nbsp;&nbsp;&nbsp;Conclusion and Further Resources</a></h1>
  711. <p>This concludes your introduction to Boost and to integrating it
  712. with your programs. As you start using Boost in earnest, there are
  713. surely a few additional points you'll wish we had covered. One day
  714. we may have a “Book 2 in the Getting Started series” that addresses
  715. them. Until then, we suggest you pursue the following resources.
  716. If you can't find what you need, or there's anything we can do to
  717. make this document clearer, please post it to the <a class="reference external" href="http://www.boost.org/more/mailing_lists.htm#users">Boost Users'
  718. mailing list</a>.</p>
  719. <ul class="simple">
  720. <li><a class="reference external" href="../../tools/build/v2/index.html">Boost.Build reference manual</a></li>
  721. <li><a class="reference external" href="../../tools/build/v2/engine/index.html">Boost.Jam reference manual</a></li>
  722. <li><a class="reference external" href="http://www.boost.org/more/mailing_lists.htm#users">Boost Users' mailing list</a></li>
  723. <li><a class="reference external" href="http://www.boost.org/more/mailing_lists.htm#jamboost">Boost.Build mailing list</a></li>
  724. <li><a class="reference external" href="http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?Boost.Build_V2">Boost.Build Wiki</a></li>
  725. <li><a class="reference external" href="../../libs/index.html">Index of all Boost library documentation</a></li>
  726. </ul>
  727. <div class="admonition-onward admonition">
  728. <p class="first admonition-title">Onward</p>
  729. <blockquote class="epigraph last">
  730. <p>Good luck, and have fun!</p>
  731. <p class="attribution">&mdash;the Boost Developers</p>
  732. </blockquote>
  733. </div>
  734. <hr class="docutils" />
  735. <table class="docutils footnote" frame="void" id="packagers" rules="none">
  736. <colgroup><col class="label" /><col /></colgroup>
  737. <tbody valign="top">
  738. <tr><td class="label"><a class="fn-backref" href="#id2">[1]</a></td><td>If developers of Boost packages would like to work
  739. with us to make sure these instructions can be used with their
  740. packages, we'd be glad to help. Please make your interest known
  741. to the <a class="reference external" href="http://www.boost.org/more/mailing_lists.htm#main">Boost developers' list</a>.</td></tr>
  742. </tbody>
  743. </table>
  744. <table class="docutils footnote" frame="void" id="lowercase-l" rules="none">
  745. <colgroup><col class="label" /><col /></colgroup>
  746. <tbody valign="top">
  747. <tr><td class="label"><a class="fn-backref" href="#id15">[2]</a></td><td>That option is a dash followed by a lowercase “L”
  748. character, which looks very much like a numeral 1 in some fonts.</td></tr>
  749. </tbody>
  750. </table>
  751. <!-- Copyright David Abrahams 2006. Distributed under the Boost -->
  752. <!-- Software License, Version 1.0. (See accompanying -->
  753. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  754. <table class="docutils footnote" frame="void" id="warnings" rules="none">
  755. <colgroup><col class="label" /><col /></colgroup>
  756. <tbody valign="top">
  757. <tr><td class="label"><a class="fn-backref" href="#id5">[3]</a></td><td>Remember that warnings are specific to each compiler
  758. implementation. The developer of a given Boost library might
  759. not have access to your compiler. Also, some warnings are
  760. extremely difficult to eliminate in generic code, to the point
  761. where it's not worth the trouble. Finally, some compilers don't
  762. have any source code mechanism for suppressing warnings.</td></tr>
  763. </tbody>
  764. </table>
  765. <table class="docutils footnote" frame="void" id="distinct" rules="none">
  766. <colgroup><col class="label" /><col /></colgroup>
  767. <tbody valign="top">
  768. <tr><td class="label"><a class="fn-backref" href="#id17">[4]</a></td><td>This convention distinguishes the static version of
  769. a Boost library from the import library for an
  770. identically-configured Boost DLL, which would otherwise have the
  771. same name.</td></tr>
  772. </tbody>
  773. </table>
  774. <table class="docutils footnote" frame="void" id="debug-abi" rules="none">
  775. <colgroup><col class="label" /><col /></colgroup>
  776. <tbody valign="top">
  777. <tr><td class="label"><a class="fn-backref" href="#id18">[5]</a></td><td>These libraries were compiled without optimization
  778. or inlining, with full debug symbols enabled, and without
  779. <tt class="docutils literal">NDEBUG</tt> <tt class="docutils literal">#define</tt>d. Although it's true that sometimes
  780. these choices don't affect binary compatibility with other
  781. compiled code, you can't count on that with Boost libraries.</td></tr>
  782. </tbody>
  783. </table>
  784. <table class="docutils footnote" frame="void" id="native" rules="none">
  785. <colgroup><col class="label" /><col /></colgroup>
  786. <tbody valign="top">
  787. <tr><td class="label">[6]</td><td>This feature of STLPort is deprecated because it's
  788. impossible to make it work transparently to the user; we don't
  789. recommend it.</td></tr>
  790. </tbody>
  791. </table>
  792. <!-- Copyright David Abrahams 2006. Distributed under the Boost -->
  793. <!-- Software License, Version 1.0. (See accompanying -->
  794. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  795. <!-- This file contains all the definitions that need to be updated -->
  796. <!-- for each new release of Boost. -->
  797. <!-- Copyright David Abrahams 2006. Distributed under the Boost -->
  798. <!-- Software License, Version 1.0. (See accompanying -->
  799. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  800. <!-- Copyright David Abrahams 2006. Distributed under the Boost -->
  801. <!-- Software License, Version 1.0. (See accompanying -->
  802. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  803. <!-- Copyright David Abrahams 2006. Distributed under the Boost -->
  804. <!-- Software License, Version 1.0. (See accompanying -->
  805. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  806. </div>
  807. </div>
  808. </body>
  809. </html>
粤ICP备19079148号