About cross compiling

Recently, users submitted some questions and issues about cross compilation. For example, They said that ‘installing both the 32 and 64 bit compiler and using icc -m32 does not work anymore. ‘ or ‘I am trying to compile for a 64 bit target on a machine with a 32 bit. … How can I compile for a 64 bit target on a 32 bit OS?’ etc.

To ease customer this kind of question, I summary related information here.

Let us first look at the specification for m32 and m64 in our help manual:
m32, m64
Tells the compiler to generate code for a specific architecture.

IDE Equivalent
None

Architectures
IA-32, Intel® 64 architectures

Syntax
Linux and Mac OS X:
      -m32
      -m64
Windows: None

Arguments
None

Default
OFF The compiler's behavior depends on the host system.

Description
These options tell the compiler to generate code for a specific architecture.

Option Description
-m32    Tells the compiler to generate code for IA-32 architecture.
-m64    Tells the compiler to generate code for Intel® 64 architecture.

The -m32 and -m64 options are the same as Mac OS* X options -arch i386 and -arch x86_64, respectively. Note that these options are provided for compatibility with gcc. They are not related to the Intel® C++ compiler option arch.


If you want to use above feature, you have to check if your system meets below requirements (for more details information, please see Intel® C++ Compiler Professional Edition 11.1 for Linux Installation Guide and Release ntoes.pdf):

Requirements to development IA-32 architecture applications
 A PC based on an IS-32 or Intel® 64 architecture processor supporting the Intel® Streaming SIMD Extensions 2(Intel® SSE2) instructions;
 …
 If developing on an Intel ®64 architecture system, some Linux distributions may require installation of one or more of the following additional Linux components: ia32-libs, lib32gcc1, lib32stdc++6, libc6-dev-i386, gcc-multilib

Requirements to Develop Intel® 64 Architecture Applications
 A PC based on an Intel® 64 architecture processor
 …
 Linux component containing 32-bit libraries(may be called is32-libs)

Compiling on MSVS2008 or MSVS2005
We can see that -m32 and –m64 is for Linux and Mac OS, and there is not option for MS Window.
For MS Window MSVS2005 or MSVS2008, there is a configuration Manager property of the project in which you can setup active solution platform if Win32 or Win64 platform.

Until now, we don’t support compile for a 64 bit target on a 32 bit OS. So please take care of your system configuration when you plan to compile your projects for a cross platforms.

Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.