]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
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.77.1"> | |
7 | <link rel="home" href="../index.html" title="Boost.Regex 5.1.2"> | |
8 | <link rel="up" href="../index.html" title="Boost.Regex 5.1.2"> | |
9 | <link rel="prev" href="configuration/tuning.html" title="Algorithm Tuning"> | |
10 | <link rel="next" href="introduction_and_overview.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="introduction_and_overview.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 | ||
73 | <span class="special">-</span> <span class="identifier">has_icu</span> <span class="identifier">builds</span> <span class="special">:</span> <span class="identifier">yes</span> | |
74 | </pre> | |
75 | <p> | |
76 | Which means that ICU has been found, and support for it will be enabled in | |
77 | the library build. | |
78 | </p> | |
79 | <div class="tip"><table border="0" summary="Tip"> | |
80 | <tr> | |
81 | <td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="../../../../../doc/src/images/tip.png"></td> | |
82 | <th align="left">Tip</th> | |
83 | </tr> | |
84 | <tr><td align="left" valign="top"><p> | |
85 | If you don't want the regex library to use ICU then build with the "--disable-icu" | |
86 | command line option. | |
87 | </p></td></tr> | |
88 | </table></div> | |
89 | <p> | |
90 | If instead you see: | |
91 | </p> | |
92 | <pre class="programlisting"><span class="identifier">Performing</span> <span class="identifier">configuration</span> <span class="identifier">checks</span> | |
93 | ||
94 | <span class="special">-</span> <span class="identifier">has_icu</span> <span class="identifier">builds</span> <span class="special">:</span> <span class="identifier">no</span> | |
95 | </pre> | |
96 | <p> | |
97 | Then ICU was not found and support for it will not be compiled into the library. | |
98 | If you think that it should have been found, then you will need to take a look | |
99 | at the contents of the file <span class="emphasis"><em>boost-root/bin.v2/config.log</em></span> | |
100 | for the actual error messages obtained when the build carried out the configuration | |
101 | check. You will then need to fix these errors by ensuring your compiler gets | |
102 | invoked with the correct options, for example: | |
103 | </p> | |
104 | <pre class="programlisting">bjam include=some-include-path --toolset=toolset-name install</pre> | |
105 | <p> | |
106 | will add "some-include-path" to your compilers header include path, | |
107 | or if ICU has been built with non-standard names for it's binaries, then: | |
108 | </p> | |
109 | <pre class="programlisting">bjam -sICU_LINK="linker-options-for-icu" --toolset=toolset-name install</pre> | |
110 | <p> | |
111 | Will use <span class="emphasis"><em>"linker-options-for-icu"</em></span> when linking | |
112 | the library rather than the default ICU binary names. | |
113 | </p> | |
114 | <p> | |
115 | You might also need to use the options "cxxflags=-option" and "linkflags=-option" | |
116 | to set compiler and linker specific options. | |
117 | </p> | |
118 | <div class="important"><table border="0" summary="Important"> | |
119 | <tr> | |
120 | <td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="../../../../../doc/src/images/important.png"></td> | |
121 | <th align="left">Important</th> | |
122 | </tr> | |
123 | <tr><td align="left" valign="top"><p> | |
124 | Configuration results are cached - if you try rebuilding with different compiler | |
125 | options then add an "-a" to the bjam command line to force all | |
126 | targets to be rebuilt. | |
127 | </p></td></tr> | |
128 | </table></div> | |
129 | <p> | |
130 | If ICU is not already in your compiler's path, but instead headers, libraries | |
131 | and binaries are located at <span class="emphasis"><em>path-to-icu/include</em></span>, <span class="emphasis"><em>path-to-icu/lib</em></span> | |
132 | and <span class="emphasis"><em>path-to-icu/bin</em></span> respectively then you need to set | |
133 | the environment variable <code class="computeroutput"><span class="identifier">ICU_PATH</span></code> | |
134 | to point to the root directory of your ICU installation: this typically happens | |
135 | if you're building with MSVC. For example if ICU was installed to <code class="computeroutput"><span class="identifier">c</span><span class="special">:\</span><span class="identifier">download</span><span class="special">\</span><span class="identifier">icu</span></code> you | |
136 | might use: | |
137 | </p> | |
138 | <pre class="programlisting">bjam -sICU_PATH=c:\download\icu --toolset=toolset-name install</pre> | |
139 | <div class="important"><table border="0" summary="Important"> | |
140 | <tr> | |
141 | <td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="../../../../../doc/src/images/important.png"></td> | |
142 | <th align="left">Important</th> | |
143 | </tr> | |
144 | <tr><td align="left" valign="top"><p> | |
145 | ICU is a C++ library just like Boost is, as such your copy of ICU must have | |
146 | been built with the same C++ compiler (and compiler version) that you are | |
147 | using to build Boost. Boost.Regex will not work correctly unless you ensure | |
148 | that this is the case: it is up to you to ensure that the version of ICU | |
149 | you are using is binary compatible with the toolset you use to build Boost. | |
150 | </p></td></tr> | |
151 | </table></div> | |
152 | <p> | |
153 | And finally, if you want to build/test with multiple compiler versions, all | |
154 | with different ICU builds, then the only way to achieve that currently is to | |
155 | modify your user-config.jam so that each toolset has the necessary compiler/linker | |
156 | options set so that ICU is found automatically by the configuration step (providing | |
157 | the ICU binaries use the standard names, all you have to add is the appropriate | |
158 | header-include and linker-search paths). | |
159 | </p> | |
160 | <h5> | |
161 | <a name="boost_regex.install.h2"></a> | |
162 | <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 | |
163 | from Source</a> | |
164 | </h5> | |
165 | <p> | |
166 | The Regex library is "just a bunch of source files": nothing special | |
167 | is required to build them. | |
168 | </p> | |
169 | <p> | |
170 | You can either build the files under boost-path/libs/regex/src/*.cpp as a library, | |
171 | or add them directly to your project. This is particularly useful if you need | |
172 | to use specific compiler options not supported by the default Boost build. | |
173 | </p> | |
174 | <p> | |
175 | There are two #defines you should be aware of: | |
176 | </p> | |
177 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | |
178 | <li class="listitem"> | |
179 | BOOST_HAS_ICU should be defined if you want ICU support compiled in. | |
180 | </li> | |
181 | <li class="listitem"> | |
182 | BOOST_REGEX_DYN_LINK should be defined if you are building a DLL on Windows. | |
183 | </li> | |
184 | </ul></div> | |
185 | <div class="important"><table border="0" summary="Important"> | |
186 | <tr> | |
187 | <td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="../../../../../doc/src/images/important.png"></td> | |
188 | <th align="left">Important</th> | |
189 | </tr> | |
190 | <tr><td align="left" valign="top"><p> | |
191 | The makefiles that were supplied with Boost.Regex are now deprecated and | |
192 | will be removed in the next release. | |
193 | </p></td></tr> | |
194 | </table></div> | |
195 | </div> | |
196 | <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> | |
197 | <td align="left"></td> | |
198 | <td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p> | |
199 | Distributed under the Boost Software License, Version 1.0. (See accompanying | |
200 | 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>) | |
201 | </p> | |
202 | </div></td> | |
203 | </tr></table> | |
204 | <hr> | |
205 | <div class="spirit-nav"> | |
206 | <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="introduction_and_overview.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a> | |
207 | </div> | |
208 | </body> | |
209 | </html> |