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