summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/docs/build-posix.dox
blob: 3e7f8f37acd456644a3a56cda885709bee97e4fd (plain)
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
/*! @page build-posix Building and installing WiredTiger on POSIX

@section posix_github Building using Git and GitHub

Skip this step if you are building from a WiredTiger release package,
and proceed with @ref posix_building.

To build from the WiredTiger GitHub repository requires
<a href="http://git-scm.com/">git</a>,
<a href="http://www.gnu.org/software/autoconf/autoconf.html">autoconf</a>,
<a href="http://www.gnu.org/software/autoconf/automake.html">automake</a>,
<a href="http://www.gnu.org/software/libtool/libtool.html">libtool</a> and
related tools.  The standard options for those tools can be specified
when configuring and building WiredTiger.

First, clone the repository:

@code
git clone git://github.com/wiredtiger/wiredtiger.git
@endcode

Second, run \c autogen.sh to create the \c configure script:

@code
cd wiredtiger
sh autogen.sh
@endcode

Now proceed with @ref posix_building.

@section posix_building Building WiredTiger

To build the WiredTiger software on a POSIX system, change directory to
the top-level directory, then configure and build the software:

@code
cd wiredtiger
./configure && make
@endcode

To rebuild from scratch, discard any previous configuration by cleaning
out the build area:

@code
make distclean
@endcode

To see additional configuration options, run:

@code
./configure --help
@endcode

WiredTiger uses
<a href="http://www.gnu.org/software/autoconf/autoconf.html">autoconf</a>
<a href="http://www.gnu.org/software/autoconf/automake.html">automake</a>,
and <a href="http://www.gnu.org/software/libtool/libtool.html">libtool</a>
to create the configure script and Makefiles.  The standard options for those
tools can be specified when configuring and building WiredTiger.

@section posix_installing Installing WiredTiger

The WiredTiger software consists of a library and a single standalone
utility.

WiredTiger's distribution follows the GNU Coding Standards installation
guidelines, and by default WiredTiger builds and installs four versions
of the library in <code>/usr/local/lib</code>.  For example:

@code
file /usr/local/lib/libwiredtiger*
/usr/local/lib/libwiredtiger-1.0.0.so: ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, not stripped
/usr/local/lib/libwiredtiger.a:        current ar archive
/usr/local/lib/libwiredtiger.la:       libtool library file
/usr/local/lib/libwiredtiger.so:       symbolic link to `libwiredtiger-1.0.0.so'
@endcode

WiredTiger uses
<a href="http://www.gnu.org/software/libtool/libtool.html">libtool</a> to
build the libraries.  By default, both shared and static libraries are built.
To build only static libraries, configure WiredTiger using the
\c --disable-shared argument. To build only shared libraries, configure using
WiredTiger using the \c --disable-static argument.

In addition, WiredTiger installs a standalone utility program named
<code>wt</code>.  By default, this utility is installed in
<code>/usr/local/bin/wt</code>.

To install WiredTiger:

@code
make install
@endcode

To uninstall WiredTiger:

@code
make uninstall
@endcode

To install WiredTiger's libraries or binaries into alternate locations,
use the configuration or installation options described in the
<a href="http://www.gnu.org/prep/standards/">GNU coding standards</a>
documentation.  For example, to install the libraries and binaries into
a different location:

@code
./configure --prefix=/c/wiredtiger
@endcode

@section posix_configure Configuring WiredTiger

The WiredTiger software supports some additional configuration options:

@par \c --enable-attach
Configure WiredTiger to sleep and wait for a debugger to attach on failure.
<b>DO NOT</b> configure this option in production environments.

@par \c --enable-diagnostic
Configure WiredTiger to perform various run-time diagnostic tests.
<b>DO NOT</b> configure this option in production environments.

@par \c --enable-java
Build the WiredTiger Java API.

@par \c --enable-leveldb[=basho, hyper, rocksdb]
Include a Google, Inc. compatible LevelDB API. Optionally, specify \c basho
to build a version of the LevelDB API compatible with Basho's Riak
product, specify \c hyper to build a version of the LevelDB API compatible
with the HyperDex product, and specify \c rocksdb to build a version of the
LevelDB API compatible with applications using Facebook's RocksDB
engine. See @ref leveldb for more information.

@par \c --enable-lz4
Configure WiredTiger for <a href="https://github.com/Cyan4973/lz4">LZ4</a>
compression; see @ref compression for more information.

@par \c --enable-python
Build the WiredTiger <a href="http://www.python.org">Python</a> API.

@par \c --enable-snappy
Configure WiredTiger for <a href="http://code.google.com/p/snappy/">snappy</a>
compression; see @ref compression for more information.

@par \c --enable-verbose
Configure WiredTiger to support the \c verbose configuration string to
::wiredtiger_open.

@par \c --enable-zlib
Configure WiredTiger for <a href="http://www.zlib.net/">zlib</a>
compression; see @ref compression for more information.

@par \c --enable-zstd
Configure WiredTiger for <a href="https://github.com/facebook/zstd">Zstd</a>
compression; see @ref compression for more information.

@par <code>--with-builtins</code>
Configure WiredTiger to include support for extensions in the main library.
This avoids requiring additional libraries for supported extensions. Currently
supported options are \c lz4, \c snappy, \c zlib and \c zstd.

@par <code>--with-python-prefix</code>
Configure WiredTiger to install Python libraries to a non-standard Python
install location.

@par <code>--with-spinlock[=pthread, pthread_adaptive, gcc]</code>
Configure WiredTiger to use a specific mutex type for serialization;
options are \c pthread (the default, which configures WiredTiger to use
POSIX 1003.1c pthread mutexes), \c pthread_adaptive (which configures
WiredTiger to use POSIX 1003.1c pthread mutexes configured to be
adaptive (where that functionality is available), or \c gcc (which
configures WiredTiger to use gcc-based spinlocks).

@section posix_compiler Changing compiler or loader options

To change the compiler or loader behavior during the build, use the
<code>CC</code>, <code>CFLAGS</code>, <code>LDFLAGS</code>, or
<code>LIBS</code> environment variables:

@par \c CC
The compiler.
@par \c CFLAGS
Compiler flags.
@par \c LDFLAGS
Loader flags.
@par \c LIBS
Additional libraries.

For example, to specify a different compiler:

@code
env CC=mygcc ./configure
@endcode

By default, WiredTiger builds with the \c -O3 compiler optimization flag
unless the \c --enable-debug configuration option is specified, in which
case the \c -g compiler flag is used instead.  For example, to specify
a different level of optimization:

@code
env CFLAGS=-Os ./configure
@endcode

To specify a different set of include files:

@code
env CFLAGS=-I/usr/local/include ./configure
@endcode

To specify an additional library:

@code
env LIBS="-lrtf -lmin" LDFLAGS=-L/usr/local/lib ./configure
@endcode
 */