Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29064 Discussions

Can I compile on a 32-bit machine and get a 64-bit program?

kevinkarin
Beginner
1,111 Views
I want to compute a 20000x20000 matrix multiplication on a 64-bit server. My laptop was a 32-bit linux with ifort and MKL. I wish I could compile the program to be 64-bit with this 32-bit ifort but it says the format is incompatible.

My friend tells me that I should install a 64-bit compiler on my 32-bit machine then I can compile the program to 64-bit. Is that true? Is there any way in my 32-bit ifort's flag to compile my code to 64-bit?

Thanks in advance.
0 Kudos
3 Replies
TimP
Honored Contributor III
1,111 Views
There is no support for 64-bit cross compilation on 32-bit linux. In principle, with past versions of Intel compilers, you could have created a full g++ 64-bit cross compiler environment and run the 64-bit ifort in that environment. I never heard of anyone trying it, and this would no longer be a possibility with the 11.0 compilers. The demand for a pure 64-bit compilation environment is clearly much greater than that for a 64-bit cross compilation on 32-bit.
On the other hand, linux x86_64 includes support for 32-bit execution environment, and optional 32-bit compilation environment. The Intel compilers don't provide a driver which switches between 32- and 64-bit compilation by -m32/-m64 switch.
If you want to support both 32- and 64-bit on your laptop, you could upgrade to 64-bit linux, if it is a recent one. I run dual boot on this Core 2 laptop, Windows XPSP3/Opensuse 10.3 x86_64, so you can see there is no problem dual booting with 64-bit linux and 32-bit Windows. If you have enough RAM for Windows Vista, it should also be satisfactory for linux x86_64.
The Visual Studio environment does provide an install option for 64-bit cross compilation on a 32-bit platform, as well as support for 32-bit mode on a 64-bit platform, but that is peculiar to Windows. A 64-bit .exe still won't run on the 32-bit Windows platform.
0 Kudos
zbarcelos
Beginner
1,111 Views
Quoting - tim18
There is no support for 64-bit cross compilation on 32-bit linux. In principle, with past versions of Intel compilers, you could have created a full g++ 64-bit cross compiler environment and run the 64-bit ifort in that environment. I never heard of anyone trying it, and this would no longer be a possibility with the 11.0 compilers. The demand for a pure 64-bit compilation environment is clearly much greater than that for a 64-bit cross compilation on 32-bit.
On the other hand, linux x86_64 includes support for 32-bit execution environment, and optional 32-bit compilation environment. The Intel compilers don't provide a driver which switches between 32- and 64-bit compilation by -m32/-m64 switch.
If you want to support both 32- and 64-bit on your laptop, you could upgrade to 64-bit linux, if it is a recent one. I run dual boot on this Core 2 laptop, Windows XPSP3/Opensuse 10.3 x86_64, so you can see there is no problem dual booting with 64-bit linux and 32-bit Windows. If you have enough RAM for Windows Vista, it should also be satisfactory for linux x86_64.
The Visual Studio environment does provide an install option for 64-bit cross compilation on a 32-bit platform, as well as support for 32-bit mode on a 64-bit platform, but that is peculiar to Windows. A 64-bit .exe still won't run on the 32-bit Windows platform.

Hi,

I have exactly the opposite question, my evironment: Linux smp x86_64 x86_64 x86_64 GNU/Linux

I would like to give my clients (32-bit linux) executables (compiled with intel fortran 10.1 linux). No intel libraries, standard f90/f95 fortran functions, static compilation.

Is there any command-line options ? Is it the default behavior ?

Thank in advance,
Fabio
0 Kudos
TimP
Honored Contributor III
1,111 Views
I would like to give my clients (32-bit linux) executables (compiled with intel fortran 10.1 linux). No intel libraries, standard f90/f95 fortran functions, static compilation.

Is there any command-line options ? Is it the default behavior ?
Install 32-bit g++ (may be called "legacy development" and "compatibility libraries" in some distros, may be included in g++ in others), and the ifort ia32 compiler. Set the environment in accordance with the 32-bit ifortvars script. Apparently, you want the ifort -static-intel link option. I'm not sure what you mean by static compilation.
0 Kudos
Reply