[Boost-users] how to build boost using mingw on windows?

1,116 views
Skip to first unread message

Ákos Maróy

unread,
Jun 21, 2011, 9:47:46 AM6/21/11
to boost...@lists.boost.org
Hi,

This might be a frequent question asked, but I can't seem to find a
proper response. I'm trying to build boost using the current version of
mingw, from under msys, but I can't seem to make it work. I tried boost
1.45.0 and 1.46.1 as well. here are my results:

boost 1.45.0:

akos@RAKKU /c/Users/akos/src/boost_1_45_0
$ ./bootstrap.sh --with-toolset=mingw --prefix=/c/Users/akos/usr
Building Boost.Jam with toolset mingw...
tools/build/v2/engine/src/bin.ntx86/bjam
Unicode/ICU support for Boost.Regex?... not found.
Backing up existing Boost.Build configuration in project-config.jam.3
Generating Boost.Build configuration in project-config.jam...

Bootstrapping is done. To build, run:

./bjam

To adjust configuration, edit 'project-config.jam'.
Further information:

- Command line help:
./bjam --help

- Getting started guide:
http://www.boost.org/more/getting_started/unix-variants.html

- Boost.Build documentation:
http://www.boost.org/boost-build2/doc/html/index.html


akos@RAKKU /c/Users/akos/src/boost_1_45_0
$ ./bjam
mingw.jam: No such file or directory
c:/Users/akos/src/boost_1_45_0/tools/build/v2/build\toolset.jam:38: in
toolset.u
sing
rule mingw.init unknown in module toolset.
c:/Users/akos/src/boost_1_45_0/tools/build/v2/build\project.jam:881: in
using
project-config.jam:12: in modules.load
c:/Users/akos/src/boost_1_45_0/tools/build/v2\build-system.jam:257: in
load-conf
ig
c:/Users/akos/src/boost_1_45_0/tools/build/v2\build-system.jam:423: in
load-conf
iguration-files
c:/Users/akos/src/boost_1_45_0/tools/build/v2\build-system.jam:554: in load
c:\Users\akos\src\boost_1_45_0\tools\build\v2/kernel\modules.jam:283: in
import
c:\Users\akos\src\boost_1_45_0\tools\build\v2\kernel\bootstrap.jam:142:
in boost
-build
c:\Users\akos\src\boost_1_45_0\boost-build.jam:17: in module scope

when trying boos 1.46.1:

akos@RAKKU /c/Users/akos/src/boost_1_46_1
$ ./bootstrap.sh --with-toolset=mingw --prefix=/c/Users/akos/usr
Building Boost.Jam with toolset mingw...
tools/build/v2/engine/src/bin.ntx86/bja
m
Unicode/ICU support for Boost.Regex?... not found.
Generating Boost.Build configuration in project-config.jam...

Bootstrapping is done. To build, run:

./bjam

To adjust configuration, edit 'project-config.jam'.
Further information:

- Command line help:
./bjam --help

- Getting started guide:
http://www.boost.org/more/getting_started/unix-variants.html

- Boost.Build documentation:
http://www.boost.org/boost-build2/doc/html/index.html


akos@RAKKU /c/Users/akos/src/boost_1_46_1
$ ./bjam
mingw.jam: No such file or directory
c:/Users/akos/src/boost_1_46_1/tools/build/v2/build\toolset.jam:38: in
toolset.u
sing
rule mingw.init unknown in module toolset.
c:/Users/akos/src/boost_1_46_1/tools/build/v2/build\project.jam:886: in
using
project-config.jam:12: in modules.load
c:/Users/akos/src/boost_1_46_1/tools/build/v2\build-system.jam:257: in
load-conf
ig
c:/Users/akos/src/boost_1_46_1/tools/build/v2\build-system.jam:423: in
load-conf
iguration-files
c:/Users/akos/src/boost_1_46_1/tools/build/v2\build-system.jam:554: in load
c:\Users\akos\src\boost_1_46_1\tools\build\v2/kernel\modules.jam:283: in
import
c:\Users\akos\src\boost_1_46_1\tools\build\v2\kernel\bootstrap.jam:142:
in boost
-build
c:\Users\akos\src\boost_1_46_1\boost-build.jam:17: in module scope

