English 中文(简体)
How to make a fortran executable that runs on Mac OS X 10.5 and 10.6
原标题:

I d like to compile a fortran code with gfortran so that it will work on both Mac OS X 10.5 and 10.6. Is there a way to do this? I tried compiling on 10.6 and get this message when I run the executable on 10.5:

dyld: unknown required load command 0x80000022 Trace/BPT trap

问题回答

What version of 10.5 are you on? According to this (0x22) is a dynamic load function that got added at 10.5.6. You could try upgrading to >10.5.6 and see if the problem persists.

Also where did you get your gfortran from? In the numpy community the ones from att.com are highly recommended and the builds from hpc are generally to be avoided.

The application was incorrectly built on OS X 10.6 machine for a 10.5 machine. The developer can fix this by considering three things:

Using the correct compiler parameters:
gcc-4.2 -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk ...

Using the correct linker settings (setting environment variable before link command). This is required, so that the OS X 10.6 linker will not use the loader command  LC_DYLD_INFO_ONLY  (=0x80000022), because OS X 10.5 does not understand this command:

export MACOSX_DEPLOYMENT_TARGET=10.5
(or   setenv MACOSX_DEPLOYMENT_TARGET=10.5)

After this is fixed, one can check if the application was correctly built for OS X 10.5 by running otool :

otool -l binary

The correct binary should not contain any LC_DYLD_INFO_ONLY load commands (only LC_DYLD_INFO commands).

(also see my blog article http://grauonline.de/wordpress/?p=71 )





相关问题
2 mysql instances in MAC

i recently switched to mac. first and foremost i installed xampp. then for django-python-mysql connectivity, i "somehow" ended up installing a seperate MySQL. now the seperate mysql installation is ...

Iterating over string/strlen with umlauted characters

This is a follow-up to my previous question . I succeeded in implementing the algorithm for checking umlauted characters. The next problem comes from iterating over all characters in a string. I do ...

Controlling OSX windows

I m trying to control windows of a foreign OSX applications from my application. I d like to 1. move the windows on the screen 2. resize the windows on the screen 3. change the currently active window ...

Switching J2SE versions on Mac OS (SnowLeopard)

My current JDK on Mac OS (10.6) is set to 1.6 and I d like to switch to 1.5. A listing of /System/Library/Frameworks/JavaVM.framework/Versions/ shows: lrwxr-xr-x 1 root wheel 10 Nov 3 18:34 ...

Scrolling inside Vim in Mac s Terminal

I ve been googling around trying to figure out if it s possible to use my mouse wheel to scroll while inside Vim in Mac s Terminal, with no luck. It seems as if only X11 or iTerm support this. Before ...

export to MP3 from quicktime API

A question for Apple,QT programmers. Would like to know if it s possible to export a Movie object to MP3 using the QuickTime API. Preferably the ConvertMovieToFile function. I ve looked at ...

热门标签