1 | <html> |
---|
2 | <head> |
---|
3 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
---|
4 | <title>Build</title> |
---|
5 | <link rel="stylesheet" href="../boostbook.css" type="text/css"> |
---|
6 | <meta name="generator" content="DocBook XSL Stylesheets V1.69.1"> |
---|
7 | <link rel="start" href="../index.html" title="The Boost C++ Libraries"> |
---|
8 | <link rel="up" href="../threads.html" title="Chapter 12. Boost.Threads"> |
---|
9 | <link rel="prev" href="configuration.html" title="Configuration"> |
---|
10 | <link rel="next" href="../threads/implementation_notes.html" title="Implementation Notes"> |
---|
11 | </head> |
---|
12 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
---|
13 | <table cellpadding="2" width="100%"> |
---|
14 | <td valign="top"><img alt="boost.png (6897 bytes)" width="277" height="86" src="../../../boost.png"></td> |
---|
15 | <td align="center"><a href="../../../index.htm">Home</a></td> |
---|
16 | <td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td> |
---|
17 | <td align="center"><a href="../../../people/people.htm">People</a></td> |
---|
18 | <td align="center"><a href="../../../more/faq.htm">FAQ</a></td> |
---|
19 | <td align="center"><a href="../../../more/index.htm">More</a></td> |
---|
20 | </table> |
---|
21 | <hr> |
---|
22 | <div class="spirit-nav"> |
---|
23 | <a accesskey="p" href="configuration.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../threads.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../threads/implementation_notes.html"><img src="../images/next.png" alt="Next"></a> |
---|
24 | </div> |
---|
25 | <div class="section" lang="en"> |
---|
26 | <div class="titlepage"><div><div><h3 class="title"> |
---|
27 | <a name="thread.build"></a>Build</h3></div></div></div> |
---|
28 | <div class="toc"><dl> |
---|
29 | <dt><span class="section"><a href="build.html#thread.build.building">Building the <span class="bold"><strong>Boost.Threads</strong></span> Libraries</a></span></dt> |
---|
30 | <dt><span class="section"><a href="build.html#thread.build.testing">Testing the <span class="bold"><strong>Boost.Threads</strong></span> Libraries</a></span></dt> |
---|
31 | </dl></div> |
---|
32 | <p> |
---|
33 | How you build the <span class="bold"><strong>Boost.Threads</strong></span> libraries, and how you build your own applications |
---|
34 | that use those libraries, are some of the most frequently asked questions. Build |
---|
35 | processes are difficult to deal with in a portable manner. That's one reason |
---|
36 | why <span class="bold"><strong>Boost.Threads</strong></span> makes use of <span class="bold"><strong>Boost.Build</strong></span>. |
---|
37 | In general you should refer to the documentation for <span class="bold"><strong>Boost.Build</strong></span>. |
---|
38 | This document will only supply you with some simple usage examples for how to |
---|
39 | use <span class="emphasis"><em>bjam</em></span> to build and test <span class="bold"><strong>Boost.Threads</strong></span>. In addition, this document |
---|
40 | will try to explain the build requirements so that users may create their own |
---|
41 | build processes (for instance, create an IDE specific project), both for building |
---|
42 | and testing <span class="bold"><strong>Boost.Threads</strong></span>, as well as for building their own projects using |
---|
43 | <span class="bold"><strong>Boost.Threads</strong></span>. |
---|
44 | </p> |
---|
45 | <div class="section" lang="en"> |
---|
46 | <div class="titlepage"><div><div><h4 class="title"> |
---|
47 | <a name="thread.build.building"></a>Building the <span class="bold"><strong>Boost.Threads</strong></span> Libraries</h4></div></div></div> |
---|
48 | <p> |
---|
49 | To build the <span class="bold"><strong>Boost.Threads</strong></span> libraries using <span class="bold"><strong>Boost.Build</strong></span>, simply change to the |
---|
50 | directory <span class="emphasis"><em>boost_root</em></span>/libs/thread/build and execute the command: |
---|
51 | </p> |
---|
52 | <pre class="programlisting">bjam -sTOOLS=<span class="emphasis"><em>toolset</em></span></pre> |
---|
53 | <p> |
---|
54 | This will create the debug and the release builds of the <span class="bold"><strong>Boost.Threads</strong></span> library. |
---|
55 | </p> |
---|
56 | <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> |
---|
57 | <h3 class="title">Note</h3>Invoking the above command in <span class="emphasis"><em>boost_root</em></span> will build all of |
---|
58 | the Boost distribution, including <span class="bold"><strong>Boost.Threads</strong></span>.</div> |
---|
59 | <p> |
---|
60 | The Jamfile supplied with <span class="bold"><strong>Boost.Threads</strong></span> produces a dynamic link library named |
---|
61 | <span class="emphasis"><em>boost_thread{build-specific-tags}.{extension}</em></span>, where the build-specific |
---|
62 | tags indicate the toolset used to build the library, whether it's a debug or release |
---|
63 | build, what version of Boost was used, etc.; and the extension is the appropriate extension |
---|
64 | for a dynamic link library for the platform for which <span class="bold"><strong>Boost.Threads</strong></span> is being built. |
---|
65 | For instance, a debug library built for Win32 with VC++ 7.1 using Boost 1.31 would |
---|
66 | be named <span class="emphasis"><em>boost_thread-vc71-mt-gd-1_31.dll</em></span>. |
---|
67 | </p> |
---|
68 | <p> |
---|
69 | The source files that are used to create the <span class="bold"><strong>Boost.Threads</strong></span> library |
---|
70 | are all of the *.cpp files found in <span class="emphasis"><em>boost_root</em></span>/libs/thread/src. |
---|
71 | These need to be built with the compiler's and linker's multi-threading support enabled. |
---|
72 | If you want to create your own build solution you'll have to follow these same |
---|
73 | guidelines. One of the most frequently reported problems when trying to do this |
---|
74 | occurs from not enabling the compiler's and linker's support for multi-threading. |
---|
75 | </p> |
---|
76 | </div> |
---|
77 | <div class="section" lang="en"> |
---|
78 | <div class="titlepage"><div><div><h4 class="title"> |
---|
79 | <a name="thread.build.testing"></a>Testing the <span class="bold"><strong>Boost.Threads</strong></span> Libraries</h4></div></div></div> |
---|
80 | <p> |
---|
81 | To test the <span class="bold"><strong>Boost.Threads</strong></span> libraries using <span class="bold"><strong>Boost.Build</strong></span>, simply change to the |
---|
82 | directory <span class="emphasis"><em>boost_root</em></span>/libs/thread/test and execute the command: |
---|
83 | </p> |
---|
84 | <pre class="programlisting">bjam -sTOOLS=<span class="emphasis"><em>toolset</em></span> test</pre> |
---|
85 | </div> |
---|
86 | </div> |
---|
87 | <table width="100%"><tr> |
---|
88 | <td align="left"><small><p>Last revised: July 17, 2004 at 04:33:59 GMT</p></small></td> |
---|
89 | <td align="right"><small>Copyright © 2001-2003 William E. Kempf</small></td> |
---|
90 | </tr></table> |
---|
91 | <hr> |
---|
92 | <div class="spirit-nav"> |
---|
93 | <a accesskey="p" href="configuration.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../threads.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../threads/implementation_notes.html"><img src="../images/next.png" alt="Next"></a> |
---|
94 | </div> |
---|
95 | </body> |
---|
96 | </html> |
---|