compiling binaries for intel mac distribution

compiling binaries for intel mac distribution

Hi does anyone know where I can look to find out more about compiling binaries of fortran programs for distribution to intel mac users? I have yet to install ifort on my personal mac, but statically linked binaries from our intel64 RHEL 5 cluster do not seem to work on macs (I get a very generic warning from the os "cannot execute binary file"). I only used some very basic flags (-static -g -warn) so perhaps there is a target architecture that I need to supply?

Also, I tried compiling a binary using gfortran on my home computer (mac) statically linking against libgfortran and emailing it to another personal computer (also mac) and I get some error message about unknown instruction 4. After digging around it looks like when FSF/GNU changed their licensing (from lgpl to gpl, I think) apple branched the old gcc compilers and subsequently dropped gfortran support.

Anyway, if anyone has any idea about this please let me know. Perhaps I was niave in thinking that a simple hello world type program statically linked on one *nix OS would be able to run on another *nix OS with virtually the same architecture (both recent intel64).

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

Just as with gfortran, ifort has separately built compilers and libraries for the mac architecture. Linux targeted builds won't run on mac (without virtualization to actually run linux) and vice versa. If it were simply a matter of hardware architecture, you wouldn't need bootcamp to run Windows on mac. ifort doesn't have cross compilers which could run on linux to target mac; in principle, that could be done with gfortran, but Apple won't support it.

Tim, thanks so much for your reply. This is consistent with the research that I have been doing. Additionally it seems that building binaries on a mac with gfortran doesn't guarantee that you can you can run them on another mac even if you specify -static-libgfortran. (Generally speaking it is impossible to compile a COMPLETELY statically linked binary on OSX, and as far as I can tell one wouldn't want to do this.) I have tried this numerous times, with numerous versions of gfortran. I have one more test to do on that from but after that I'm going to give up.

Do you know if you can use ifort (on an intel Mac) to compile binaries for distribution to other macs? I have yet to try, but after my frustrating experience with gfortran I thought I'd ask before diving into this. Any tips for building binaries on macs for distribution to other macs would be most welcome.


Leave a Comment

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