building 32-bit boost on an AMD Opteron?

Hi -- I am trying to build boost on a 64-bit AMD Opteron but make it yield 32 bit code. The reason for this is I want smaller executables and memory footprint (Side note: if you do pmap on even a small hello world program on an 64 bit Opteron it requires 10 MB of virtual memory vs. 1.2 MB if compiled in 32 bit mode -- Can you believe it?). I have tried to edit the tools/build/gcc-tool.bjam file to add the -m32 compiler option to LINKFLAGS, CFLAGS, CPPFLAGS and CXXFLAGS. However, in doing so, it generates a number of compiler errors. Below is a sample (I am using GCC 4.0.2 under SUSE Linux). Any help would be most appreciated!! thank you!, Chris %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bjam "-sTOOLS=gcc" install Building Boost.Regex with the optional Unicode/ICU support disabled. Please refer to the Boost.Regex documentation for more information (and if you don't know what ICU is then you probably don't need it). --------------------------------------------------------------------- *** If you don't need Boost.Python, you can ignore this section *** *** pass --without-python to suppress this message in the future *** skipping Boost.Python library build due to missing or incorrect configuration couldn't find Python.h in "/usr/local/include/python2.2" You can configure the location of your python installation by setting: PYTHON_ROOT - currently "/usr/local" PYTHON_VERSION - The 2-part python Major.Minor version number (e.g. "2.2", NOT "2.2.1") - currently "2.2" The following are automatically configured from PYTHON_ROOT if not otherwise set: PYTHON_LIB_PATH - path to Python library object; currently "/usr/local/lib/python2.2/config" PYTHON_INCLUDES - path to Python #include directories; currently "/usr/local/include/python2.2" --------------------------------------------------------------------- ...patience... ...patience... ...found 13317 targets... ...updating 1523 targets... MkDir1 bin MkDir1 bin/boost MkDir1 bin/boost/libs MkDir1 bin/boost/libs/test MkDir1 bin/boost/libs/test/build MkDir1 bin/boost/libs/test/build/libboost_prg_exec_monitor.so MkDir1 bin/boost/libs/test/build/libboost_prg_exec_monitor.so/gcc MkDir1 bin/boost/libs/test/build/libboost_prg_exec_monitor.so/gcc/debug MkDir1 bin/boost/libs/test/build/libboost_prg_exec_monitor.so/gcc/debug/shared-linkable-true gcc-C++-action bin/boost/libs/test/build/libboost_prg_exec_monitor.so/gcc/debug/shared-linkable-true/execution_monitor.o g++: no input files set -e "g++" -c -Wall -ftemplate-depth-255 -DBOOST_TEST_NO_AUTO_LINK=1 -g -m32; flags gcc LINKFLAGS <debug-symbols>on -m32 -fno-inline -fPIC -I"bin/boost/libs/test/build" -I "/home/carother/32-Bit/boost_1_33_0" -o "bin/boost/libs/test/build/libboost_prg_exec_monitor.so/gcc/debug/shared-linkable-true/execution_monitor.o" "/home/carother/32-Bit/boost_1_33_0/libs/test/build/../src/execution_monitor.cpp" "/usr/bin/objcopy" --set-section-flags .debug_str=contents,debug "bin/boost/libs/test/build/libboost_prg_exec_monitor.so/gcc/debug/shared-linkable-true/execution_monitor.o" ...failed gcc-C++-action bin/boost/libs/test/build/libboost_prg_exec_monitor.so/gcc/debug/shared-linkable-true/execution_monitor.o...

On Jan 5, 2006, at 2:48 PM, chrisc@cs.rpi.edu wrote:
"g++" -c -Wall -ftemplate-depth-255 -DBOOST_TEST_NO_AUTO_LINK=1 -g -m32; flags gcc LINKFLAGS <debug-symbols>on -m32 -fno-inline -fPIC
It looks like a typo in your change to the .jam file. See how you're getting a semicolon in the command line? Spaces are significant in Jam, so "-m32;" is different from "-m32 ;". You'll need to add that space between the "2" and the ";". Doug

Thanks for the jam info. I was able to fix it by adding the following two lines to my .jam file above all other CFLAG and LINKFLAG lines. They are: flags gcc CFLAGS : -m32 ; flags gcc LINKFLAGS : -m32 ; That allows boost to build correctly for 32 bit codes. It is unclear if the LINKFLAGS is needed, but I added it for good measure since I thought it could not hurt. Thank you again!, Chris On Thu, 5 Jan 2006, Doug Gregor wrote:
On Jan 5, 2006, at 2:48 PM, chrisc@cs.rpi.edu wrote:
"g++" -c -Wall -ftemplate-depth-255 -DBOOST_TEST_NO_AUTO_LINK=1 -g -m32; flags gcc LINKFLAGS <debug-symbols>on -m32 -fno-inline -fPIC
It looks like a typo in your change to the .jam file. See how you're getting a semicolon in the command line? Spaces are significant in Jam, so "-m32;" is different from "-m32 ;". You'll need to add that space between the "2" and the ";".
Doug
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

<chrisc@cs.rpi.edu> skrev i meddelandet news:Pine.LNX.4.62.0601051437040.14546@area52.cs.rpi.edu...
Hi -- I am trying to build boost on a 64-bit AMD Opteron but make it yield 32 bit code. The reason for this is I want smaller executables and memory footprint (Side note: if you do pmap on even a small hello world program on an 64 bit Opteron it requires 10 MB of virtual memory vs. 1.2 MB if compiled in 32 bit mode -- Can you believe it?).
Have you considered just how much larger the virtual address space is on a 64 bit machine? :-) Bo Persson
participants (3)
-
Bo Persson
-
chrisc@cs.rpi.edu
-
Doug Gregor