Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.

Cross compiling on Linux

Duncan_Soutar
Beginner
780 Views
Hi
I wonder if somebody can help. I have ifort 10.1.008 on a 64-bit linux box. I am successfully building a project using a makefile, in native 64-bit. I wish to build a 32-bit version as well but cannot find any compiler option to do this.

The Release notes (/opt/intel/fce/10.1.008/doc/Release_Notes.htm), in the section "Native and Cross-Platform Development", state the following:
"
Intel 64 Architecture Host
Supported targets: IA-32 and Intel 64
"
There are numerous options relating to architecture, similar to those I am used to under Solaris, for example, but nothing seems to switch between ia32 and em64t or whatever names one might feel like using. (x86_64 might be useful so that one could use `arch`).

Ideally I would like to use the one makefile to build all the chosen targets.

Many thanks

Simon.



0 Kudos
2 Replies
TimP
Honored Contributor III
780 Views
If you install the 32-bit compiler, you can compile on x86_64 to run in 32-bit mode on either x86_64 or 32-bit linux. There isn't a command line switch to invoke 32-bit mode, similar to gcc -m32. You must reset the environment variables by the ifortvars script to switch between 32- and 64-bit compilers. You could build that into your Makefile if you so choose.
0 Kudos
Duncan_Soutar
Beginner
780 Views
Quoting - tim18
If you install the 32-bit compiler, you can compile on x86_64 to run in 32-bit mode on either x86_64 or 32-bit linux. There isn't a command line switch to invoke 32-bit mode, similar to gcc -m32. You must reset the environment variables by the ifortvars script to switch between 32- and 64-bit compilers. You could build that into your Makefile if you so choose.

Thanks tim18 for confirming this.

I see that it will take some messing about to have it work in my makefile and also leave a useable environment outside of make. At least I can avoid more wasted time reading the docs. It would help if the Release Notes were a bit clearer on this issue of cross-compiling.

At least I now see the way to provide release and debug builds in both 32-bit and 64-bit, like in windows.

Cheers
Simon.
0 Kudos
Reply