7

Does anyone know a compiler for Fortran 77 available as a free download?

I have pre-written 77 code from a source published in the early 90's that I just need to compile, build, and run. But I don't know enough about Fortran to update it myself.

user5246
  • 71
  • 1
  • 2

4 Answers4

19

GFortran is free and open source and usually works pretty well.

Bill Barth
  • 10,905
  • 1
  • 21
  • 39
  • 1
    On Linux you can also use Open64 and Solaris Studio for free. The latter also has some useful tools (dbx, analyzer etc). – stali Sep 26 '13 at 21:45
  • make sure you read the documentation on gfortran for source code file extensions. – user7257 Jun 26 '14 at 14:43
8

While not as free or available as GFortran that Bill mentions, the Intel Fortran Compiler also works F77 (or atleast works for the legacy code I work with). I am just putting this here to give an alternative, I would still recomment GFortran for most use cases simply due to the cost of ifort.

Godric Seer
  • 4,637
  • 2
  • 23
  • 38
  • 4
    One could note that if it is for a non-commercial use, Intel Fortran Compilers can be downloaded and used for free. However, public research is considered as a commercial use for Intel. – MBR Sep 27 '13 at 16:17
  • 1
    @MBR: I think you should read their license more carefully. I believe it says that if the use is educational, you can get a free license. Research is not education. They really mean classroom and homework only. – Bill Barth Sep 28 '13 at 14:14
  • If you are paid for the teaching, it is commercial activity. At least in this licence. – Vladimir F Героям слава Sep 30 '13 at 10:37
  • @BillBarth: well, I didn't say the contrary. As soon as you're paid for your job, it is considered as a commercial use. – MBR Oct 01 '13 at 08:38
4

G95 is another alternative free fortran compiler, available for quite a few platforms. I think it is a bit easier to install on Windows compared to Gfortran (the OP did not mention what platform they were interested in).

http://g95.org/

G95 has seen less updating and maintenance compared to Gfortran (whihch is part of the main GCC distribution since 4.0), but if you just need F77, G95 should work great. Gfortran actually began as a fork of G95.

Kris Kuhlman
  • 246
  • 1
  • 2
1

Disclaimer: I'm about to make statements based on my own experience, so it may not necessarily be true for your situation.

In my experience, gFortran is a strict compiler when it comes to fortran 77. If the code is written according to the F77 language standard, then everything should work out. This doesn't seem to be the case very often in code obtained from textbooks and other sources, especially in my field (mechanical engineering, fluid structure interaction, dynamics, FEM, CFD). There were many situations where code obtained verbatim from these sources would either not compile, or result in confusing error messages at runtime. Switching to PGFortran or Ifort always seemed to solve the problem.

This has happened to me with code from:

  • Ferziger, Joel H., and Milovan Perić. Computational methods for fluid dynamics. Vol. 3. Berlin: Springer, 2002.
  • Cebeci, Tuncer. Analysis of turbulent boundary layers. Elsevier, 2012.

To summarize, if for some reason gFortran doesn't work out, don't hesitate to try other fortran compilers as well. Alternatively, you can try the various flags to make gFortran a bit less strict.

Salim
  • 165
  • 2
  • 8