Boost libraries - build only what I need
In step 5.2.4 of Getting Started you can instruct b2
which libraries to build:
./b2 --with-program_options --with-filesystem --with-system
Alternatively, use ./b2 --show-libraries
to see a list of all libraries that are not header-only.
Following is an excerpt from the page:
In particular, to limit the amount of time spent building, you may be interested in:
- reviewing the list of library names with
--show-libraries
- limiting which libraries get built with the
--with-<library-name>
or--without-<library-name>
options- choosing a specific build variant by adding release or debug to the command line.
Note: b2
command depends upon boost version so use following commands as per your boost version(Also, in this case use --with-libraries=<comma-seperated-library-names>
version instead of --with-<library-name>
):
-
./configure
for1.38.0
and earlier -
./bootstrap.sh
for1.39.0
onwards till1.46.0
These answers didn't work for me. On Windows, this worked for me:
b2.exe -with-LIBRARY
For example,
b2.exe -with-test
The BCP utility is a tool for extracting subsets of Boost. It's useful for Boost authors who want to distribute their library separately from Boost, and for Boost users who want to distribute a subset of Boost with their application.
The current version of Boost (1.50.0) uses Boost.Build. The new workflow for building BCP is as follows:
From the root Boost directory, type:
bootstrap.bat
Then, once Boost.Build has been built, type:
b2 tools/bcp
To extract, for example interprocess
only, you could use:
$ mkdir /tmp/interprocess #bcp needs this
$ bcp interprocess /tmp/interprocess
This copies interprocess and its dependencies to /tmp/interprocess
.