ld: can't write output file for architecture x86_64

ld: can't write output file for architecture x86_64

Dear Users,

After upgrading my OS to Mavericks and installing XCode5 I am only able to write the compiled file if I use sudo ("sudo ifort file.f", for example). Without sudo I have the following error message: "ld: can't write output file: a.out for architecture x86_64". I have found a post with a similar issue (from 2011, after an OS or XCode upgrade), solved using a "sudo make install", but I did not find a install file in the intel folder. I would really appreciate some help with this issue.



9 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Best Reply

The "sudo make install" would be specific to that user's situation and not related to ifort or the content in any Intel related directories.

I do not know what is causing this at the moment.

When compiling, are working in your home directory?

As a test, can you try compiling under your normal account in another public writable location like /tmp?

Dear Kevin:

Your answer solved the problem: thank you so much!

I have checked the permissions of the directory I was compiling (it was not my home directory) and, altough I had full permissions to read and write, everyone else had only permission to read. After changing all permissions to read and write, it worked without sudo.

Now I am just wondering, if I have full permission to read and write and I am compiling, why is it necessary to have full permissions to anyone to be able to compile (without sudo)...

I'm glad to help lead to a solution but what you described does not seem to make sense. I am only able to reproduce the error where I am not the owner of the directory and do not have write permission.

Are you able to share the results of "ls -al" within this directory that you are working?

I'm only interested in seeing the permissions on the current working directory ("." dot) and the parent, (".." dot dot) so you can filter out any actual names as necessary in your reply if needed.


I changed the permissions using the info window (pressing "command + I" with the target folder selected on finder). The strange thing is that I changed it back to read only for other users and the error is not happening anymore. The target folder was nested inside other folders, and I did change the permissions for the "parent folder" (the folder closest to the root) selecting the option "apply to the enclosed items". Could it be that, in some intermediate folder I did not have permission to write? Or, having the permission to read/write in the target folder is enough to avoid the problem?

Anyway, here is the info you asked me (in the actual condition, with all permissions to everyone):

drwxrwxrwx@ 14 abonatto  staff       476 10 Dez 17:22 .
drwxrwxrwx   9 abonatto  staff       306 10 Dez 17:20 ..

Yes, perhaps it was permissions or ownership on some intermediate folder. I don't know what really happens underneath the hood when using the info window, but I'm glad it seems resolved.

Dear Expert Users,


I'm in an imac under os x 10.9.1. Using composer_xe_2013.1.119, and trying to compile and link in fortran. My problem is, as a result of compiling/linking (exactly I don't know) I getting the following:


duplicate symbol _wide_ in:








ld: 8 duplicate symbols for architecture x86_64





So, what is wrong in my process?


In advance, I thank your support!




E.A. Marti

E A, it looks as if you have two copies of a procedure named "wide". It also looks as if you have turned on the -ipo option which is making it harder to diagnose where the problem is. I suggest removing that option for now (or -fast if you're using that). The linker should then tell you which object files contain the duplicates.

Retired 12/31/2016

I just had the same problem that when compiling, I got "ld: can't write output file: a.out for architecture x86_64". The solution was very very simple. I had an "a.out" file that was owned by root in my working directory, thus overwriting required sudo. Just deleting that old a.out solved the problem and sudo is no longer necessary....





Leave a Comment

Please sign in to add a comment. Not a member? Join today