Issue
With the abundance of Boost libraries available, it appears to be excessive to install all of them when only a few are needed, given that the total size is more than 750 MB unpacked. Is there a way to select and install a specific library instead ?
I couldn't find anything on boost documentation, except the bcp utility which assumes that boost is installed.
Solution
Libraries are packaged separately for Debian, Ubuntu, Arch, Conan, CMake, etc.
E.g. Doing apt-cache search
reveals:
libboost-filesystem-dev - filesystem operations (portable paths, iteration over directories, etc) in C++ (default version)
libboost-program-options-dev - program options library for C++ (default version)
libboost-regex-dev - regular expression library for C++ (default version)
libboost-system-dev - Operating system (e.g. diagnostics support) library (default version)
libboost-thread-dev - portable C++ multi-threading (default version)
libboost-all-dev - Boost C++ Libraries development files (ALL) (default version)
libboost-atomic-dev - atomic data types, operations, and memory ordering constraints (default version)
libboost-chrono-dev - C++ representation of time duration, time point, and clocks (default version)
libboost-container-dev - C++ library that implements several well-known containers - dev files (default version)
libboost-context-dev - provides a sort of cooperative multitasking on a single thread (default version)
libboost-contract-dev - Contract library for C++ - dev files (default version)
libboost-coroutine-dev - provides a sort of cooperative multitasking on a single thread (default version)
libboost-date-time-dev - set of date-time libraries based on generic programming concepts (default version)
libboost-exception-dev - library to help write exceptions and handlers (default version)
libboost-fiber-dev - cooperatively-scheduled micro-/userland-threads (default version)
libboost-graph-dev - generic graph components and algorithms in C++ (default version)
libboost-graph-parallel-dev - generic graph components and algorithms in C++ (default version)
libboost-iostreams-dev - Boost.Iostreams Library development files (default version)
libboost-locale-dev - C++ facilities for localization (default version)
libboost-log-dev - C++ logging library (default version)
libboost-math-dev - Boost.Math Library development files (default version)
libboost-mpi-dev - C++ interface to the Message Passing Interface (MPI) (default version)
libboost-mpi-python-dev - C++ interface to the Message Passing Interface (MPI), Python Bindings (default version)
libboost-nowide-dev - Standard library functions with UTF-8 API on Windows development files (default version)
libboost-numpy-dev - Boost.Python NumPy extensions development files (default version)
libboost-python-dev - Boost.Python Library development files (default version)
libboost-random-dev - Boost Random Number Library (default version)
libboost-serialization-dev - serialization library for C++ (default version)
libboost-stacktrace-dev - library to capture and print stack traces - development files (default version)
libboost-test-dev - components for writing and executing test suites (default version)
libboost-timer-dev - C++ wall clock and CPU process timers (default version)
libboost-tools-dev - Boost C++ Libraries development tools (default version)
libboost-type-erasure-dev - C++ runtime polymorphism based on concepts (default version)
libboost-wave-dev - C99/C++ preprocessor library (default version)
Of course there will be interdependencies. E.g.
apt-cache depends libboost-filesystem1.74-dev
shows it depends on Boost System. Note it also depends on libstdc++
(transitively) via libboostx.yy-dev
, which also suggests other boost libs, but none required.
BCP is a tool exclusively aimed at reducing the collected boost headers which in practice rarely has any use, because the headers themselves aren't as big and historically can not easily be omitted. Although over the years Boost is succeeding at reducing unnecessary inter-library dependencies, so you may find that it has more effect these days for your specific subset of libraries.
Answered By - sehe Answer Checked By - Marie Seifert (WPSolving Admin)