getting_started.html 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3. <head>
  4. <title>Getting Started</title>
  5. <meta name="generator" content=
  6. "HTML Tidy for Linux/x86 (vers 1st September 2003), see www.w3.org">
  7. <meta http-equiv="Content-Language" content="en-us">
  8. <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
  9. <link rel="stylesheet" type="text/css" href="../boost.css">
  10. </head>
  11. <body bgcolor="#FFFFFF" text="#000000">
  12. <table summary="" width="100%" border="0" cellspacing="0" cellpadding="0">
  13. <tr valign="top">
  14. <td valign="top" align="left"><img src="../c%2B%2Bboost.gif" alt=
  15. "c++boost.gif (8819 bytes)" width="277" height="86"></td>
  16. <td align="right" valign="top">
  17. <table summary="" border="1" cellspacing="0" cellpadding="2">
  18. <tr>
  19. <td>
  20. <table summary="" border="0" cellspacing="0" cellpadding="2">
  21. <tr>
  22. <td bgcolor="#DDDDDD">
  23. <p>.&nbsp;<a href="../index.htm">Home</a><br>
  24. .&nbsp;<a href="../libs/libraries.htm">Libraries</a><br>
  25. .&nbsp;<a href="../people/people.htm">People</a><br>
  26. .&nbsp;<a href="faq.htm">FAQ</a><br>
  27. .&nbsp;<a href="index.htm">More</a></p>
  28. </td>
  29. </tr>
  30. </table>
  31. </td>
  32. </tr>
  33. </table>
  34. </td>
  35. </tr>
  36. </table>
  37. <h1>Getting Started</h1>
  38. <ul>
  39. <li><a href="#Introduction">Introduction</a></li>
  40. <li>
  41. <a href="#Download">Download</a>
  42. <ul>
  43. <li><a href="#.zip">.zip file</a></li>
  44. <li><a href="#.tar.gz">.tar.gz and .tar.bz2 files</a></li>
  45. <li><a href="#CVS">Boost CVS Repository</a></li>
  46. </ul>
  47. </li>
  48. <li>
  49. <a href="#Preparation">Preparation</a>
  50. <ul>
  51. <li><a href="#Configuring">Configuring the tools</a></li>
  52. <li><a href="#Tools">Supported Toolsets</a></li>
  53. </ul>
  54. </li>
  55. <li><a href="#Build_Install">Build and Install</a></li>
  56. <li><a href="#Results">Results</a></li>
  57. <li><a href="#Additional_Steps">Additional Steps</a></li>
  58. </ul>
  59. <h2><a name="Introduction">Introduction</a></h2>
  60. <p>These instructions are intended to help you get started using the Boost
  61. Libraries. This walks you through getting, building, and installing the
  62. libraries. To summarize these are the steps to get Boost built and
  63. installed:</p>
  64. <ol>
  65. <li><a href="#step1">Download Boost</a>.</li>
  66. <li><a href="#step2">Install Boost.Jam</a>.</li>
  67. <li><a href="#step3">Configure your compiler toolset</a>.</li>
  68. <li><a href="#step4">Go to Boost distribution directory</a>.</li>
  69. <li><a href="#step5">Build and install</a>.</li>
  70. </ol>
  71. <h2><a name="Download"></a>Download</h2>
  72. <table summary="" width="100%" border="0" cellspacing="2" cellpadding="2">
  73. <tr align="left" valign="top">
  74. <td width="40" align="center" valign="top" bgcolor="#FFFF66">
  75. <font size="6"><b><a name="step1"></a>1</b></font></td>
  76. <td>The Boost Libraries are distributed through the SourceForge file
  77. distribution system. Click here to <b><a href=
  78. "http://sourceforge.net/project/showfiles.php?group_id=7586"><font size="4">
  79. download releases from SourceForge</font></a></b>. And unpack the
  80. release to a convenient location.</td>
  81. </tr>
  82. </table>
  83. <p>The Boost release includes all of the libraries and other material from
  84. the web site. It is available in <a href="#.zip">ZIP</a>, <a href=
  85. "#.tar.gz">TAR.GZ</a>, and <a href="#.tar.gz">TAR.BZ2</a> formats. Past
  86. releases are also available.</p>It is also possible to download current
  87. snapshots of work-in-progress from Boost's <a href="#CVS">CVS
  88. repository</a>.
  89. <h3><a name=".zip">.zip</a> file</h3>The .zip format is widely supported by
  90. both free decoders and commercial compress/archive utilities. If you don't
  91. already have a .zip file decoder, download one from the <a href=
  92. "http://www.info-zip.org/">Info-ZIP</a> web site, which supplies versions
  93. for many operating systems.
  94. <p>Text file line endings in the .zip file are as supplied by each library
  95. developer.&nbsp; This works fine for Windows, but not for Unix/Linux.&nbsp;
  96. The .tar.gz and .tar.bz2 files supply Unix/Linux friendly line endings.</p>
  97. <h3><a name=".tar.gz">.tar.gz</a> and .tar.bz2 files</h3>
  98. <p>The .tar.gz format is widely supported on Unix/Linux platforms. Some
  99. Windows compress/archive utilities can read the format as well.&nbsp;
  100. Because the gzip format compresses the archive as a single file rather than
  101. compressing each file individually, the .tar.gz file is smaller that the
  102. .zip file.</p>
  103. <p>The .tar.bz2 format is becoming widely available on Unix/Linux platforms
  104. and is built into many tar utilities. This format differs for the .tar.gz
  105. format in the compression used, which is considerably better and therefore
  106. creates smaller files.</p>
  107. <p>Text file line endings in the .tar.gz and .tar.bz2 files have been
  108. converted to newlines for ease of use on Unix/Linux platforms.</p>
  109. <h3>Boost <a name="CVS">CVS</a> Repository</h3>
  110. <p>All Boost files, including the entire distribution tree including web
  111. site HTML is maintained in a CVS repository. Command line, GUI, or browser
  112. access is available.</p>
  113. <h4>Boost CVS access via command line or graphical clients</h4>For those
  114. who have CVS clients installed, the libraries are also available from the
  115. public <a href="http://sourceforge.net/cvs/?group_id=7586">Boost CVS
  116. repository</a>. Free command line clients (often already installed on
  117. Linux/Unix systems) are available for many systems, and free GUI clients
  118. are available for Windows, Mac, and other systems.
  119. <p>See the much improved <a href=
  120. "http://sourceforge.net/docman/?group_id=1">CVS documentation</a> (Section
  121. F) from SourceForge, which includes links to the home pages for various GUI
  122. and command line clients.</p>
  123. <p>The general procedure for command-line clients is something like
  124. this:</p>
  125. <blockquote>
  126. <code>cvs -d:pserver:anonymous@cvs.boost.sourceforge.net:/cvsroot/boost
  127. login</code><br>
  128. [Hit &lt;return&gt; when it asks for a password]<br>
  129. <code>cvs -z3
  130. -d:pserver:anonymous@cvs.boost.sourceforge.net:/cvsroot/boost checkout
  131. boost<br>
  132. cvs -d:pserver:anonymous@cvs.boost.sourceforge.net:/cvsroot/boost
  133. logout</code>
  134. </blockquote>Read the manual for your CVS client for further information.
  135. <p>This access is read-only; if you are a library author and wish to have
  136. CVS write access, please contact one of the <a href=
  137. "moderators.html">moderators</a>.</p>
  138. <h4>Boost CVS access via web <a name="Browser">Browser</a></h4>For access
  139. to the CVS archive from any modern web browser, you can also use the
  140. <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/boost/boost/">web
  141. browser&nbsp; interface</a>.&nbsp; Try one of the color diffs to see how a
  142. file has changed over time.
  143. <h2><a name="Preparation"></a>Preparation</h2>
  144. <p>The recommended way to build and install the Boost Libraries is to use
  145. <a href="../tools/build/v1/build_system.htm">Boost.Build</a>, the Boost
  146. Build system. The rest of these instructions explain that use, but it is up
  147. to you to use this method, or not. Note that some of the libraries also
  148. include non Boost.Build makefiles and/or project files. But all include the
  149. needed files for building with Boost.Build.</p>
  150. <table summary="" width="100%" border="0" cellspacing="2" cellpadding="2">
  151. <tr align="left" valign="top">
  152. <td width="40" align="center" valign="top" bgcolor="#FFFF66">
  153. <font size="6"><b><a name="step2"></a>2</b></font></td>
  154. <td>The build system uses <a href=
  155. "../tools/build/jam_src/index.html">Boost.Jam</a>, an extension of the
  156. <a href="http://www.perforce.com/jam/jam.html">Perforce Jam</a>
  157. portable <i>make</i> replacement. You can either <a href=
  158. "../tools/build/jam_src/index.html#building_bjam">build this
  159. yourself</a>, it's included with the distribution. Or obtain a
  160. <strong><a href=
  161. "http://sourceforge.net/project/showfiles.php?group_id=7586"><font size="4">
  162. prebuilt from SourceForge</font></a></strong>. To install Boost.Jam,
  163. copy the <tt>bjam</tt> executable to a location accessible in your
  164. <tt>PATH</tt>.</td>
  165. </tr>
  166. </table>
  167. <h3><a name="Configuring">Configuring the tools</a></h3>
  168. <p>Before using Boost.Build you will need to configure the compiler tools
  169. you are using. The build system's toolsets are designed to work in either
  170. of two ways:</p>
  171. <ol>
  172. <li>The user sets up all of the environment for each toolset he wants to
  173. use in the normal way. For example, for Microsoft VC++, ...vc98/bin is in
  174. the path, vcvars32.bat or equivalent has been invoked, etc. For
  175. Metrowerks CodeWarrior, cwenv.bat or equivalent has been called and
  176. ...Other Metrowerks Tools/Command Line Tools is in the path. Many Unix
  177. operating systems come preconfigured this way and require no user
  178. intervention.<br>
  179. <br></li>
  180. <li>The user doesn't want his environment cluttered with settings or has
  181. nonstandard installations for some of his tools. Instead, he or she sets
  182. variables which point to the toolset installation directories, either in
  183. the command shell environment or on the <code>bjam</code> command-line.
  184. These variables are used by the build system to locate the tools and
  185. invoke the necessary setup. To set the variables on the <tt>bjam</tt>
  186. command-line you use the "<tt>-s</tt>" option. For example:<br>
  187. <br>
  188. <tt>bjam "-sGCC_ROOT=/usr/local/gcc-3.3.2"</tt><br>
  189. <br>
  190. Some variables, like the toolset <tt>TOOLS</tt> variable, can accept
  191. multiple values separated by spaces. Others, like the path above, can
  192. contain spaces. For such circumstancesyou should use quotes appropriate
  193. for your command interpreter.<br></li>
  194. </ol>
  195. <h3><a name="Tools">Supported Toolsets</a></h3>
  196. <table summary="" width="100%" border="0" cellspacing="2" cellpadding="2">
  197. <tr align="left" valign="top">
  198. <td width="40" align="center" valign="top" bgcolor="#FFFF66">
  199. <font size="6"><b><a name="step3"></a>3</b></font></td>
  200. <td>The following toolsets are supported by Boost.Build. For
  201. information about <a href="#Configuring">configuring</a> each toolset,
  202. click its name in the leftmost column.</td>
  203. </tr>
  204. </table><br>
  205. <table summary="" border="1" cellpadding="5">
  206. <tr>
  207. <td><b>TOOLS Name</b></td>
  208. <td><b>Description</b></td>
  209. </tr>
  210. <tr>
  211. <td><a href=
  212. "../tools/build/v1/borland-tools.html"><code>borland</code></a></td>
  213. <td><a href=
  214. "http://www.borland.com/bcppbuilder/freecompiler">Borland</a> C++</td>
  215. </tr>
  216. <tr>
  217. <td><a href=
  218. "../tools/build/v1/como-tools.html"><code>como</code></a></td>
  219. <td><a href="http://www.comeaucomputing.com">Comeau C++</a> compiler
  220. front-end for non-Windows platforms</td>
  221. </tr>
  222. <tr>
  223. <td><code><a href=
  224. "../tools/build/v1/como-tools.html">como-win32</a></code></td>
  225. <td><a href="http://www.comeaucomputing.com">Comeau C++</a> compiler
  226. front-end for Windows, using Microsoft <a href=
  227. "http://msdn.microsoft.com/visualc/">Visual C++</a>as a back-end.</td>
  228. </tr>
  229. <tr>
  230. <td><a href=
  231. "../tools/build/v1/cwpro8-tools.html"><code>cwpro8</code></a></td>
  232. <td><a href="http://www.metrowerks.com">Metrowerks CodeWarrior</a> Pro
  233. 8.x command-line tools</td>
  234. </tr>
  235. <tr>
  236. <td><a href=
  237. "../tools/build/v1/darwin-tools.html"><code>darwin</code></a></td>
  238. <td>Apple Darwin OS hosted GNU <a href=
  239. "http://developer.apple.com/tools/compilers.html">GCC</a>.</td>
  240. </tr>
  241. <tr>
  242. <td><a href=
  243. "../tools/build/v1/edg-tools.html"><code>edg</code></a></td>
  244. <td><a href="http://www.edg.com/">Edison Design Group</a> compiler
  245. front-end (evaluation version)</td>
  246. </tr>
  247. <tr>
  248. <td><a href=
  249. "../tools/build/v1/gcc-tools.html"><code>gcc</code></a></td>
  250. <td><a href="http://gcc.gnu.org">GNU GCC</a> on Unix and <a href=
  251. "http://www.cygwin.com">Cygwin</a>.</td>
  252. </tr>
  253. <tr>
  254. <td><a href=
  255. "../tools/build/v1/gcc-stlport-tools.html"><code>gcc-stlport</code></a></td>
  256. <td><a href="http://gcc.gnu.org">GNU GCC</a> on Unix and <a href=
  257. "http://www.cygwin.com">Cygwin</a>, using the <a href=
  258. "http://www.stlport.org">STLport</a> standard library
  259. implementation</td>
  260. </tr>
  261. <tr>
  262. <td><a href=
  263. "../tools/build/v1/gcc-nocygwin-tools.html"><code>gcc-nocygwin</code></a></td>
  264. <td>GNU GCC Cygwin command line compiler tools running in "no-cygwin"
  265. mode (produces commercially redistributable objects)</td>
  266. </tr>
  267. <tr>
  268. <td><a href=
  269. "../tools/build/v1/intel-linux-tools.html"><code>intel-linux</code></a></td>
  270. <td><a href=
  271. "http://www.intel.com/software/products/compilers/c60l/">Intel C++ for
  272. Linux</a></td>
  273. </tr>
  274. <tr>
  275. <td><a href=
  276. "../tools/build/v1/intel-win32-tools.html"><code>intel-win32</code></a></td>
  277. <td><a href=
  278. "http://www.intel.com/software/products/compilers/c60/">Intel C++ for
  279. Windows</a> using the Dinkumware standard library in the Intel-required
  280. Microsoft <a href="http://msdn.microsoft.com/visualc/">Visual C++</a> 6
  281. or 7 installation</td>
  282. </tr>
  283. <tr>
  284. <td><a href=
  285. "../tools/build/v1/kcc-tools.html"><code>kcc</code></a></td>
  286. <td><a href="http://developer.intel.com/software/products/kcc/">KAI
  287. C++</a></td>
  288. </tr>
  289. <tr>
  290. <td><a href=
  291. "../tools/build/v1/kylix-tools.html"><code>kylix</code></a></td>
  292. <td><a href="http://www.borland.com/kylix">Borland C++ for Linux
  293. (Kylix).</a></td>
  294. </tr>
  295. <tr>
  296. <td><a href=
  297. "../tools/build/v1/metrowerks-tools.html"><code>metrowerks</code></a></td>
  298. <td><a href="http://www.metrowerks.com">Metrowerks CodeWarrior</a>
  299. command-line tools</td>
  300. </tr>
  301. <tr>
  302. <td><a href=
  303. "../tools/build/v1/mingw-tools.html"><code>mingw</code></a></td>
  304. <td>GNU GCC and associated tools in <a href=
  305. "http://www.mingw.org">MinGW</a> configuration (produces commercially
  306. redistributable objects)</td>
  307. </tr>
  308. <tr>
  309. <td><a href=
  310. "../tools/build/v1/mipspro-tools.html"><code>mipspro</code></a></td>
  311. <td>SGI <a href=
  312. "http://www.sgi.com/developers/devtools/languages/mipspro.html">MIPSpro
  313. C and C++</a></td>
  314. </tr>
  315. <tr>
  316. <td><a href=
  317. "../tools/build/v1/msvc-tools.html"><code>msvc</code></a></td>
  318. <td>Microsoft <a href="http://msdn.microsoft.com/visualc/">Visual
  319. C++</a> version 6 command-line tools. NOTE; For version 7.x (the .NET
  320. series) use the vc7 or vc7.1 toolsets below.</td>
  321. </tr>
  322. <tr>
  323. <td><a href=
  324. "../tools/build/v1/msvc-stlport-tools.html"><code>msvc-stlport</code></a></td>
  325. <td>Microsoft <a href="http://msdn.microsoft.com/visualc/">Visual
  326. C++</a> version 6 command-line tools, using the <a href=
  327. "http://www.stlport.org">STLport</a> standard library implementation.
  328. NOTE; For version 7.x (the .NET series) use the vc7-stlport or
  329. vc7.1-stlport toolsets below.</td>
  330. </tr>
  331. <tr>
  332. <td><a href=
  333. "../tools/build/v1/sunpro-tools.html"><code>sunpro</code></a></td>
  334. <td><a href=
  335. "http://wwws.sun.com/software/sundev/suncc/index.html">SunPRO C++</a>
  336. compiler</td>
  337. </tr>
  338. <tr>
  339. <td><a href=
  340. "../tools/build/v1/tru64cxx-tools.html"><code>tru64cxx</code></a></td>
  341. <td><a href="http://www.tru64unix.compaq.com/cplus/">Compaq C++</a> for
  342. Tru64 UNIX (versions prior to 6.5)</td>
  343. </tr>
  344. <tr>
  345. <td><a href=
  346. "../tools/build/v1/tru64cxx-tools.html"><code>tru64cxx65</code></a></td>
  347. <td><a href="http://www.tru64unix.compaq.com/cplus/">Compaq C++</a>
  348. Version 6.5 for Tru64 UNIX</td>
  349. </tr>
  350. <tr>
  351. <td><a href=
  352. "../tools/build/v1/vacpp-tools.html"><code>vacpp</code></a></td>
  353. <td><a href="http://www-3.ibm.com/software/ad/vacpp/">IBM Visual Age
  354. C++</a> command-line tools</td>
  355. </tr>
  356. <tr>
  357. <td><a href=
  358. "../tools/build/v1/vc7-tools.html"><code>vc7</code></a></td>
  359. <td>Microsoft <a href="http://msdn.microsoft.com/visualc/">Visual
  360. C++</a> command-line tools from Visual Studio .NET.</td>
  361. </tr>
  362. <tr>
  363. <td><a href=
  364. "../tools/build/v1/vc7-stlport-tools.html"><code>vc7-stlport</code></a></td>
  365. <td>Microsoft <a href="http://msdn.microsoft.com/visualc/">Visual
  366. C++</a> command-line tools from Visual Studio .NET + STLPort.</td>
  367. </tr>
  368. <tr>
  369. <td><a href=
  370. "../tools/build/v1/vc7.1-tools.html"><code>vc7.1</code></a></td>
  371. <td>Microsoft <a href="http://msdn.microsoft.com/visualc/">Visual
  372. C++</a> command-line tools from Visual Studio .NET 2003.</td>
  373. </tr>
  374. <tr>
  375. <td><a href=
  376. "../tools/build/v1/vc7.1-stlport-tools.html"><code>vc7.1-stlport</code></a></td>
  377. <td>Microsoft <a href="http://msdn.microsoft.com/visualc/">Visual
  378. C++</a> command-line tools from Visual Studio .NET 2003 + STLPort.</td>
  379. </tr>
  380. </table>
  381. <h2><a name="Build_Install"></a>Build and Install</h2>
  382. <p>The common build and install process is driven by the top-level build
  383. file (<a href="../Jamfile">Jamfile</a>).</p>
  384. <table summary="" width="100%" border="0" cellspacing="2" cellpadding="2">
  385. <tr align="left" valign="top">
  386. <td width="40" align="center" valign="top" bgcolor="#FFFF66">
  387. <font size="6"><b><a name="step4"></a>4</b></font></td>
  388. <td>
  389. <p>First you need to change to the directory where you have the Boost
  390. distribution you downloaded. For example:</p>
  391. <blockquote>
  392. <p><code>chdir&nbsp;boost-1.31.0</code></p>
  393. </blockquote>
  394. </td>
  395. </tr>
  396. </table>
  397. <p>The default build and install attempts to build all available libraries
  398. and install to default locations the libraries and Boost header files. On
  399. Unix systems the default install location is "<tt>/usr/local</tt>", and on
  400. Windows systems the default is "<tt>C:\Boost</tt>". Within those
  401. directories libraries are installed to the "<tt>lib</tt>" subdirectory, and
  402. headers to an "<tt>include/boost-1_31</tt>" subdirectory, the version will
  403. reflect the distribution you are installing.</p>
  404. <table summary="" width="100%" border="0" cellspacing="2" cellpadding="2">
  405. <tr align="left" valign="top">
  406. <td width="40" align="center" valign="top" bgcolor="#FFFF66">
  407. <font size="6"><b><a name="step5"></a>5</b></font></td>
  408. <td>
  409. Invoke the build system, specifying the <a href=
  410. "#Tools">toolset</a>(s) you wish to use, to build and install. For
  411. example for GNU/GCC.
  412. <blockquote>
  413. <p><code>bjam&nbsp;"-sTOOLS=gcc" install</code></p>
  414. </blockquote>
  415. <p>Or if you are interested only in the built libraries you can have
  416. them built and collected to a common directory without
  417. installation.</p>
  418. <blockquote>
  419. <p><code>bjam&nbsp;"-sTOOLS=gcc" stage</code></p>
  420. </blockquote>
  421. </td>
  422. </tr>
  423. </table>
  424. <p>The build and install system can be controlled through a set of options
  425. similar in style to GNU configure options. The options allow you to, among
  426. other things, change the install location, disable building of libraries,
  427. etc. You can see a summary of the available options by invoking "<tt>bjam
  428. --help</tt>". The full invocation takes the form:</p>
  429. <blockquote>
  430. <p><code>bjam&nbsp;[<i>options</i>...] [install|stage]</code></p>
  431. </blockquote>
  432. <table summary="" border="1" cellspacing="0" cellpadding="2">
  433. <tr>
  434. <th>Action</th>
  435. <td>&nbsp;</td>
  436. </tr>
  437. <tr>
  438. <td nowrap align="left" valign="top"><i>none</i></td>
  439. <td align="left" valign="top">Only builds the Boost libraries. This
  440. lets you do the first part of what the <tt>install</tt> action normally
  441. does without copying the built libraries to the install location.</td>
  442. </tr>
  443. <tr>
  444. <td nowrap align="left" valign="top"><tt>install</tt></td>
  445. <td align="left" valign="top">Builds and installs Boost libraries and
  446. headers.</td>
  447. </tr>
  448. <tr>
  449. <td nowrap align="left" valign="top"><tt>stage</tt></td>
  450. <td align="left" valign="top">Builds the Boost libraries and copies
  451. them into a common directory.</td>
  452. </tr>
  453. <tr>
  454. <th nowrap>Option</th>
  455. <td align="left" valign="top">&nbsp;</td>
  456. </tr>
  457. <tr>
  458. <td nowrap align="left" valign="top"><tt>--help</tt></td>
  459. <td align="left" valign="top">Shows a short summary of the options and
  460. syntax of the command.</td>
  461. </tr>
  462. <tr>
  463. <td nowrap align="left" valign="top">
  464. <tt>-sTOOLS=&lt;<i>toolsets</i>&gt;</tt></td>
  465. <td align="left" valign="top">The list of tools to compile with.
  466. Usually only one is needed.</td>
  467. </tr>
  468. <tr>
  469. <td nowrap align="left" valign="top"><tt>--prefix=PREFIX</tt></td>
  470. <td align="left" valign="top">Install architecture independent files
  471. here.<br>
  472. Default; <tt>C:\Boost</tt> on Win32.<br>
  473. Default; <tt>/usr/local</tt> on Unix. Linux, etc.</td>
  474. </tr>
  475. <tr>
  476. <td nowrap align="left" valign="top">
  477. <tt>--exec-prefix=EPREFIX</tt></td>
  478. <td align="left" valign="top">Install architecture dependent files
  479. here.<br>
  480. Default; <tt>PREFIX</tt></td>
  481. </tr>
  482. <tr>
  483. <td nowrap align="left" valign="top"><tt>--libdir=DIR</tt></td>
  484. <td align="left" valign="top">Install libraries here.<br>
  485. Default; <tt>EPREFIX/lib</tt></td>
  486. </tr>
  487. <tr>
  488. <td nowrap align="left" valign="top"><tt>--includedir=DIR</tt></td>
  489. <td align="left" valign="top">Install source headers here. The Boost
  490. headers are installed in a version specific
  491. "<tt>boost-&lt;version&gt;</tt>" subdirectory in this directory.<br>
  492. Default; <tt>PREFIX/include</tt></td>
  493. </tr>
  494. <tr>
  495. <td nowrap align="left" valign="top"><tt>--builddir=DIR</tt></td>
  496. <td align="left" valign="top">Build in this location instead of
  497. building within the distribution tree. This moves where the sources for
  498. the libraries are compiled to before they are installed.
  499. Recommended!</td>
  500. </tr>
  501. <tr>
  502. <td nowrap align="left" valign="top"><tt>--stagedir=DIR</tt></td>
  503. <td align="left" valign="top">When staging only, with the
  504. "<tt>stage</tt>" action, copy to the given location.<br>
  505. Default; <tt>./stage</tt></td>
  506. </tr>
  507. <tr>
  508. <td nowrap align="left" valign="top">
  509. <tt>--without-&lt;<i>library</i>&gt;</tt></td>
  510. <td align="left" valign="top">Do not build, stage, or install the
  511. specified library.</td>
  512. </tr>
  513. <tr>
  514. <td nowrap align="left" valign="top">
  515. <tt>--with-python-root[=PYTHON_ROOT]</tt></td>
  516. <td align="left" valign="top">Build Boost.Python libraries with the
  517. Python devel packages located at <tt>PYTHON_ROOT</tt>. The Boost.Python
  518. libraries are built only if the build can find the Python development
  519. package at this location.<br>
  520. Default; <tt>C:\tools\python</tt> on Win32.<br>
  521. Default; <tt>/usr/local</tt> on Unix, Linux, etc.<br>
  522. Default; <tt>/usr</tt> on Cygwin.</td>
  523. </tr>
  524. <tr>
  525. <td nowrap align="left" valign="top"><tt>--with-pydebug</tt></td>
  526. <td align="left" valign="top">Build Boost.Python libraries using the
  527. Python debug runtime. This builds an additional set of libraries for
  528. use with the debug version of Python. The regular versions of the
  529. Boost.Python libraries are also built.</td>
  530. </tr>
  531. </table>
  532. <p>There are additional options as supported by <a href=
  533. "../tools/build/v1/build_system.htm">Boost.Build</a> and <a href=
  534. "../tools/build/jam_src/index.html">Boost.Jam</a>. Of the additional
  535. options perhaps the most imporant is "<tt>-s<a href=
  536. "../tools/build/v1/build_system.htm#build">BUILD</a>=&lt;features/variants&gt;</tt>"
  537. which lets you override what is built by default. The
  538. "<tt>&lt;features/variants&gt;</tt>" value is a list, separated by spaces,
  539. of build requests. Features take the form of a tag and a value or values.
  540. And variants are single symbolic names for a collection of features. For
  541. example the default is to request "<tt>debug release
  542. &lt;runtime-link&gt;static/dynamic &lt;threading&gt;single/multiple</tt>",
  543. in which "<tt>debug</tt>" and "<tt>release</tt>" are variants, and the rest
  544. features with two values each.</p>
  545. <p>If you have some feedback about the build and install process please
  546. drop us a line at the <a href="mailing_lists.htm#jamboost">Boost.Build
  547. mailing list</a>. We are particularly interested if it works for your
  548. platform and if it there is anything that you feel could be done
  549. better.</p>
  550. <h2><a name="Results"></a>Results</h2>
  551. <p>The results of building come in to forms: static libraries, and dynamic
  552. libraries. Depending on the platform the libraries produced have different
  553. names to accommodate the platform requirements. For a single Boost library
  554. the build with the default will produce eight different libraries. For
  555. example building the Boost.Datetime library on Unix type system it would
  556. produce:</p>
  557. <ol>
  558. <li><tt>libboost_date_time-gcc-d-1_31.so</tt></li>
  559. <li><tt>libboost_date_time-gcc-mt-d-1_31.so</tt></li>
  560. <li><tt>libboost_date_time-gcc-1_31.so</tt></li>
  561. <li><tt>libboost_date_time-gcc-mt-1_31.so</tt></li>
  562. <li><tt>libboost_date_time-gcc-d-1_31.a</tt></li>
  563. <li><tt>libboost_date_time-gcc-mt-d-1_31.a</tt></li>
  564. <li><tt>libboost_date_time-gcc-1_31.a</tt></li>
  565. <li><tt>libboost_date_time-gcc-mt-1_31.a</tt><br></li>
  566. </ol>
  567. <table summary="" border="0" cellspacing="0" cellpadding="0" width="100%">
  568. <tr>
  569. <td colspan="11">
  570. <table summary="" border="0" cellspacing="2" cellpadding="2" bgcolor=
  571. "#CCCCCC">
  572. <tr>
  573. <th>&middot; Library Prefix</th>
  574. </tr>
  575. </table>
  576. </td>
  577. <td width="80%">&nbsp;</td>
  578. </tr>
  579. <tr>
  580. <td rowspan="7" valign="bottom" bgcolor="#CCCCCC"><tt><font size=
  581. "+1">lib</font></tt></td>
  582. <td colspan="11">
  583. <table summary="" border="0" cellspacing="2" cellpadding="2">
  584. <tr>
  585. <th>&middot; Library Name</th>
  586. </tr>
  587. </table>
  588. </td>
  589. </tr>
  590. <tr>
  591. <td rowspan="6" valign="bottom"><tt><font size=
  592. "+1">boost_date_time</font></tt></td>
  593. <td colspan="10">
  594. <table summary="" border="0" cellspacing="2" cellpadding="2" bgcolor=
  595. "#CCCCCC">
  596. <tr>
  597. <th>&middot; Toolset</th>
  598. </tr>
  599. </table>
  600. </td>
  601. </tr>
  602. <tr>
  603. <td rowspan="5" valign="bottom" bgcolor="#CCCCCC"><tt><font size=
  604. "+1">-</font></tt></td>
  605. <td rowspan="5" valign="bottom" bgcolor="#CCCCCC"><tt><font size=
  606. "+1">gcc</font></tt></td>
  607. <td colspan="8">
  608. <table summary="" border="0" cellspacing="2" cellpadding="2">
  609. <tr>
  610. <th>&middot; Threading</th>
  611. </tr>
  612. </table>
  613. </td>
  614. </tr>
  615. <tr>
  616. <td rowspan="4" valign="bottom"><tt><font size="+1">-</font></tt></td>
  617. <td rowspan="4" valign="bottom"><tt><font size="+1">mt</font></tt></td>
  618. <td colspan="6">
  619. <table summary="" border="0" cellspacing="2" cellpadding="2" bgcolor=
  620. "#CCCCCC">
  621. <tr>
  622. <th>&middot; Runtime</th>
  623. </tr>
  624. </table>
  625. </td>
  626. </tr>
  627. <tr>
  628. <td rowspan="3" valign="bottom" bgcolor="#CCCCCC"><tt><font size=
  629. "+1">-</font></tt></td>
  630. <td rowspan="3" valign="bottom" bgcolor="#CCCCCC"><tt><font size=
  631. "+1">d</font></tt></td>
  632. <td colspan="4">
  633. <table summary="" border="0" cellspacing="2" cellpadding="2">
  634. <tr>
  635. <th>&middot; Boost Version</th>
  636. </tr>
  637. </table>
  638. </td>
  639. </tr>
  640. <tr>
  641. <td rowspan="2" valign="bottom"><tt><font size="+1">-</font></tt></td>
  642. <td rowspan="2" valign="bottom"><tt><font size=
  643. "+1">1_31</font></tt></td>
  644. <td colspan="2">
  645. <table summary="" border="0" cellspacing="2" cellpadding="2" bgcolor=
  646. "#CCCCCC">
  647. <tr>
  648. <th>&middot; Library Type</th>
  649. </tr>
  650. </table>
  651. </td>
  652. </tr>
  653. <tr>
  654. <td valign="bottom" bgcolor="#CCCCCC"><tt><font size=
  655. "+1">.a</font></tt></td>
  656. <td>&nbsp;</td>
  657. </tr>
  658. </table>
  659. <h3>Library Prefix</h3>
  660. <p>The "lib" prefix on the libraries is a requirement on many platforms,
  661. like Unix, and on others like GCC running on Windows. The prefix is
  662. therefore added to all libraries on Unix type systems, and to static
  663. libraries on Windows. That is on Unix shared libraries and static libraries
  664. (object archives) are named respectively:</p>
  665. <ul>
  666. <li><tt>lib*.so</tt></li>
  667. <li><tt>lib*.a</tt></li>
  668. </ul>
  669. <p>On Windows shared libraries do not have the prefix to differentiate the
  670. import libraries from static libraries. Consequently on Windows the
  671. libraries are named:</p>
  672. <ul>
  673. <li><tt>*.dll</tt></li>
  674. <li><tt>*.lib</tt></li>
  675. <li><tt>lib*.lib</tt></li>
  676. </ul>
  677. <h3>Library Name</h3>
  678. <p>For Boost libraries the name has the "<tt>boost_</tt>" prefix to
  679. separate them from other libraries in your system.</p>
  680. <h3>Toolset</h3>
  681. <p>The toolset name is an abbreviation based on the compiler you are
  682. building with. The abbreviation is composed of a short, 2 to 4 characters,
  683. tag for the compiler and a version number of the compiler's major and minor
  684. revision (if available). For example if your toolset is
  685. "<tt>gcc-3.2.3</tt>" the toolset tag would be "<tt>gcc32</tt>". The toolset
  686. abbreviations used are as follows:</p>
  687. <table border="1" cellpadding="5" summary="">
  688. <tr>
  689. <td><b>TOOLS Name</b></td>
  690. <td><b>Abbreviation</b></td>
  691. </tr>
  692. <tr>
  693. <td><a href=
  694. "../tools/build/v1/borland-tools.html"><code>borland</code></a></td>
  695. <td><tt>bcb</tt></td>
  696. </tr>
  697. <tr>
  698. <td><a href=
  699. "../tools/build/v1/como-tools.html"><code>como</code></a></td>
  700. <td><tt>como</tt></td>
  701. </tr>
  702. <tr>
  703. <td><code><a href=
  704. "../tools/build/v1/como-tools.html">como-win32</a></code></td>
  705. <td><tt>como</tt></td>
  706. </tr>
  707. <tr>
  708. <td><a href=
  709. "../tools/build/v1/cwpro8-tools.html"><code>cwpro8</code></a></td>
  710. <td><tt>cw8</tt></td>
  711. </tr>
  712. <tr>
  713. <td><a href=
  714. "../tools/build/v1/darwin-tools.html"><code>darwin</code></a></td>
  715. <td><tt>osx</tt></td>
  716. </tr>
  717. <tr>
  718. <td><a href=
  719. "../tools/build/v1/edg-tools.html"><code>edg</code></a></td>
  720. <td><tt>edg</tt></td>
  721. </tr>
  722. <tr>
  723. <td><a href=
  724. "../tools/build/v1/gcc-tools.html"><code>gcc</code></a></td>
  725. <td><tt>gcc</tt></td>
  726. </tr>
  727. <tr>
  728. <td><a href=
  729. "../tools/build/v1/gcc-stlport-tools.html"><code>gcc-stlport</code></a></td>
  730. <td><tt>gcc</tt></td>
  731. </tr>
  732. <tr>
  733. <td><a href=
  734. "../tools/build/v1/gcc-nocygwin-tools.html"><code>gcc-nocygwin</code></a></td>
  735. <td><tt>gcc</tt></td>
  736. </tr>
  737. <tr>
  738. <td><a href=
  739. "../tools/build/v1/intel-linux-tools.html"><code>intel-linux</code></a></td>
  740. <td><tt>il</tt></td>
  741. </tr>
  742. <tr>
  743. <td><a href=
  744. "../tools/build/v1/intel-win32-tools.html"><code>intel-win32</code></a></td>
  745. <td><tt>iw</tt></td>
  746. </tr>
  747. <tr>
  748. <td><a href=
  749. "../tools/build/v1/kcc-tools.html"><code>kcc</code></a></td>
  750. <td><tt>kcc</tt></td>
  751. </tr>
  752. <tr>
  753. <td><a href=
  754. "../tools/build/v1/kylix-tools.html"><code>kylix</code></a></td>
  755. <td><tt>bck</tt></td>
  756. </tr>
  757. <tr>
  758. <td><a href=
  759. "../tools/build/v1/metrowerks-tools.html"><code>metrowerks</code></a></td>
  760. <td><tt>cw</tt></td>
  761. </tr>
  762. <tr>
  763. <td><a href=
  764. "../tools/build/v1/mingw-tools.html"><code>mingw</code></a></td>
  765. <td><tt>mgw</tt></td>
  766. </tr>
  767. <tr>
  768. <td><a href=
  769. "../tools/build/v1/mipspro-tools.html"><code>mipspro</code></a></td>
  770. <td><tt>mp</tt></td>
  771. </tr>
  772. <tr>
  773. <td><a href=
  774. "../tools/build/v1/msvc-tools.html"><code>msvc</code></a></td>
  775. <td><tt>vc</tt></td>
  776. </tr>
  777. <tr>
  778. <td><a href=
  779. "../tools/build/v1/msvc-stlport-tools.html"><code>msvc-stlport</code></a></td>
  780. <td><tt>vc</tt></td>
  781. </tr>
  782. <tr>
  783. <td><a href=
  784. "../tools/build/v1/sunpro-tools.html"><code>sunpro</code></a></td>
  785. <td><tt>sw</tt></td>
  786. </tr>
  787. <tr>
  788. <td><a href=
  789. "../tools/build/v1/tru64cxx-tools.html"><code>tru64cxx</code></a></td>
  790. <td><tt>tru</tt></td>
  791. </tr>
  792. <tr>
  793. <td><a href=
  794. "../tools/build/v1/tru64cxx-tools.html"><code>tru64cxx65</code></a></td>
  795. <td><tt>tru</tt></td>
  796. </tr>
  797. <tr>
  798. <td><a href=
  799. "../tools/build/v1/vacpp-tools.html"><code>vacpp</code></a></td>
  800. <td><tt>xlc</tt></td>
  801. </tr>
  802. <tr>
  803. <td><a href=
  804. "../tools/build/v1/vc7-tools.html"><code>vc7</code></a></td>
  805. <td><tt>vc</tt></td>
  806. </tr>
  807. <tr>
  808. <td><a href=
  809. "../tools/build/v1/vc7.1-tools.html"><code>vc7.1</code></a></td>
  810. <td><tt>vc</tt></td>
  811. </tr>
  812. <tr>
  813. <td>Others</td>
  814. <td>The first part of the toolset name.</td>
  815. </tr>
  816. </table>
  817. <h3>Threading</h3>
  818. <p>This tag indicates if the library is compiled with threading support. If
  819. threading is enabled "<tt>-mt</tt>" is added, otherwise nothing is
  820. added.</p>
  821. <h3>Runtime</h3>
  822. <p>This specifies the type of runtime the library was compiled against, and
  823. the type of code that is compiled. More commonly this encodes the ABI
  824. variation used in the code. For each feature of the runtime system and code
  825. compilation option a single letter is added to this tag.</p>
  826. <table border="1" cellpadding="5" summary="">
  827. <tr>
  828. <td><b>Key</b></td>
  829. <td><b>Feature</b></td>
  830. </tr>
  831. <tr>
  832. <td><tt>s</tt></td>
  833. <td>Static link to runtime.</td>
  834. </tr>
  835. <tr>
  836. <td><tt>g</tt></td>
  837. <td>Debug runtime.</td>
  838. </tr>
  839. <tr>
  840. <td><tt>y</tt></td>
  841. <td>Debug Python system.</td>
  842. </tr>
  843. <tr>
  844. <td><tt>d</tt></td>
  845. <td>Debug enabled code.</td>
  846. </tr>
  847. <tr>
  848. <td><tt>p</tt></td>
  849. <td>STLport runtime, instead of the vendor toolset runtime.</td>
  850. </tr>
  851. <tr>
  852. <td><tt>n</tt></td>
  853. <td>STLport runtime using the "native" IO streams instead of the
  854. STLport IO streams.</td>
  855. </tr>
  856. </table>
  857. <p>For example if you compile debug code for STLport using native IO
  858. streams, and statically link to the debug runtime the tag would be:
  859. "<tt>-sgdpn</tt>".</p>
  860. <h3>Boost Version</h3>
  861. <p>This is the short label for the version of the Boost Libraries. The
  862. major and minor version numbers are taken together separated by an
  863. underscore. For example version 1.31.0 would be tagged as "<tt>-1_31</tt>".
  864. The patch version number is not included because it is assumed that patch
  865. versions are upward compatible.</p>
  866. <h3>Library Type</h3>
  867. <p>The extension holds the type of library. This follows the platform
  868. requirements. On Windows this is "<tt>.dll</tt>" for shared libraries, and
  869. "<tt>.lib</tt>" for static libraries including import libraries. On Unix
  870. this is ".a" for static libraries (archives), and ".so" for shared
  871. libraries. For toolsets that support it in Unix they will also have a full
  872. version extension (for example "<tt>.so.1.31.0</tt>") with a symbolic link
  873. for the un-versioned library.</p>
  874. <h2><a name="Additional_Steps"></a>Additional Steps</h2>
  875. <p>Depending on your platform and configuration you may need to perform
  876. some additional configuration to get Boost to build and install.</p>
  877. <ul>
  878. <li><a href="../libs/config/config.htm#configuring">Configure the boost
  879. source code</a>. This step should not be required on the vast majority of
  880. platforms, but if you're trying to build Boost on an untested or
  881. unsupported platform it may be necessary.<br>
  882. <br></li>
  883. <li>If Boost.Build has problems detecting your Python installation it
  884. will print a short messages about how to configure for finding the Python
  885. installation. For more information, see these detailed <a href=
  886. "../libs/python/doc/building.html#building">instructions</a>.</li>
  887. </ul>
  888. <hr>
  889. <p>Revised <!--webbot bot="Timestamp" s-type="EDITED"
  890. s-format="%d %B, %Y" startspan -->
  891. 24 December, 2003
  892. <!--webbot bot="Timestamp" endspan i-checksum="39365" --></p>
  893. <p>Copyright &copy; Rene Rivera 2003.<br>
  894. Copyright &copy; Jens Maurer 2001.</p>
  895. <p><small>Use, modification, and distribution are subject to the Boost
  896. Software License, Version 1.0. (See accompanying file <a href=
  897. "../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or copy at <a href=
  898. "http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p>
  899. </body>
  900. </html>
粤ICP备19079148号