trying other settings, e.g. a toolset of gcc will not work :(

trying the bootstrap.bat file with the same command line parameters
don't work, as they expect to find the MS C++ compiler, cl.


I googled this issue, but did not find a solution that would eventually
work :(

I wonder what the proper process is to build boost on Windows using the
current version of MingW.


Akos

PS: the gcc version I have is:

$ gcc --version
gcc.exe (GCC) 4.5.2
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

_______________________________________________
Boost-users mailing list
Boost...@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users

Jim Bell

unread,
Jun 21, 2011, 3:22:19 PM6/21/11
to boost...@lists.boost.org
It looks like you have a working bjam.exe. That's good.

Use gcc instead of mingw as the toolset.

If it still gives you trouble, modify
boost/tools/build/v2/user-config.jam, uncommenting this row:
using gcc ;

(Note that the space before the semi-colon is important.)

Good luck!
-Jim


On 1:59 PM, Ákos Maróy wrote:
> Hi,
>
> This might be a frequent question asked, but I can't seem to find a
> proper response. I'm trying to build boost using the current version
> of mingw, from under msys, but I can't seem to make it work. I tried
> boost 1.45.0 and 1.46.1 as well. here are my results:
>
>
>

> ...

Ákos Maróy

unread,
Jun 21, 2011, 8:09:08 PM6/21/11
to Jim Bell, boost...@lists.boost.org
Jim,

> It looks like you have a working bjam.exe. That's good.
>
> Use gcc instead of mingw as the toolset.

it doesn't seem to work.

if I try to compile bjam with the gcc toolset, it just won't:

$ ./bootstrap.sh --with-toolset=gcc
Building Boost.Jam with toolset gcc...
Failed to build Boost.Jam
Consult 'bootstrap.log' for more details

where in the log the errors are like the following:

$ cat bootstrap.log
###
### Using 'gcc' toolset.
###
rm -rf bootstrap
mkdir bootstrap
gcc -o bootstrap/jam0 command.c compile.c debug.c expand.c glob.c hash.c
hdrmacr
o.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c newstr.c
option.c
output.c parse.c pathunix.c pathvms.c regexp.c rules.c scan.c search.c
subst.c
timestamp.c variable.c modules.c strings.c filesys.c builtins.c pwd.c
class.c na
tive.c md5.c w32_getreg.c modules/set.c modules/path.c modules/regex.c
modules/p
roperty-set.c modules/sequence.c modules/order.c execunix.c fileunix.c
builtins.c:32:23: fatal error: sys/wait.h: No such file or directory
compilation terminated.
execunix.c:17:26: fatal error: sys/resource.h: No such file or directory
compilation terminated.
fileunix.c:97:17: fatal error: ar.h: No such file or directory
compilation terminated.


if I try to compile bjam with the mingw toolset, then I do get a bjam
executabl, but then I get the error posted in the previous e-mail, even
if I tell it to use the gcc toolset:

$ ./bjam.exe toolset=gcc


mingw.jam: No such file or directory
c:/Users/akos/src/boost_1_46_1/tools/build/v2/build\toolset.jam:38: in
toolset.u
sing
rule mingw.init unknown in module toolset.
c:/Users/akos/src/boost_1_46_1/tools/build/v2/build\project.jam:886: in
using
project-config.jam:12: in modules.load
c:/Users/akos/src/boost_1_46_1/tools/build/v2\build-system.jam:257: in
load-conf
ig
c:/Users/akos/src/boost_1_46_1/tools/build/v2\build-system.jam:423: in
load-conf
iguration-files
c:/Users/akos/src/boost_1_46_1/tools/build/v2\build-system.jam:554: in load
c:\Users\akos\src\boost_1_46_1\tools\build\v2/kernel\modules.jam:283: in
import
c:\Users\akos\src\boost_1_46_1\tools\build\v2\kernel\bootstrap.jam:142:
in boost
-build
c:\Users\akos\src\boost_1_46_1\boost-build.jam:17: in module scope


>


> If it still gives you trouble, modify
> boost/tools/build/v2/user-config.jam, uncommenting this row:
> using gcc ;
>
> (Note that the space before the semi-colon is important.)

same as above..

I get the same results for both boost 1.46.1 and 1.45.0


Akos

Jim Bell

unread,
Jun 22, 2011, 8:49:12 AM6/22/11
to Ákos Maróy, boost...@lists.boost.org

On 6/21/2011 7:09 PM, Ákos Maróy wrote:
> Jim,
>
>> It looks like you have a working bjam.exe. That's good.
>>
>> Use gcc instead of mingw as the toolset.
>
> it doesn't seem to work.
>
> if I try to compile bjam with the gcc toolset, it just won't:
>
> $ ./bootstrap.sh --with-toolset=gcc

I misread your symptoms. Sorry about that.

Building a native bjam under mingw, then using it, requires this:

cd BOOST_ROOT/tools/build/v2/engine/src
./build.sh mingw
cd BOOST_ROOT
tools/build/v2/engine/src/bin.ntx86/bjam.exe toolset=gcc


<https://svn.boost.org/trac/boost/ticket/4884#comment:10>

Though I figured out how to do it, no one else really stands a chance.
I'll bring it up on the developer's list: either
<http://www.boost.org/doc/libs/1_46_1/more/getting_started/windows.html#or-simplified-build-from-source>
needs to show it, or bootstrap needs to change.

Ákos Maróy

unread,
Jun 22, 2011, 11:35:34 AM6/22/11
to Jim Bell, boost...@lists.boost.org
Jim

On 6/22/2011 2:49 PM, Jim Bell wrote:
>
>
> On 6/21/2011 7:09 PM, Ákos Maróy wrote:
>> Jim,
>>
>>> It looks like you have a working bjam.exe. That's good.
>>>
>>> Use gcc instead of mingw as the toolset.
>>
>> it doesn't seem to work.
>>
>> if I try to compile bjam with the gcc toolset, it just won't:
>>
>> $ ./bootstrap.sh --with-toolset=gcc
>
> I misread your symptoms. Sorry about that.
>
> Building a native bjam under mingw, then using it, requires this:
>
> cd BOOST_ROOT/tools/build/v2/engine/src
> ./build.sh mingw
> cd BOOST_ROOT
> tools/build/v2/engine/src/bin.ntx86/bjam.exe toolset=gcc

indeed, this works, but only after I have deleted the whole directory
structure and exploded the source tarball again

>
>
> <https://svn.boost.org/trac/boost/ticket/4884#comment:10>
>
> Though I figured out how to do it, no one else really stands a chance.
> I'll bring it up on the developer's list: either
> <http://www.boost.org/doc/libs/1_46_1/more/getting_started/windows.html#or-simplified-build-from-source>
> needs to show it, or bootstrap needs to change.

I totally agree. is there any way to get this change / piece of
information across?


Akos

Reply all
Reply to author
Forward
0 new messages