This blog entry mainly is a placeholder for me to quickly get the command lines for building boost on Windows for various configurations. For me, I’m interested in 32bit and 64bit code in debug and release configurations. For release config I define certain precompiler symbols ( _SECURE_SCL=0 and _HAS_ITERATOR_DEBUGGING=0 ) to generate fast c++ code.

Also, I like to build boost as fast as possible by using the “-j4” ( 4 cores ) option of the bjam tool.

Here we go. Since the command lines are a little long and might be cropped depending on your browser.

debug - 32bit
-------------
bjam -j4 --toolset=msvc --without-mpi variant=debug link=static runtime-link=shared define=_CRT_NONSTDC_NO_DEPRECATE define=_CRT_SECURE_NO_DEPRECATE define=_SCL_SECURE_NO_DEPRECATE stage

release - 32bit
---------------
bjam -j4 --toolset=msvc --without-mpi variant=release link=static runtime-link=shared define=_CRT_NONSTDC_NO_DEPRECATE define=_CRT_SECURE_NO_DEPRECATE define=_SCL_SECURE_NO_DEPRECATE define=_SECURE_SCL=0 define=_HAS_ITERATOR_DEBUGGING=0 stage

debug - 64bit
---------------
bjam -j4 --toolset=msvc --without-mpi variant=debug link=static runtime-link=shared address-model=64 define=_CRT_NONSTDC_NO_DEPRECATE define=_CRT_SECURE_NO_DEPRECATE define=_SCL_SECURE_NO_DEPRECATE stage

release - 64bit
----------------
bjam -j4 --toolset=msvc --without-mpi variant=release link=static runtime-link=shared address-model=64 define=_CRT_NONSTDC_NO_DEPRECATE define=_CRT_SECURE_NO_DEPRECATE define=_SCL_SECURE_NO_DEPRECATE define=_SECURE_SCL=0 define=_HAS_ITERATOR_DEBUGGING=0 stage

The libraries generated are static .lib files which work with Visual Studio’s auto-link feature.

Advertisements