1
0

getting_started.html 38 KB

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