• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3  <head>
4    <meta content="text/html; charset=windows-1252" http-equiv="content-type">
5    <title>Installation</title>
6    <link rel="stylesheet" href="../../../boost.css">
7    <link rel="stylesheet" href="theme/iostreams.css">
8  </head>
9  <body>
10    <!-- Begin Banner -->
11    <h1 class="title">Installation</h1>
12    <hr class="banner">
13    <!-- End Banner -->
14    <dl class="page-index">
15      <dt><a href="#overview">Overview</a> </dt>
16      <dt><a href="#ide">Building with an IDE or Makefile</a> </dt>
17      <dt><a href="#boost-build">Building with Boost.Build</a> </dt>
18    </dl>
19    <a name="overview"></a>
20    <h2>Overview</h2>
21    <p> Most of Boost.Iostreams can be used simply by including appropriate
22      headers. This is true, for instance, of all the <a href="quick_reference.html#core">core
23        components</a> � including <a href="guide/generic_streams.html#stream"><code>stream</code></a>,
24      <a href="guide/generic_streams.html#stream_buffer"><code>stream_buffer</code></a>,
25      <a href="classes/filtering_stream.html"><code>filtering_stream</code></a>
26      and <a href="classes/filtering_streambuf.html"><code>filtering_streambuf</code></a>
27      � and of about two thirds of the concrete <a href="quick_reference.html#filters">Filters</a>
28      and <a href="quick_reference.html#devices">Devices</a>. Some components,
29      however, are implemented in <code>.cpp</code> files; in addition, the <a
30        href="classes/regex_filter.html">regular expression filters</a> depend
31      on <a href="../../regex/index.html" target="_top">Boost.Regex</a>, and
32      the compressions filters rely on the third-party libraries zlib (<a class="bib_ref"
33        name="gailly" href="bibliography.html#gailly">[Gailly]</a>),
34      libbz2 (<a class="bib_ref" name="seward" href="bibliography.html#seward">[Seward]</a>),
35      libzstd (<a class="bib_ref" name="seward" href="bibliography.html#Zstandard">[Zstandard]</a>),
36      and liblzma (<a class="bib_ref" name="collin" href="bibliography.html#collin">[Collin]</a>).
37      Note that liblzma refers to the version from xz-utils which is the version available in
38      for example Linux distributions, not the liblzma from the LZMA SDK from 7zip.
39      To obatin zlib and libbz2, see the instructions <a href="classes/zlib.html#installation">here</a>
40      and <a href="classes/bzip2.html#installation">here</a>. </p>
41    <p> The components which are implemented in <code>.cpp</code> or which rely
42      on external libraries can be built in two ways: by adding the appropriate
43      <code>.cpp</code> files to your IDE project or makefile, or by using <a href="../../../tools/build/index.html"
44        target="_top">Boost.Build</a>. </p>
45    <a name="ide"></a>
46    <h2>Building with an IDE or Makefile</h2>
47    <p> The following table shows which headers contain components defined in <code>.cpp</code>
48      files. If your application includes one of these headers, you'll need to
49      add the corresponding <code>.cpp</code> files to you IDE project or
50      makefile, and to define the preprocessor symbol <code>BOOST_IOSTREAMS_NO_LIB</code>.
51      In addition, if the <code>.cpp</code> file depends on an external
52      library, you'll have to build it from the source or link to a pre-built
53      binary. </p>
54    <table border="1" cellpadding="5">
55      <tbody>
56        <tr>
57          <th>Header</th>
58          <th>Source File</th>
59          <th width="200">External Library</th>
60        </tr>
61        <tr>
62          <td><a href="../../../boost/iostreams/device/file_descriptor.hpp"><code>boost/iostreams/device/file_descriptor.hpp</code></a></td>
63          <td><a href="../../../libs/iostreams/src/file_descriptor.cpp"><code>file_descriptor.cpp</code></a></td>
64          <td style="padding-left:1.5em">-</td>
65        </tr>
66        <tr>
67          <td><a href="../../../boost/iostreams/device/mapped_file.hpp"><code>boost/iostreams/device/mapped_file.hpp</code></a></td>
68          <td><a href="../../../libs/iostreams/src/mapped_file.cpp"><code>mapped_file.cpp</code></a></td>
69          <td style="padding-left:1.5em">-</td>
70        </tr>
71        <tr>
72          <td><a href="../../../boost/iostreams/filter/bzip2.hpp"><code>boost/iostreams/filter/bzip2.hpp</code></a></td>
73          <td><a href="../../../libs/iostreams/src/bzip2.cpp"><code>bzip2.cpp</code></a></td>
74          <td style="padding-left:1.5em">libbz2</td>
75        </tr>
76        <tr>
77          <td><a href="../../../boost/iostreams/filter/gzip.hpp"><code>boost/iostreams/filter/gzip.hpp</code></a></td>
78          <td><a href="../../../libs/iostreams/src/gzip.cpp"><code>gzip.cpp</code></a>,
79            <a href="../../../libs/iostreams/src/zlib.cpp"><code>zlib.cpp</code></a></td>
80          <td style="padding-left:1.5em">zlib</td>
81        </tr>
82        <tr>
83          <td><a href="../../../boost/iostreams/filter/regex.hpp"><code>boost/iostreams/filter/regex.hpp</code></a></td>
84          <td style="padding-left:1em">-</td>
85          <td style="padding-left:1.5em"><a href="../../regex/index.html" target="_top">Boost.Regex</a></td>
86        </tr>
87        <tr>
88          <td><a href="../../../boost/iostreams/filter/zlib.hpp"><code>boost/iostreams/filter/zlib.hpp</code></a></td>
89          <td><a href="../../../libs/iostreams/src/zlib.cpp"><code>zlib.cpp</code></a></td>
90          <td style="padding-left:1.5em">zlib</td>
91        </tr>
92        <tr>
93          <td><a href="../../../boost/iostreams/filter/lzma.hpp"><code>boost/iostreams/filter/lzma.hpp</code></a></td>
94          <td><a href="../../../libs/iostreams/src/lzma.cpp"><code>lzma.cpp</code></a></td>
95          <td style="padding-left:1.5em">liblzma</td>
96        </tr>
97        <tr>
98          <td><a href="../../../boost/iostreams/filter/zstd.hpp"><code>boost/iostreams/filter/zstd.hpp</code></a></td>
99          <td><a href="../../../libs/iostreams/src/zstd.cpp"><code>zstd.cpp</code></a></td>
100          <td style="padding-left:1.5em">libzstd</td>
101        </tr>
102      </tbody>
103    </table>
104    <a name="bjam"></a>
105    <h2 id="boost-build">Building with Boost.Build</h2>
106    <p> To build with <a href="../../../tools/build/index.html" target="_top">Boost.Build</a>,
107      run <i>b2</i> from the directory <code>libs/iostreams/build</code>, or
108      from the Boost root directory. </p>
109    <p>If you want to use the compression filters when building iostreams, you
110      have two choices. You can setup the zlib, bzip2, zstd and/or LZMA toolsets in Boost
111      Build in a jamfile, preferably user-config.jam, as documented in <a target="_top"
112        href="../../../tools/build/doc/html/bbv2/reference/tools.html#bbv2.reference.tools.libraries.zlib">Boost.Build</a>.
113      Note that building from source is not supported for LZMA.
114      Alternatively you can let iostreams setup the zlib, bzip2, zstd and/or LZMA toolsets
115      for you using default values. The former is preferred, especially if your
116      zlib and/or bzip2 installations cannot be found by the iostreams setup.</p>
117    <p> On most UNIX systems, it should not be necessary to setup the zlib,
118      bzip2, zstd and/or lzma toolsets since the zlib, libbz2, libzstd and liblzma headers and binaries are
119      already installed in locations where they will be found automatically.  On
120      Windows the zlib, bzip2, zstd and/or LZMA binaries need to be in the PATH, else they
121      will not ordinarily be found by default, so it is always a good idea under
122      Windows to setup the zlib, bzip2, zstd and/or LZMA toolsets in your own jamfile.</p>
123    <p>You can turn off compression filters when building iostreams by passing
124      one of the <a target="_top" href="../../../tools/build/doc/html/bbv2/overview/invocation.html#bbv2.overview.invocation.options">Boost
125        Build variables</a> in the table below, defined to 1, using the -s
126      option:</p>
127    <table style="margin-bottom:1em" border="1" cellpadding="6" cellspacing="1">
128      <tbody>
129        <tr>
130          <th>Variable</th>
131          <th>Interpretation</th>
132        </tr>
133        <tr>
134          <td><code>NO_COMPRESSION</code></td>
135          <td> Disable support for compression filters. </td>
136        </tr>
137        <tr>
138          <td><code>NO_BZIP2</code></td>
139          <td> Disable support for the bzip2 filters. </td>
140        </tr>
141        <tr>
142          <td><code>NO_ZLIB</code></td>
143          <td> Disable support for the zlib filters. </td>
144        </tr>
145        <tr>
146          <td><code>NO_LZMA</code></td>
147          <td> Disable support for the LZMA/xz filters. </td>
148        </tr>
149        <tr>
150          <td><code>NO_ZSTD</code></td>
151          <td> Disable support for the zstd filters. </td>
152        </tr>
153      </tbody>
154    </table>
155    <!-- End Footnotes -->
156    <!-- Begin Footer -->
157    <hr>
158    <p class="copyright">� Copyright 2008 <a href="http://www.coderage.com/" target="_top">CodeRage,
159        LLC</a><br>
160      � Copyright 2004-2007 <a href="https://www.boost.org/users/people/jonathan_turkanis.html" target="_top">Jonathan
161        Turkanis</a></p>
162    <p class="copyright"> Distributed under the Boost Software License, Version
163      1.0. (See accompanying file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>)
164    </p>
165    <!-- End Footer -->
166  </body>
167</html>
168