(?) The Answer Gang (!)


By Jim Dennis, Ben Okopnik, Dan Wilder, the Editors of Linux Gazette... and You!
Send questions (or interesting answers) to linux-questions-only@ssc.com


(?) Fortran Compiler

From Yvonne Swagg

Answered By Dan Wilder, Jim Dennis

Hi there,
I have read that Linux has a compiler for fortran but cannot find it in the OS. Is it the GNU software that does it and could you please tell me what extension I would save my file as? You help would be greatly appreciated.

Yvonne

(!) [Dan] Part of what is now called the Gnu Compiler Collection, gcc. Which includes C, C++, Objective C, Fortran, and others I no doubt fail at the moment to recall.
Fortran may be invoked as
g77
on source files with suffix ".f", ".for", or ".FOR".
If g77 is not installed on your machine, check your distribution; it is quite likely present in the distribution.
(!) [JimD] A couple of years ago I had a group of rocket scientist (aeronautics engineers, actually) who asked me to come in and help this with a little old dual processor Linux box which was only staying up for about a week at a time. (That's an abysmal stability record for Linux).
They were running a 2.0.x kernel with SMP enabled on thing; which was never a good idea. I fetched and built a newer kernel and it was fine (it was a beta/developmental kernel --- but even those usually give much better uptimes than 1 week; so I didn't consider it to be much of a risk. The box was used solely for computation; so no other services or files were at risk.
Anyway, the manager there explained to me that the engineers in his group all wanted to use this particular machine instead of their Sun UltraSPARCs, their HP's and their other RISC boxes --- because they had found that the best Fortran compiler for them was from NAG (Numerical Algorithms Group: http://www.nag.com). NAG makes a commercial Fortran compiler and a number of libraries and other software products.
So, yes. There are fortran compilers for Linux.
There is a GNU fortran compiler; which is called g77; this is a Fortran '77 compiler which produces an intermediate code and then uses gcc to produce the optimized machine binaries. (http://www.gnu.org/software/fortran/fortran.html). It's apparently considered to be part of the GCC (GNU compiler collection) at this point. I'm not qualified to comment on wether g77 is any good, or how closely it conforms to the 1977 ANSI specification or anything like that. I notice that some of the Fortran '90 enhancements are supported, so g77 is as archaic as the '77 might imply).

(?) Thanks very much for your help! I was about to try that to see if it worked. I do not believe the g77 is installed on my system. I still have to apply the Errata updates, maybe then it will install the g77.

Yvonne


This page edited and maintained by the Editors of Linux Gazette Copyright © 2001
Published in issue 64 of Linux Gazette March 2001
HTML script maintained by Heather Stern of Starshine Technical Services, http://www.starshine.org/


[ Answer Guy Current Index ] greetings   1   2   3   4   6   7   9 [ Index of Past Answers ]
11   12   15   16   18
20   22   24   25   26   28   29