About cross compiling

Published: 04/05/2010, Last Updated: 04/05/2010

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

IA-32, Intel® 64 architectures

Linux and Mac OS X:
Windows: None


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

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.

Product and Performance Information


Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804