is is possible to downsize the boost installation folder

im building boost 1.87 and i only need thread+asio building: cd /home/test wget https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.bz2 tar -xf boost_1_87_0.tar.bz2 cd boost_1_87_0 ./bootstrap.sh --prefix=/home/test/boost_1_87_0_installed ./b2 variant=release --with-thread install the resulting install folder /home/test/boost_1_87_0_installed lib folder is ~500 KB include is ~142 MB is it possible to only have the needed library includes in the include folder?

On Apr 10, 2025, at 10:27 AM, Dennis Luehring via Boost <boost@lists.boost.org> wrote:
im building boost 1.87 and i only need thread+asio
building:
cd /home/test wget https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.bz2 tar -xf boost_1_87_0.tar.bz2 cd boost_1_87_0 ./bootstrap.sh --prefix=/home/test/boost_1_87_0_installed ./b2 variant=release --with-thread install
the resulting install folder
/home/test/boost_1_87_0_installed lib folder is ~500 KB include is ~142 MB
is it possible to only have the needed library includes in the include folder?
Have you looked at `bcp` ? https://www.boost.org/doc/libs/1_87_0/tools/bcp/doc/html/index.html — Marshall

On Thu, Apr 10, 2025 at 10:27 AM Dennis Luehring via Boost < boost@lists.boost.org> wrote:
im building boost 1.87 and i only need thread+asio
building:
cd /home/test wget https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.bz2 tar -xf boost_1_87_0.tar.bz2 cd boost_1_87_0 ./bootstrap.sh --prefix=/home/test/boost_1_87_0_installed ./b2 variant=release --with-thread install
the resulting install folder
/home/test/boost_1_87_0_installed lib folder is ~500 KB include is ~142 MB
is it possible to only have the needed library includes in the include folder?
One thing is to use vcpkg and just depend on boost-thread and boost-asio. This will automatically do all the dependency resolution for you. The other is to use the CMake build and do something like this: cd boost-root mkdir _build cd _build cmake .. -DCMAKE_INSTALL_PREFIX=_install -DBOOST_INCLUDE_LIBRARIES="thread;asio" cmake --build . --target install -j12 Note: you're still going to be installing a good amount of libraries here but this at least gives you the most minimal install possible. - Christian

Am 10.04.2025 um 20:06 schrieb Christian Mazakas via Boost:
The other is to use the CMake build and do something like this:
cd boost-root mkdir _build cd _build cmake .. -DCMAKE_INSTALL_PREFIX=_install -DBOOST_INCLUDE_LIBRARIES="thread;asio" cmake --build . --target install -j12
i tried that git clone --recursive https://github.com/boostorg/boost.git git_boost cd git_boost mkdir _build cd _build cmake .. -DCMAKE_INSTALL_PREFIX=_install -DBOOST_INCLUDE_LIBRARIES="thread;asio" cmake --build . --target install -j16 got me 49MB and 5000 files - still big but better then my tests before
participants (3)
-
Christian Mazakas
-
Dennis Luehring
-
Marshall Clow