getting_started.html 38 KB

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