Can anyone explain why following these instructions:
http://www.boost.org/doc/libs/1_59_0/more/getting_started/unix-variants.html#easy-build-and-install
... it takes my decent machine 5 hours to build all of Boost, while some folks report doing the same in only 3 minutes ?
Is there another way to build Boost than the one mentioned above that indeed goes pretty quickly (compared to several hours, at any rate).
I am using the Clang compiler on Darwin (Mac) option. Not sure how relevant it is but I have 16 GB RAM and a recent SSD. The clock is 2.3 Ghz.
Edit: I'm happy to report, based on the comments and answers, that using the ./b2 -j4 -d0
options, I got my compilation time down to 13 minutes. Also the -jN
option is not listed in the set of available options with the default --help
, you must instead call --help-options
to see these additional more "advanced" techniques.
Building the library and tests adds between 80 and 140 MB of object files and executables to this. On a Pentium III laptop, building the Boost library takes 15 minutes and building and running the regression tests takes an additional 5 minutes.
Most Boost libraries are header-only: they consist entirely of header files containing templates and inline functions, and require no separately-compiled library binaries or special treatment when linking.
Tap the Cash Card tab on your home screen. Press Save with Boost. Tap on a Boost. Tap Add Boost.
Boost Process is header-only, so you don't have to compile it separately.
I just ran a few tests with a few different build configs.
Hardware: 2012 MacBook Pro (2.3Ghz Ivy Bridge i7 [i7-3615QM]), factory SSD and 16GB of ram.
Software: Mac OS X 10.11.1 with Xcode 7 (Apple LLVM version 7.0.0 clang-700.1.76). Fresh copy of Boost 1.59.0 from the website.
I tested the following build commands:
Default Build:
./bootstrap.sh && ./b2 -j N
Build forcing the linking of libc++
./bootstrap.sh && ./b2 toolset=clang cxxflags="-stdlib=libc++" linkflags="-stdlib=libc++" -j N
For each I tried three different values for N: 1 (single thread), 4 (matching physical cores), and 8 (matching hyperthreaded cores).
Default linking:
Linking libc++:
Conclusion: Boost shouldn't have to take all day to build on a multi-core system with an SSD even if it isn't brand new. Building with the default (singled thread) does take way longer than a parallel build. The Boost build with clang on OS X does benefit slightly from hyperthreading. Linking with libc++ seems a bit faster as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With