Trying to build Boost: I cannot get bjam

19,261

Solution 1

There is a bootstrap.bat in your boost directory. Run it.

It will build bjam automatically (probably using visual c++).

Solution 2

The directory structure in boost has changed in recent version, I think.

The sources for bjam are in tools/build/v2/engine. Run build.sh mingw from that directory using MinGW shell, and it should build bjam.exe and b2.exe and place them in tools/build/v2/engine/ntx86. Copy b2.exe to the boost root directory. You should then be able to build Visual c++ libraries with b2 toolset=msvc.

Hope that helps.

Share:
19,261
Pietro M
Author by

Pietro M

Updated on July 28, 2022

Comments

  • Pietro M
    Pietro M almost 2 years

    I would like to build boost using two different compilers, MinGW and Visual C++ 2010 Express, using bjam:

    bjam toolset=gcc,msvc variant=release link=static,shared threading=multi install
    

    The problem is that I do not have bjam. I could not find it in the Boost directory, and the one I downloaded from somewhere else was a wrong version.

    I should be able to build it from the code in Boost, but how? I read that I must launch build.bat from the BOOST_ROOT/tools/jam/src directory, but that directory does not exist !

    Thank you!


    • Platform: Windows7
    • Compilers: MinGW and Visual C++ 2010 Express

    Update:

    I have been able to get bjam with: bootstrap.bat gcc
    Then, launching bjam with the previous parameters, I only get libraries for MinGW (.dll and .a).
    This is an extract of the error messages I get with regard to Visual C++ 10:

    ...
        call "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86 >nul
    cl /Zm800 -nologo @"bin.v2\libs\test\build\msvc-10.0\release\asynch-exceptions-on\threading-multi\plain_report_formatter.obj.rsp"
    ...failed compile-c-c++ bin.v2\libs\test\build\msvc-10.0\release\asynch-exceptions-on\threading-multi\plain_report_formatter.obj...
    ...
    ...skipped <pbin.v2\libs\test\build\msvc-10.0\release\asynch-exceptions-on\threading-multi>boost_unit_test_framework-vc100-mt-1_48.dll for lack of <pbin.v2\libs\test\build\msvc-10.0\release\asynch-exceptions-on\threading-multi>compiler_log_formatter.obj...
    ...
    common.mkdir bin.v2\libs\thread\build\msvc-10.0\release\threading-multi
    common.mkdir bin.v2\libs\thread\build\msvc-10.0\release\threading-multi\win32
    compile-c-c++ bin.v2\libs\thread\build\msvc-10.0\release\threading-multi\win32\thread.obj
    \Microsoft was unexpected at this time.
    ...
        call "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86 >nul
    cl /Zm800 -nologo @"bin.v2\libs\thread\build\msvc-10.0\release\threading-multi\win32\thread.obj.rsp"
    
    ...failed compile-c-c++ bin.v2\libs\thread\build\msvc-10.0\release\threading-multi\win32\thread.obj...
    compile-c-c++ bin.v2\libs\thread\build\msvc-10.0\release\threading-multi\win32\tss_dll.obj
    \Microsoft was unexpected at this time.
    ...
    ...skipped <pC:\Boost\lib>boost_thread-vc100-mt-1_48.lib for lack of <pbin.v2\libs\thread\build\msvc-10.0\release\threading-multi>boost_thread-vc100-mt-1_48.lib
    ...
    

    Trying to use:
    bootstrap.bat vc100
    I get the error: "Unknown toolset: vc100"

    With either:
    bootstrap.bat vc10
    or:
    bootstrap.bat mingw
    I get: "\Microsoft was unexpected at this time."

    Changing project-config.jam did not help.

    So, I did a big step forward, but vc10 is not working, yet...

  • Pietro M
    Pietro M over 12 years
    This is what I get (running from Visual C++ prompt): Building Boost.Build engine \Microsoft was unexpected at this time.
  • Pietro M
    Pietro M over 12 years
    I want boost to be available to both MinGW and Visual C++ 2010 Express, but I do not care what I use to actually build Boost.
  • reder
    reder over 12 years
    3 solutions: 1° try running "tools->visual studio command prompt" from visual IDE, then try bootstrap.bat again from console 2° type boostrap.bat gcc. If mingw is in c:\mingw it should work 3° run bootstrap.sh from cygwin (it does not work from mingw-msys)
  • Pietro M
    Pietro M over 12 years
    The second solution works the best, but I still do not get libraries for Visual C++. I am afraid Cygwin is not an option. I updated my question.
  • reder
    reder over 12 years
    Which version of boost do you use ? Try at least 1.47 or 1.48. If all else fails, consider download precompiled libraries from boostpro.