Boost logo

Boost Users :

Subject: Re: [Boost-users] compiling 32 bit boost libraries on a 64 bit system? (gcc, Linux)
From: Vladimir Prus (vladimir_at_[hidden])
Date: 2009-02-18 15:07:26


Ákos Maróy wrote:

> Hi,
>
> I'm trying to compile boost into 32 bit libraries on a 64 bit Linux box.
> with gcc, with would simply mean to add the flag -m32 to gcc.
>
> but I can't seem to make bjam do this.
>
> I've tried a number of approaches:
>
> - export and set the environment variables CFLAGS, CXXFLAGS and LDFLAGS
> to -m32

These have no effect.

>
> - set the following in tools/build/v2/user-config.jam:
>
> cflags=-m32
> cxxflags=-m32
> linkflags=-m32

These have no effect either, and no documentation say anything like
this should work.

>
> - set the following in tools/build/v2/user-config.jam:
>
> using gcc : 4.1.2 : g++-4.1.2 : -m32 ;
>
> (based on the documentation found at
>
http://beta.boost.org/doc/tools/build/doc/html/bbv2/reference/tools.html#bbv2.reference.tools.compiler.gcc
> )

That's not what the documentation say. It says:

        The following options can be provided, using <option-name>option-value syntax:

So, you need:

        using gcc : 4.1.2 : g++-4.1.2 : <compileflags>-m32 <linkflags>-m32 ;

You have failed to say what version of Boost you are using. If 1.38 then you should not
need any of this, and just do:

        bjam architecture=x86 address-model=32

- Volodya


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net