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

Linker error on mac os x

Ekaterina_Elts
Beginner
1,168 Views
Hello,

I has been using ifort for a while on a linux, and received a new ifort license for my mac today. However, while trying to compile my program fon a mac, i get a linking error:

ifort -o my my.o my2.o
ld: unknown architecture specification flag: -arch x86_64
ld: Usage: ld [options] file [...]
make: *** [ms2] Error 1

I am not specifying any architecture options while building, either.. Building the same makefile using linux ifort on a corporate server works. Does anyone have a suggestion what could be the trouble and how to fix it?



0 Kudos
1 Solution
Ron_Green
Moderator
1,169 Views
The linker, ld, is complaining about the object file format. ld is packaged with Apple's Xcode tools, which is a pre-requisite to using the compiler. What version of Xcode do you have installed?

The supported versions of Xcode are listed in /opt/intel/Compiler/11.1/067/Documentation/Release_NotesF.pdf

For Mac OS X 10.5.7 this is Xcode 3.1.3

ron


View solution in original post

0 Kudos
4 Replies
Ron_Green
Moderator
1,169 Views
Quoting - Ekaterina Elts
Hello,

I has been using ifort for a while on a linux, and received a new ifort license for my mac today. However, while trying to compile my program fon a mac, i get a linking error:

ifort -o my my.o my2.o
ld: unknown architecture specification flag: -arch x86_64
ld: Usage: ld [options] file [...]
make: *** [ms2] Error 1

I am not specifying any architecture options while building, either.. Building the same makefile using linux ifort on a corporate server works. Does anyone have a suggestion what could be the trouble and how to fix it?




It could be that you are on a 32bit Mac. First try adding option -m32 to force a 32bit build.

If this doesn't resolve the issue, let us know what version of Mac OS you are on:

sw_vers

$ sw_vers
ProductName:Mac OS X
ProductVersion:10.5.8
BuildVersion:9L30

and

ifort -V

ron
0 Kudos
Ekaterina_Elts
Beginner
1,169 Views

It could be that you are on a 32bit Mac. First try adding option -m32 to force a 32bit build.

If this doesn't resolve the issue, let us know what version of Mac OS you are on:

sw_vers

$ sw_vers
ProductName:Mac OS X
ProductVersion:10.5.8
BuildVersion:9L30

and

ifort -V

ron
Hello, unluckily the -m32 option does not solve the problem, i get the same error, after some ipo: warning #11009: file format not recognized for my.o errors. I get the following information from the system:
mylaptop:~ ekaterinaelts$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.5.7
BuildVersion: 9J61
mylaptop:~ ekaterinaelts$ ifort -V
Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.1 Build 20090827 Package ID: m_cprof_p_11.1.067
Copyright (C) 1985-2009 Intel Corporation. All rights reserved.
Any ideas?
Thanks,
Ekaterina
0 Kudos
Ron_Green
Moderator
1,170 Views
The linker, ld, is complaining about the object file format. ld is packaged with Apple's Xcode tools, which is a pre-requisite to using the compiler. What version of Xcode do you have installed?

The supported versions of Xcode are listed in /opt/intel/Compiler/11.1/067/Documentation/Release_NotesF.pdf

For Mac OS X 10.5.7 this is Xcode 3.1.3

ron


0 Kudos
Ekaterina_Elts
Beginner
1,169 Views
The linker, ld, is complaining about the object file format. ld is packaged with Apple's Xcode tools, which is a pre-requisite to using the compiler. What version of Xcode do you have installed?

The supported versions of Xcode are listed in /opt/intel/Compiler/11.1/067/Documentation/Release_NotesF.pdf

For Mac OS X 10.5.7 this is Xcode 3.1.3

ron


Thank you very much! After upgrading the xcode it works fine!
Ekaterina
0 Kudos
Reply