FORTRAN 90

Toon Moene toon@moene.indiv.nluug.nl
Fri Sep 22 11:24:00 GMT 2000


Michael Fothergill wrote:

> Does anyone know if gcc can be persuaded successfully to compile
> FORTRAN 90?

It can't, safe for the fact that all of FORTRAN 77 is valid Fortran 90.

> The documentation on the website suggests this is really on the TODO
> list for the compiler, but there is some kind of F90 option which
> makes the program recognize FORTRAN 90 like code....
> 
> Does anyone know how good it is?

-ff90 merely implies that in the case there is a choice between
interpreting a certain construct in the strict Fortran 90 way and in a
way provided as an extension, the first interpretation will be chosen.

> Also in the documentation you get with it (I am using Red Hat Linux on
> a new PC version 6.2) where does it actually tell you how to run the
> compiler especially with fairly sophisticated makefiles with biggish
> main and sub programs????
> 
> Most of the stuff I can find in the directories I installed e.g. gcc
> FAQ doesn't even tell you the simplest ways to use the compiler, it
> doesn't simply list the names of the different executables in
> usr/local/bin and tell you what they do...
> 
> I don't care if it is being developed  in a bazaar or cathedral format
> etc., I just want to know how to use it to compile a complicated
> algorithm with hundreds of subroutines doing a molecular dynamics
> calculation.

Well, you can just use it like any other compiler on a Unix-like system,
i.e.:

g77 -c foo.f

compiles a single source file to an object file.

g77 foo.f

compiles a single source file to an executable file, which can be run by
issuing the command:

./a.out

g77 -o foo foo.f

compiles the file into the executable foo, which is the same as a.out
above.

Hope this helps,

-- 
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
GNU Fortran 95: http://g95.sourceforge.net/ (under construction)


More information about the Gcc-help mailing list