Build Boost 1.39 for 64-bit Windows

Building Boost for 64-bit Windows turns out not to be completely straightforward. These instructions assume you’re using Visual Studio 2008 and running from a VS 2008 x64 Command Prompt.

First, running bootstrap.bat appears to fail:

Building Boost.Jam build engine

Failed to build Boost.Jam build engine.
Please consult bjam.log for furter diagnostics.

You can try to obtain a prebuilt binary from

http://sf.net/project/showfiles.php?group_id=7586&package_id=72941

Also, you can file an issue at http://svn.boost.org
Please attach bjam.log in that case.

Actually, it’s not failing to build, it’s just trying to copy the executable from the wrong path. All you need to do is copy tools\jam\src\bin.ntx86_64\bjam.exe to the top-level Boost directory.

Next, you need to install any of the optional libraries you want to support. For Python support, you can install the Windows AMD64 MSI Installer, and then add the install directory (C:\Python26 by default) to your PATH. For Graphviz parsing support, download and unzip Expat 2.0.1 and my VS 2008 x64 project files, then use Batch Build in VS 2008 to build the x64 targets. You’ll also need to rename the Expat library reference in Boost’s libs\graph\build\Jamfile.v2 from “expat” to “libexpat”.

Finally, run the following commands to build Debug and Release DLLs, setting the Expat paths appropriately and the -j option to the number of processor cores you have:

set EXPAT_INCLUDE=C:\expat-2.0.1\lib

set EXPAT_LIBPATH=C:\expat-2.0.1\win64\bin\Debug
bjam -j3 --stagedir=stage64 --without-mpi toolset=msvc address-model=64 variant=debug link=shared threading=multi runtime-link=shared stage > build-shared-multi-debug64.log

set EXPAT_LIBPATH=C:\expat-2.0.1\win64\bin\Release
bjam -j3 --stagedir=stage64 --without-mpi toolset=msvc address-model=64 variant=release link=shared threading=multi runtime-link=shared stage > build-shared-multi-release64.log

With any luck, in about 5-15 minutes, you’ll have a set of DLLs and import libraries in stage64/lib. The build generates lots of output and warnings, which is the reason for redirecting the output to a file, but you’ll want to check the beginning and end of each log to make sure it built everything you expected.

One Comment

  1. Thanks for this post! You helped me build Boost. I don’t suppose you tried using the Boost MPI library? When I build it for 32-bit Windows it works fine, but the 64-bit library seems to be missing 5 functions. Oh, well. Solve one problem, hit another.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.