Boost: Bootstrap.bat compilation failure to build bjam

Ababneh A picture Ababneh A · Feb 14, 2013 · Viewed 17k times · Source

I would like to use the Boost Filesystem library. I am using CodeBolcks for development on Windows. I am following the "Getting Started on Windows". http://www.boost.org/doc/libs/1_53_0/more/getting_started/windows.html#install-boost-build. I made the following:

1) I downloaded and extracted boost to: d:\boost_1_53_0

2) I executed this:

D:\boost_1_53_0\tools\build\v2>bootstrap.bat gcc
Bootstrapping the build engine

Failed to bootstrap the build engine
Please consult bootstrap.log for furter diagnostics.

The log file contains:

###
### Using 'gcc' toolset.
###

D:\boost_1_53_0\tools\build\v2\engine>if exist bootstrap rd /S /Q bootstrap 

D:\boost_1_53_0\tools\build\v2\engine>md bootstrap 

D:\boost_1_53_0\tools\build\v2\engine>gcc -DNT -o bootstrap\jam0.exe  command.c compile.c constants.c debug.c execnt.c filent.c function.c glob.c hash.c hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c object.c option.c output.c parse.c pathunix.c regexp.c rules.c scan.c search.c subst.c timestamp.c variable.c modules.c strings.c filesys.c builtins.c md5.c pwd.c class.c w32_getreg.c native.c modules/set.c modules/path.c modules/regex.c modules/property-set.c modules/sequence.c modules/order.c 

D:\boost_1_53_0\tools\build\v2\engine>.\bootstrap\jam0 -f build.jam --toolset=gcc "--toolset-root= "  clean 
...found 1 target...
...updating 1 target...
...updated 1 target...

D:\boost_1_53_0\tools\build\v2\engine>.\bootstrap\jam0 -f build.jam --toolset=gcc "--toolset-root= "  
...found 50 targets...
...updating 2 targets...
[COMPILE] bin.ntx86\b2.exe

"gcc"   -o bin.ntx86\b2.exe "-DNDEBUG" "-DOPT_HEADER_CACHE_EXT" "-DOPT_GRAPH_DEBUG_EXT" "-DOPT_SEMAPHORE" "-DOPT_AT_FILES" "-DOPT_DEBUG_PROFILE" "-DOPT_FIX_TARGET_VARIABLES_EXT" "-DOPT_IMPROVED_PATIENCE_EXT" "-DNT" "-DYYSTACKSIZE=5000" "-pedantic" "-fno-strict-aliasing" "-s" "-O3" "-Wno-long-long" "command.c" "compile.c" "constants.c" "debug.c" "function.c" "glob.c" "hash.c" "hcache.c" "headers.c" "hdrmacro.c" "jam.c" "jambase.c" "jamgram.c" "lists.c" "make.c" "make1.c" "mem.c" "object.c" "option.c" "output.c" "parse.c" "regexp.c" "rules.c" "scan.c" "search.c" "subst.c" "w32_getreg.c" "timestamp.c" "variable.c" "modules.c" "strings.c" "filesys.c" "builtins.c" "pwd.c" "class.c" "native.c" "md5.c" "modules/set.c" "modules/path.c" "modules/regex.c" "modules/property-set.c" "modules/sequence.c" "modules/order.c" "execnt.c" "filent.c" "pathunix.c" 

...failed [COMPILE] bin.ntx86\b2.exe...
...removing bin.ntx86\b2.exe
...skipped bjam.exe for lack of b2.exe...
...failed updating 1 target...
...skipped 1 target...

As we see, the compilation fails. I do not know why. How to successfully install boost libraries?

Note: "gcc --version" returns the version of gcc

Thank you.

EDIT: I managed to create b2.exe, by executing

"gcc"   -o bin.ntx86\b2.exe "-DNDEBUG" "-DOPT_HEADER_CACHE_EXT" "-DOPT_GRAPH_DEBUG_EXT" "-DOPT_SEMAPHORE" "-DOPT_AT_FILES" "-DOPT_DEBUG_PROFILE" "-DOPT_FIX_TARGET_VARIABLES_EXT" "-DOPT_IMPROVED_PATIENCE_EXT" "-DNT" "-DYYSTACKSIZE=5000" "-pedantic" "-fno-strict-aliasing" "-s" "-O3" "-Wno-long-long" "command.c" "compile.c" "constants.c" "debug.c" "function.c" "glob.c" "hash.c" "hcache.c" "headers.c" "hdrmacro.c" "jam.c" "jambase.c" "jamgram.c" "lists.c" "make.c" "make1.c" "mem.c" "object.c" "option.c" "output.c" "parse.c" "regexp.c" "rules.c" "scan.c" "search.c" "subst.c" "w32_getreg.c" "timestamp.c" "variable.c" "modules.c" "strings.c" "filesys.c" "builtins.c" "pwd.c" "class.c" "native.c" "md5.c" "modules/set.c" "modules/path.c" "modules/regex.c" "modules/property-set.c" "modules/sequence.c" "modules/order.c" "execnt.c" "filent.c" "pathunix.c" 

