An update on building Boost with MSVC (still with dual/quad/multi-core action)

— richardwb on Thursday, November 19, 2009 @ 02:05

I've noticed that in recent versions of Boost (1.39.0 and newer) there is a way to do a "Simplified Build from Source" if you're using Microsoft Visual Studio. Here are the steps as I like to write them:

  1. Download the latest version of Boost and extract it to some location (we'll assume D:\Boost\), making sure to maintain the directory structure.

  2. In a command prompt, navigate to your Boost library folder (D:\Boost\boost_1_41_0\) and then use this command, which builds your very own copy of Boost Jam (a build system):

    > bootstrap
    
  3. Now, in the same command prompt, enter this command, where N is the number of processors/cores you have available for compiling (for example, -j4 if you have a quad-core processor):

    > bjam.exe -jN
    
  4. Wait.

  5. After the build completes you will have a stage subdirectory (D:\Boost\boost_1_41_0\stage\) which will contain a lib subdirectory, containing the compiled libraries.

This simplified process removes the need to get a copy of Boost Jam, which, as trivial as it sounds, really does make a big difference to the friendliness of the entire procedure. It also reduces the number of necessary arguments to zero (or one, if you consider multi-core a necessity), although there are some situations where you may still need the older arguments (in which case I refer you to my previous entry on the subject).

comments powered by Disqus