compiling 32 bit boost libraries on a 64 bit system? (gcc, Linux)
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 - set the following in tools/build/v2/user-config.jam: cflags=-m32 cxxflags=-m32 linkflags=-m32 - 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#bbv... ) but to no avail - the -m32 flag is not honored, and the compiled boost libraries are 64 bit :( what am I doing wrong? Akos
Á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#bbv...
)
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
Vladimir, Thank your for your quick response.
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 ;
I'm sorry, you're totally right, sorry being so ignorant.
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
indeed - excellent! I missed this, as bjam --help does not list these options. but indeed, now I see them on the online documentation, at http://www.boost.org/doc/tools/build/doc/html/bbv2/advanced/builtins/feature... thank you, Akos
participants (2)
-
Vladimir Prus
-
Ákos Maróy