Skip to content

HOWTO:BuildStaticBinaries

Michael Cahill edited this page Aug 3, 2016 · 6 revisions

Building a statically linked version of the wt command line utility can be a little tricky.

First you must confirm that you have statically linked versions of all the requisite included libraries available, this includes

  • libdl
  • librt
  • libpthread

And any of the optionally included compression libraries such as:

  • libsnappy
  • zlib
  • liblz4

Once you have confirmed that you have all the requisite libs available either in your path or with directories supplied you can run the following command (with any other config options added):

../configure --disable-shared --with-builtins=snappy,zlib --enable-verbose
make -j8
rm -f wt
make CC='eval "g++ -static"'

This will build a static libwiredtiger.a and a statically linked version of the wt utility. You can expect to see warnings about issues statically linking against dlopen, but this is a non-issue as long as included compression libs are specified using --with-builtins rather than being individually enabled.