Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

b2 vs bjam for building Boost library

I built Boost for VS2013, 64-bit architecture using both b2.exe and bjam.exe. According to Boost documentation, b2 must be used over bjam. The differences I notice are:

  1. The size of .lib files from b2 differs from that of the respective bjam file.
  2. Using bjam provides dynamic .lib libraries (without -s tag as mentioned here), but it doesn't provide the .dll files to link to (so what to do now?), whereas using b2 gives both static and dynamic libraries along with the .dll files. But the problem using b2 is, it gives two dynamic .lib files - one starts with boost_xxxx.lib and other with libboost_xxxx.lib and both are of different sizes. Why is that?

Also I mentioned different build directory using the build option --build-dir, but what is the use of this directory? It consists of .obj, .rsp along with respective .dll and .lib files. Can this directory be deleted?

Here are the commands I used to build Boost:

  1. b2:

    b2 toolset=msvc-12.0 --build-type=complete architecture=x86 address-model=32 install --build-dir=<build-dir> stage --stagedir=<stage-dir> -j2
    
  2. bjam:

    bjam stage --stagedir=<stage-dir>
    
like image 759
Aniruth Avatar asked Jul 10 '15 22:07

Aniruth


People also ask

What is b2 in Boost?

Build, b2 , bjam and Perforce Jam? Boost. Build is the name of the complete build system. The executable that runs it is b2 . That executable is written in C and implements performance-critical algorithms, like traversal of dependency graph and executing commands.

Can I build Boost with CMake?

However, this Infrastructure does setup more granular targets (like Boost::signals2 instead of Boost::headers ) and provide the ability to build compile-necessary targets too (like filesystem). That infrastructure does warn in their README that building Boost with CMake does not work yet and is not supported .


1 Answers

b2 and bjam are identical files except for their names. The different results are a consequence of calling them with different arguments.

About the preferred name: calling ./b2 --help and ./bjam --help both yield the name b2.

like image 64
yeoman Avatar answered Oct 23 '22 21:10

yeoman