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

compiling for MacBook 1,1?

kjkjkj
Beginner
680 Views
Hi all,
I'm compiling fortran code on a fairly new iMac (64bit) using intel fortran composer 12 u5. The executables it generates with default settings can't run on a MacBook 1,1 which has a Intel Core Duo processor ("Yonah", I think). This processor can't handle anything above SSE3, and it seems ifort 12 on the iMac can't do anything below SSSE3. Is that correct?
Ideally I'd like to create an executable that can run fully optimized on the newer machine but can fall back to something executable on the older machine.
I've tried using -ax, -m, or -arch, but none of these are able to go below SSSE3.
What do I need to do?
Thanks very much,
Kevin
0 Kudos
1 Solution
Ron_Green
Moderator
680 Views
I don't think the SSE level is the main problem. The main problem is that the Core Solo / Core Duo chips in the first gen Intel Macs are strictly 32bit processors. By default, the compiler on your new iMac is generating 64 bit binaries. From a command line, you can use this command to tell the difference in binaries:

file a.out
a.out: Mach-O 64-bit executable x86_64

The compiler supports the -m32 and -m64 options to control 32 or 64bit code generation. For example,
rwgreen-mac02:~ rwgreen$ ifort -m32 hello.f90 -o hello
rwgreen-mac02:~ rwgreen$ file hello
hello: Mach-O executable i386

Now if you're OK with using a 32bit executable on the new iMac, you could do this:

ifort -o combobinary -m32 -O2 -axsse4.2,sse3 myprog.f90

the sse3 option is only available for the 32bit compiler, selected by -m32 option OR if you

source /opt/intel/bin/compilervars.sh ia32
ifort -o combobinary -O2 -axsse4.2,sse3 myprog.f90

ron

View solution in original post

0 Kudos
2 Replies
Ron_Green
Moderator
681 Views
I don't think the SSE level is the main problem. The main problem is that the Core Solo / Core Duo chips in the first gen Intel Macs are strictly 32bit processors. By default, the compiler on your new iMac is generating 64 bit binaries. From a command line, you can use this command to tell the difference in binaries:

file a.out
a.out: Mach-O 64-bit executable x86_64

The compiler supports the -m32 and -m64 options to control 32 or 64bit code generation. For example,
rwgreen-mac02:~ rwgreen$ ifort -m32 hello.f90 -o hello
rwgreen-mac02:~ rwgreen$ file hello
hello: Mach-O executable i386

Now if you're OK with using a 32bit executable on the new iMac, you could do this:

ifort -o combobinary -m32 -O2 -axsse4.2,sse3 myprog.f90

the sse3 option is only available for the 32bit compiler, selected by -m32 option OR if you

source /opt/intel/bin/compilervars.sh ia32
ifort -o combobinary -O2 -axsse4.2,sse3 myprog.f90

ron
0 Kudos
kjkjkj
Beginner
680 Views
Hi Ron,
thanks so much for your reply. This is right on!
I'm glad I have executables for the older machine now. I'll see if I want to stick with 32b for everything, or if I'll compile 2 sets (32/64bit). I'm guessing the latter is probably best, though it'll take a little more work on my part :).
cheers,
Kevin
0 Kudos
Reply