install.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
  4. <title>Building and Installing the Library</title>
  5. <link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
  6. <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
  7. <link rel="home" href="../index.html" title="Boost.Regex 5.1.4">
  8. <link rel="up" href="../index.html" title="Boost.Regex 5.1.4">
  9. <link rel="prev" href="configuration/tuning.html" title="Algorithm Tuning">
  10. <link rel="next" href="intro.html" title="Introduction and Overview">
  11. </head>
  12. <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
  13. <table cellpadding="2" width="100%"><tr>
  14. <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
  15. <td align="center"><a href="../../../../../index.html">Home</a></td>
  16. <td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
  17. <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
  18. <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
  19. <td align="center"><a href="../../../../../more/index.htm">More</a></td>
  20. </tr></table>
  21. <hr>
  22. <div class="spirit-nav">
  23. <a accesskey="p" href="configuration/tuning.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="intro.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
  24. </div>
  25. <div class="section">
  26. <div class="titlepage"><div><div><h2 class="title" style="clear: both">
  27. <a name="boost_regex.install"></a><a class="link" href="install.html" title="Building and Installing the Library">Building and Installing the Library</a>
  28. </h2></div></div></div>
  29. <p>
  30. When you extract the library from its zip file, you must preserve its internal
  31. directory structure (for example by using the -d option when extracting). If
  32. you didn't do that when extracting, then you'd better stop reading this, delete
  33. the files you just extracted, and try again!
  34. </p>
  35. <p>
  36. This library should not need configuring before use; most popular compilers/standard
  37. libraries/platforms are already supported "as is". If you do experience
  38. configuration problems, or just want to test the configuration with your compiler,
  39. then the process is the same as for all of boost; see the <a href="../../../../config/index.html" target="_top">configuration
  40. library documentation</a>.
  41. </p>
  42. <p>
  43. The library will encase all code inside namespace boost.
  44. </p>
  45. <p>
  46. Unlike some other template libraries, this library consists of a mixture of
  47. template code (in the headers) and static code and data (in cpp files). Consequently
  48. it is necessary to build the library's support code into a library or archive
  49. file before you can use it, instructions for specific platforms are as follows:
  50. </p>
  51. <h5>
  52. <a name="boost_regex.install.h0"></a>
  53. <span class="phrase"><a name="boost_regex.install.building_with_bjam"></a></span><a class="link" href="install.html#boost_regex.install.building_with_bjam">Building
  54. with bjam</a>
  55. </h5>
  56. <p>
  57. This is now the preferred method for building and installing this library,
  58. please refer to the <a href="../../../../../more/getting_started.html" target="_top">getting
  59. started guide</a> for more information.
  60. </p>
  61. <h5>
  62. <a name="boost_regex.install.h1"></a>
  63. <span class="phrase"><a name="boost_regex.install.building_with_unicode_and_icu_su"></a></span><a class="link" href="install.html#boost_regex.install.building_with_unicode_and_icu_su">Building
  64. With Unicode and ICU Support</a>
  65. </h5>
  66. <p>
  67. Boost.Regex is now capable of performing a configuration check to test whether
  68. ICU is already installed in your compiler's search paths. When you build you
  69. should see a message like this:
  70. </p>
  71. <pre class="programlisting"><span class="identifier">Performing</span> <span class="identifier">configuration</span> <span class="identifier">checks</span>
  72. <span class="special">-</span> <span class="identifier">has_icu</span> <span class="identifier">builds</span> <span class="special">:</span> <span class="identifier">yes</span>
  73. </pre>
  74. <p>
  75. Which means that ICU has been found, and support for it will be enabled in
  76. the library build.
  77. </p>
  78. <div class="tip"><table border="0" summary="Tip">
  79. <tr>
  80. <td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="../../../../../doc/src/images/tip.png"></td>
  81. <th align="left">Tip</th>
  82. </tr>
  83. <tr><td align="left" valign="top"><p>
  84. If you don't want the regex library to use ICU then build with the "--disable-icu"
  85. command line option.
  86. </p></td></tr>
  87. </table></div>
  88. <p>
  89. If instead you see:
  90. </p>
  91. <pre class="programlisting"><span class="identifier">Performing</span> <span class="identifier">configuration</span> <span class="identifier">checks</span>
  92. <span class="special">-</span> <span class="identifier">has_icu</span> <span class="identifier">builds</span> <span class="special">:</span> <span class="identifier">no</span>
  93. </pre>
  94. <p>
  95. Then ICU was not found and support for it will not be compiled into the library.
  96. If you think that it should have been found, then you will need to take a look
  97. at the contents of the file <span class="emphasis"><em>boost-root/bin.v2/config.log</em></span>
  98. for the actual error messages obtained when the build carried out the configuration
  99. check. You will then need to fix these errors by ensuring your compiler gets
  100. invoked with the correct options. The main options that you're likely to pass
  101. to <code class="computeroutput"><span class="identifier">b2</span></code> are:
  102. </p>
  103. <div class="informaltable"><table class="table">
  104. <colgroup>
  105. <col>
  106. <col>
  107. </colgroup>
  108. <thead><tr>
  109. <th>
  110. <p>
  111. Option
  112. </p>
  113. </th>
  114. <th>
  115. <p>
  116. Description
  117. </p>
  118. </th>
  119. </tr></thead>
  120. <tbody>
  121. <tr>
  122. <td>
  123. <p>
  124. include=/some/path
  125. </p>
  126. </td>
  127. <td>
  128. <p>
  129. Adds "/some/path" to the list of paths seached for include
  130. files, normally equivalent to <code class="computeroutput"><span class="special">-</span><span class="identifier">I</span><span class="special">/</span><span class="identifier">some</span><span class="special">/</span><span class="identifier">path</span></code> on most compilers.
  131. </p>
  132. </td>
  133. </tr>
  134. <tr>
  135. <td>
  136. <p>
  137. library-path=/some/path
  138. </p>
  139. </td>
  140. <td>
  141. <p>
  142. Adds "/some/path" to the list of paths searched for external
  143. libraries, set this to the location of the ICU binaries if they're
  144. in a non-standard location.
  145. </p>
  146. </td>
  147. </tr>
  148. <tr>
  149. <td>
  150. <p>
  151. -sICU_ICUUC_NAME=NAME
  152. </p>
  153. </td>
  154. <td>
  155. <p>
  156. If <code class="computeroutput"><span class="identifier">libicuuc</span></code> has a
  157. non-standard name then this sets the name of the library linked against,
  158. defaults to either <code class="computeroutput"><span class="identifier">icuuc</span></code>,
  159. <code class="computeroutput"><span class="identifier">icuucd</span></code>, <code class="computeroutput"><span class="identifier">sicuuc</span></code> or <code class="computeroutput"><span class="identifier">sicuucd</span></code>
  160. depending on build options.
  161. </p>
  162. </td>
  163. </tr>
  164. <tr>
  165. <td>
  166. <p>
  167. -sICU_ICUDT_NAME=NAME
  168. </p>
  169. </td>
  170. <td>
  171. <p>
  172. If <code class="computeroutput"><span class="identifier">libicudata</span></code> has
  173. a non-standard name then this sets the name of the library linked
  174. against, defaults to either <code class="computeroutput"><span class="identifier">icudt</span></code>,
  175. <code class="computeroutput"><span class="identifier">icudata</span></code>, <code class="computeroutput"><span class="identifier">sicudt</span></code> or <code class="computeroutput"><span class="identifier">sicudata</span></code>
  176. depending on build options and platform.
  177. </p>
  178. </td>
  179. </tr>
  180. <tr>
  181. <td>
  182. <p>
  183. -sICU_ICUIN_NAME=NAME
  184. </p>
  185. </td>
  186. <td>
  187. <p>
  188. If <code class="computeroutput"><span class="identifier">libicui18n</span></code> has
  189. a non-standatd name then this sets the name of the library linked
  190. against, defaults to either <code class="computeroutput"><span class="identifier">icui18n</span></code>,
  191. <code class="computeroutput"><span class="identifier">icuin</span></code>, <code class="computeroutput"><span class="identifier">icuind</span></code>, sicuin<code class="computeroutput"> <span class="keyword">or</span>
  192. </code>sicuins` depending on build options and platform.
  193. </p>
  194. </td>
  195. </tr>
  196. <tr>
  197. <td>
  198. <p>
  199. cxxstd=XX
  200. </p>
  201. </td>
  202. <td>
  203. <p>
  204. Sets the C++ standard supported: XX should be either 03, 11, 14,
  205. 17 or 2a.
  206. </p>
  207. </td>
  208. </tr>
  209. <tr>
  210. <td>
  211. <p>
  212. cxxflags="FLAGS"
  213. </p>
  214. </td>
  215. <td>
  216. <p>
  217. Passes "FLAGS" directly to the compiler, an option of last
  218. resort!
  219. </p>
  220. </td>
  221. </tr>
  222. <tr>
  223. <td>
  224. <p>
  225. linflags="FLAGS"
  226. </p>
  227. </td>
  228. <td>
  229. <p>
  230. Passes "FLAGS" directly to the compiler on the link step,
  231. an option of last resort!
  232. </p>
  233. </td>
  234. </tr>
  235. </tbody>
  236. </table></div>
  237. <div class="important"><table border="0" summary="Important">
  238. <tr>
  239. <td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="../../../../../doc/src/images/important.png"></td>
  240. <th align="left">Important</th>
  241. </tr>
  242. <tr><td align="left" valign="top"><p>
  243. Configuration results are cached - if you try rebuilding with different compiler
  244. options then add an "-a" to the bjam command line to force all
  245. targets to be rebuilt.
  246. </p></td></tr>
  247. </table></div>
  248. <div class="important"><table border="0" summary="Important">
  249. <tr>
  250. <td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="../../../../../doc/src/images/important.png"></td>
  251. <th align="left">Important</th>
  252. </tr>
  253. <tr><td align="left" valign="top"><p>
  254. ICU is a C++ library just like Boost is, as such your copy of ICU must have
  255. been built with the same C++ compiler (and compiler version) that you are
  256. using to build Boost. Boost.Regex will not work correctly unless you ensure
  257. that this is the case: it is up to you to ensure that the version of ICU
  258. you are using is binary compatible with the toolset you use to build Boost.
  259. </p></td></tr>
  260. </table></div>
  261. <p>
  262. And finally, if you want to build/test with multiple compiler versions, all
  263. with different ICU builds, then the only way to achieve that currently is to
  264. modify your user-config.jam so that each toolset has the necessary compiler/linker
  265. options set so that ICU is found automatically by the configuration step (providing
  266. the ICU binaries use the standard names, all you have to add is the appropriate
  267. header-include and linker-search paths).
  268. </p>
  269. <h5>
  270. <a name="boost_regex.install.h2"></a>
  271. <span class="phrase"><a name="boost_regex.install.building_from_source"></a></span><a class="link" href="install.html#boost_regex.install.building_from_source">Building
  272. from Source</a>
  273. </h5>
  274. <p>
  275. The Regex library is "just a bunch of source files": nothing special
  276. is required to build them.
  277. </p>
  278. <p>
  279. You can either build the files under boost-path/libs/regex/src/*.cpp as a library,
  280. or add them directly to your project. This is particularly useful if you need
  281. to use specific compiler options not supported by the default Boost build.
  282. </p>
  283. <p>
  284. There are two #defines you should be aware of:
  285. </p>
  286. <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
  287. <li class="listitem">
  288. BOOST_HAS_ICU should be defined if you want ICU support compiled in.
  289. </li>
  290. <li class="listitem">
  291. BOOST_REGEX_DYN_LINK should be defined if you are building a DLL on Windows.
  292. </li>
  293. </ul></div>
  294. </div>
  295. <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
  296. <td align="left"></td>
  297. <td align="right"><div class="copyright-footer">Copyright &#169; 1998-2013 John Maddock<p>
  298. Distributed under the Boost Software License, Version 1.0. (See accompanying
  299. file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
  300. </p>
  301. </div></td>
  302. </tr></table>
  303. <hr>
  304. <div class="spirit-nav">
  305. <a accesskey="p" href="configuration/tuning.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="intro.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
  306. </div>
  307. </body>
  308. </html>