Fortran? Anyone?
#3
Posted 25 November 2002 - 07:54 PM
I do a fair amount of Fortran programming on the Mac, actually.
I use g77, GNU's Fortran 77 compiler. You've probably used it on other platforms, but in case you haven't, it's chief virtues are that it's widely used across many platforms (not just Mac), and that it's free. I installed it with Fink, http://fink.sourceforge.net . You may be able to find another method if you're anti-Fink.
I'm not quite sure what "integrated with a C/C compiler" means, but you can compile .f, .c, and .cc source to .o object files with g77 and gcc, and then link them as is usual with gcc (or whatever). I create such hybrid programs all the time, and am able to call C and C from Fortran and Fortran from C and C, so I've had no problems.
One peculiarity: With 10.2, Apple included a framework vecLib which is altivec enabled, which contains many useful fortran packages including lapack and blas... instead of doing "-lblas" or "-llapack" do "-framework vecLib".
If you need Fortran 90, I don't know of a free 90 compiler for any platform.
Hrm. I wonder if I have enough moxy to write a Cocoa app that uses Fortran...
[ 11-25-2002: Message edited by: Duke Thomas ]
#4
Posted 26 November 2002 - 06:27 AM
Duke, I currently am not running OS X, but GNU Fortran sounds like an excellent reason NOT to buy a Windows laptop (for which I already have Digital Fortran) and instead buy a new Mac. You may have saved me from a sojourn on the dark side. By the way, calling C routines is exactly what I need to do. All the code is F77, too. It's quite old spagetti code.
Do you have any idea how a program compiled using GNU Fortran compares in execution to, for example, the successor to Digital's Fortran (whoever has that now) on a Win machine? I saw a review using Absoft's that indicated it was not very efficient.
#5
Posted 26 November 2002 - 08:06 AM
You may have saved me from a sojourn on the dark side.
Great! I hope it plays out well.
By the way, calling C routines is exactly what I need to do. All the code is F77, too. It's quite old spagetti code.
Be forewarned that g77 compiles with the ANSI Fortran 77 standard exactly... right down to the 72 char limit on lines and restrictions on indentation. sigh images/icons/wink.gif If this legacy code used compiler specific "enhancements" not standard in Fortran 77 there could be troubles. Hopefully whoever wrote the original code had the foresight to make the code portable, but some developers find it very difficult to resist the Siren's song of the proprietary goddess. images/icons/smile.gif
If you're wondering what my point is, find some guy with g77 on his machine already (it doesn't have to be a Mac) and see how the compilation of your existing code goes.
Do you have any idea how a program compiled using GNU Fortran ---
g77 is rather good, but it is slower. This, however, is not the real issue: the absolute fastest Intel system is faster than the absolute fastest Mac system, so even with equally efficient compilers a program on Intel is still faster, usually.
Of course, usually this is a non-issue since desktop machines, whether they be Mac or PC, are just used for the development of the code, not for it's use on the really hard problems. It's never been a problem for me personally but I don't know the particulars of your situation.
#6
Posted 26 November 2002 - 09:08 AM
The old code I am talking about runs now on Windows and on SGs. The original coders though a GO TO was pretty advanced stuff. It doesn't do anything fancy.
We actually run this code on laptops, desktops and SGs. Some of the PCs are actually faster than the (less than top-of-the-line) SGs, and in some cases actually faster than an old Cray. The code is very linear. It is virtually impossible to get anything parallel in it, even with extensive rewriting, and we can't do that because the maintainers distribute new versions every year or so and we would be faced with big mods every time. So we are stuck with the inefficient code and rely on faster processors. Some of my coworkers run this code on 800 MHz or so machines and it's OK, so I guess a 1GHz Tibook or maybe even an 800 mHz iBook would be acceptable.
#8
Posted 04 December 2002 - 01:58 PM
Congratulations on the new addition to your Mac family!



Sign In
Register
Help


MultiQuote