Trying to build Boost: I cannot get bjam
Asked Answered
D

3

10

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...

Drawer answered 30/11, 2011 at 17:30 Comment(0)
A
5

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

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

Ahithophel answered 30/11, 2011 at 17:34 Comment(5)
This is what I get (running from Visual C++ prompt): Building Boost.Build engine \Microsoft was unexpected at this time.Drawer
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.Drawer
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)Ahithophel
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.Drawer
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.Ahithophel
C
4

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.

Cooee answered 6/12, 2011 at 13:41 Comment(0)
S
0

In my case, the solution from jork works!

I searched the bjam.exe file and found it located in the tools/build/src/engine directory and just copied it to the boost root directory. But I have to say this is awful, I felt like the codebase writer is trying to hide sth. And I found that my bjam.exe is exactly is the same size with b2.exe, which is 404KB.

I will turn back later to ensure that I solved this issue.

Smythe answered 29/9, 2021 at 11:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.