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

Problems compiling on Mac OS X

jor27
Beginner
1,020 Views
I'm trying to compile a sample program with ifort a I get the error :

ld: unknown architecture specification flag: -arch x86_64
ld: Usage: ld [options] file [...]

The version of gcc that I've installed is gcc 4.0.

Can anybody help me?

Thanks!!!
0 Kudos
7 Replies
TimP
Honored Contributor III
1,020 Views
You may be attempting (unintentionally?) to cross compile 64-bit code on a 32-bit system. That is not supported with a stock gnu binutils and library installation, and the resulting code would not run on a 32-bit OS. If you are running a 32-bit OS (the only possibility, if you have a Core, as opposed to Core 2 CPU), you must use the 32-bit ifort.
The message produced by the command "ifort -V" would tell which architecture, e.g. "running on Intel 64" for the 64-bit compiler. The default installation directories are distinguished by /fc/ for 32-bit and /fce/ for 64-bit.
0 Kudos
jor27
Beginner
1,020 Views
Thank you very much!!

I'm running on Intel 64 architecture, but now I don't have any idea how to change to 32 bit configuration. I would be very pleased if you could help me!!!

Thanks

Jorge
0 Kudos
TimP
Honored Contributor III
1,020 Views
Even if you have 64-bit hardware, if you have installed a 32-bit OS, you must use 32-bit compilers. If you have 64-bit OS, but haven't installed the corresponding combined 32- and 64-bit gcc/g++ development system, you would need either to change your gcc installation or use the 32-bit Fortran compiler.
Intel Fortran comes in both 32- and 64-bit versions. There should be an installer package available which includes both, as well as separate packages, all working with the same license.
0 Kudos
Steven_L_Intel1
Employee
1,020 Views
On Mac we don't have separate installers - one installer gets you both 32 and 64-bit. Make sure that you have used the "source" command specifying the "fce" install folder.
0 Kudos
TimP
Honored Contributor III
1,020 Views
If the 32-bit compiler is required, shouldn't the ifortvars be sourced from the fc folder? If there is no 64-bit binutils on the system, shouldn't the installer so indicate when attempting to install?
0 Kudos
Steven_L_Intel1
Employee
1,020 Views
My understanding is that a 64-bit Mac system has both 32 and 64 bit gcc installed, so everything should be there. You can use the source command to specify the /fc/ folder to get the 32-bit compiler, or, I think, you can use -m32 to specify the 32-bit compiler. I'll admit that I have never done this on a Mac so I am not sure of the exact details.
0 Kudos
jor27
Beginner
1,020 Views
Using the compiling option -m32 was perfect!!! I was able also to change the gcc version, so I can use the 64 bit gcc configuration.

Thank you very much for your help!!!

Jorge Arrieta
0 Kudos
Reply