blob: 6cde576031027beafef45c5d2231827fdea109ff [file] [log] [blame]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Building and Installing the Library</title>
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
<link rel="home" href="../index.html" title="Boost.Regex 5.0.1">
<link rel="up" href="../index.html" title="Boost.Regex 5.0.1">
<link rel="prev" href="configuration/tuning.html" title="Algorithm Tuning">
<link rel="next" href="introduction_and_overview.html" title="Introduction and Overview">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
<td align="center"><a href="../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<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>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="boost_regex.install"></a><a class="link" href="install.html" title="Building and Installing the Library">Building and Installing the Library</a>
</h2></div></div></div>
<p>
When you extract the library from its zip file, you must preserve its internal
directory structure (for example by using the -d option when extracting). If
you didn't do that when extracting, then you'd better stop reading this, delete
the files you just extracted, and try again!
</p>
<p>
This library should not need configuring before use; most popular compilers/standard
libraries/platforms are already supported "as is". If you do experience
configuration problems, or just want to test the configuration with your compiler,
then the process is the same as for all of boost; see the <a href="../../../../config/index.html" target="_top">configuration
library documentation</a>.
</p>
<p>
The library will encase all code inside namespace boost.
</p>
<p>
Unlike some other template libraries, this library consists of a mixture of
template code (in the headers) and static code and data (in cpp files). Consequently
it is necessary to build the library's support code into a library or archive
file before you can use it, instructions for specific platforms are as follows:
</p>
<h5>
<a name="boost_regex.install.h0"></a>
<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
with bjam</a>
</h5>
<p>
This is now the preferred method for building and installing this library,
please refer to the <a href="../../../../../more/getting_started.html" target="_top">getting
started guide</a> for more information.
</p>
<h5>
<a name="boost_regex.install.h1"></a>
<span class="phrase"><a name="boost_regex.install.building_with_unicode_and_icu_support"></a></span><a class="link" href="install.html#boost_regex.install.building_with_unicode_and_icu_support">Building
With Unicode and ICU Support</a>
</h5>
<p>
Boost.Regex is now capable of performing a configuration check to test whether
ICU is already installed in your compiler's search paths. When you build you
should see a message like this:
</p>
<pre class="programlisting"><span class="identifier">Performing</span> <span class="identifier">configuration</span> <span class="identifier">checks</span>
<span class="special">-</span> <span class="identifier">has_icu</span> <span class="identifier">builds</span> <span class="special">:</span> <span class="identifier">yes</span>
</pre>
<p>
Which means that ICU has been found, and support for it will be enabled in
the library build.
</p>
<div class="tip"><table border="0" summary="Tip">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="../../../../../doc/src/images/tip.png"></td>
<th align="left">Tip</th>
</tr>
<tr><td align="left" valign="top"><p>
If you don't want the regex library to use ICU then build with the "--disable-icu"
command line option.
</p></td></tr>
</table></div>
<p>
If instead you see:
</p>
<pre class="programlisting"><span class="identifier">Performing</span> <span class="identifier">configuration</span> <span class="identifier">checks</span>
<span class="special">-</span> <span class="identifier">has_icu</span> <span class="identifier">builds</span> <span class="special">:</span> <span class="identifier">no</span>
</pre>
<p>
Then ICU was not found and support for it will not be compiled into the library.
If you think that it should have been found, then you will need to take a look
at the contents of the file <span class="emphasis"><em>boost-root/bin.v2/config.log</em></span>
for the actual error messages obtained when the build carried out the configuration
check. You will then need to fix these errors by ensuring your compiler gets
invoked with the correct options, for example:
</p>
<pre class="programlisting">bjam include=some-include-path --toolset=toolset-name install</pre>
<p>
will add "some-include-path" to your compilers header include path,
or if ICU has been built with non-standard names for it's binaries, then:
</p>
<pre class="programlisting">bjam -sICU_LINK="linker-options-for-icu" --toolset=toolset-name install</pre>
<p>
Will use <span class="emphasis"><em>"linker-options-for-icu"</em></span> when linking
the library rather than the default ICU binary names.
</p>
<p>
You might also need to use the options "cxxflags=-option" and "linkflags=-option"
to set compiler and linker specific options.
</p>
<div class="important"><table border="0" summary="Important">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="../../../../../doc/src/images/important.png"></td>
<th align="left">Important</th>
</tr>
<tr><td align="left" valign="top"><p>
Configuration results are cached - if you try rebuilding with different compiler
options then add an "-a" to the bjam command line to force all
targets to be rebuilt.
</p></td></tr>
</table></div>
<p>
If ICU is not already in your compiler's path, but instead headers, libraries
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>
and <span class="emphasis"><em>path-to-icu/bin</em></span> respectively then you need to set
the environment variable <code class="computeroutput"><span class="identifier">ICU_PATH</span></code>
to point to the root directory of your ICU installation: this typically happens
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
might use:
</p>
<pre class="programlisting">bjam -sICU_PATH=c:\download\icu --toolset=toolset-name install</pre>
<div class="important"><table border="0" summary="Important">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="../../../../../doc/src/images/important.png"></td>
<th align="left">Important</th>
</tr>
<tr><td align="left" valign="top"><p>
ICU is a C++ library just like Boost is, as such your copy of ICU must have
been built with the same C++ compiler (and compiler version) that you are
using to build Boost. Boost.Regex will not work correctly unless you ensure
that this is the case: it is up to you to ensure that the version of ICU
you are using is binary compatible with the toolset you use to build Boost.
</p></td></tr>
</table></div>
<p>
And finally, if you want to build/test with multiple compiler versions, all
with different ICU builds, then the only way to achieve that currently is to
modify your user-config.jam so that each toolset has the necessary compiler/linker
options set so that ICU is found automatically by the configuration step (providing
the ICU binaries use the standard names, all you have to add is the appropriate
header-include and linker-search paths).
</p>
<h5>
<a name="boost_regex.install.h2"></a>
<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
from Source</a>
</h5>
<p>
The Regex library is "just a bunch of source files": nothing special
is required to build them.
</p>
<p>
You can either build the files under boost-path/libs/regex/src/*.cpp as a library,
or add them directly to your project. This is particularly useful if you need
to use specific compiler options not supported by the default Boost build.
</p>
<p>
There are two #defines you should be aware of:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
BOOST_HAS_ICU should be defined if you want ICU support compiled in.
</li>
<li class="listitem">
BOOST_REGEX_DYN_LINK should be defined if you are building a DLL on Windows.
</li>
</ul></div>
<div class="important"><table border="0" summary="Important">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="../../../../../doc/src/images/important.png"></td>
<th align="left">Important</th>
</tr>
<tr><td align="left" valign="top"><p>
The makefiles that were supplied with Boost.Regex are now deprecated and
will be removed in the next release.
</p></td></tr>
</table></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
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>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<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>
</div>
</body>
</html>