I moved on the next step in the guide. Now, I get an argument error. What do you think?

D:\boost_1_53_0\tools\build\v2\engine\bin.ntx86>b2 --toolset=gcc "--prefix=D:\Program Files\CodeBlocks" install

notice: could not find main target install
notice: assuming it is a name of file to create.
D:/boost_1_53_0/tools/build/v2/build\project.jam:753: in attribute
warning: rulename $($(project).attributes).get expands to empty string
D:/boost_1_53_0/tools/build/v2/build\project.jam:765: in project.target
D:/boost_1_53_0/tools/build/v2\build-system.jam:708: in load
D:\boost_1_53_0\tools\build\v2\kernel\modules.jam:283: in import
D:\boost_1_53_0\tools\build\v2\kernel\bootstrap.jam:142: in boost-build
D:\boost_1_53_0\tools\build\v2\boost-build.jam:8: in module scope
D:/boost_1_53_0/tools/build/v2/build\project.jam:753: in project.attribute
warning: rulename $($(project).attributes).get expands to empty string
D:/boost_1_53_0/tools/build/v2/build\targets.jam:206: in object(project-target)@
45.__init__
D:/boost_1_53_0/tools/build/v2/kernel\class.jam:88: in new
D:/boost_1_53_0/tools/build/v2/build\project.jam:765: in project.target
D:/boost_1_53_0/tools/build/v2\build-system.jam:708: in load
D:\boost_1_53_0\tools\build\v2\kernel\modules.jam:283: in import
D:\boost_1_53_0\tools\build\v2\kernel\bootstrap.jam:142: in boost-build
D:\boost_1_53_0\tools\build\v2\boost-build.jam:8: in module scope
D:/boost_1_53_0/tools/build/v2/build\project.jam:753: in project.attribute
warning: rulename $($(project).attributes).get expands to empty string
D:/boost_1_53_0/tools/build/v2/build\targets.jam:226: in object(project-target)@45.get
D:/boost_1_53_0/tools/build/v2\build-system.jam:721: in load
D:\boost_1_53_0\tools\build\v2\kernel\modules.jam:283: in import
D:\boost_1_53_0\tools\build\v2\kernel\bootstrap.jam:142: in boost-build
D:\boost_1_53_0\tools\build\v2\boost-build.jam:8: in module scope
D:/boost_1_53_0/tools/build/v2\build-system.jam:722: in load
*** argument error
* rule project.load ( jamfile-location )
* called with: (  )
* missing argument jamfile-location
D:/boost_1_53_0/tools/build/v2/build\project.jam:53:see definition of rule 'project.load' being called
D:\boost_1_53_0\tools\build\v2\kernel\modules.jam:283: in import
D:\boost_1_53_0\tools\build\v2\kernel\bootstrap.jam:142: in boost-build
D:\boost_1_53_0\tools\build\v2\boost-build.jam:8: in module scope

Answer

Ababneh A picture Ababneh A · Feb 15, 2013

In order to use Filesystem, I used another computer, and performed the following steps, and it worked:

1) Installed MinGW and added this enviroment variable => C:\MinGW\bin
2) Expanded boost_1_53_0 to c:\
3) cd c:\boost_1_53_0\tools\build\v2
4) bootstrap.bat gcc
5) b2 install --prefix="C:\Boostbuild" --toolset=gcc
6) Added this enviroment variable => C:\Boostbuild\bin
7) cd c:\boost_1_53_0
8) b2 --build-dir="C:\Boostbuild" toolset=gcc --build-type=complete stage
9) Installed CodeBlocks without MinGW
CodeBlocks:
10) Settings->Global variables: current variable => boost, Base => C:\boost_1_53_0, include => C:\boost_1_53_0\stage\lib
11) Create a new C++ console project, and right click on it:
Build Options->Choose Project Name on the left -> search directories
On compiler tab, press Add and type: $(#boost)
On linker tab, press Add and type: $(#boost.lib)
12) Right click on the C++ console project:
Build Options->Choose Project Name on the left -> linker settings
Add the following link libraries:
..\..\boost_1_53_0\stage\lib\libboost_filesystem-mgw46-mt-1_53.a
..\..\boost_1_53_0\stage\lib\libboost_system-mgw46-mt-1_53.a

Thanks everybody