Sorry for double, forget send to gcc-help... ---------- Forwarded message ---------- From: Sergey Ivanov <icegood1980@xxxxxxxxx> Date: 2012/9/27 Subject: Re: Compile for different machine To: Marcin Mirosław <marcin@xxxxxxxx> 2012/9/27 Marcin Mirosław <marcin@xxxxxxxx>: > W dniu 27.09.2012 15:28, Sergey Ivanov pisze: >> Tried to compile code for i686 instructions set under my AMD x64 in gcc 4.6. >> Specified -march=i686. >> Obtained "error: CPU you selected does not support x86-64 instruction set" >> Why? >> Full options line is: >> export CC=$(compiler) -O3 -finline-limit=100000 --param >> inline-unit-growth=10000 --param large-function-growth=100000 \ >> --param large-function-insns=47000 -march=i686 -Wall >> -Wno-format-security $(GCC_VER_MORE_45_NO_UNUSED_RET) --param >> large-stack-frame=65536 \ >> --param large-stack-frame-growth=3000 $(explicit_templates) -pg >> > > Hi, > maybe with "-m32" it will work better? > Regards. > With m32 doesn't work with other reason: ice@ubuntu:~/science/trunk/main/monte_carlo_offlattice_moldyn/src$ make In file included from /usr/include/c++/4.6/x86_64-linux-gnu/32/bits/os_defines.h:40:0, from /usr/include/c++/4.6/x86_64-linux-gnu/32/bits/c++config.h:393, from /usr/include/c++/4.6/cstdio:43, from Exception.cpp:4: /usr/include/features.h:324:26: fatal error: bits/predefs.h: No such file or directory compilation terminated. Seems headers for 32bit environment are wrong. What should i do to make them better? 1) uname -a Linux ubuntu 3.2.0-31-generic #50-Ubuntu SMP Fri Sep 7 16:16:45 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux 2) gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) -- Kind regards, Sergey Ivanov -- Kind regards, Sergey Ivanov