fort77 - Linux


fort77 is a Fortran 77 compiler for Linux systems. It enables developers to compile Fortran 77 source code into executable programs. Fortran 77 is a widely used language for scientific and engineering applications where high performance is crucial.


fort77 [options] [source_files]


  • -c: Compile only, do not link.
  • -g: Generate debugging information.
  • -o <output_file>: Specify the output file name.
  • -O <optimization_level>: Set optimization level (0-3).
  • -Wall: Enable all warnings.
  • -fno-output-dependencies: Disable file dependency checking.
  • -include : Include additional header search paths.
  • -L : Specify additional library search paths.


Simple Compilation:

fort77 hello.f

Compilation with Debugging Information:

fort77 -g hello.f

Compilation with Optimization:

fort77 -O3 hello.f

Common Issues

Missing Libraries:
If the compilation fails with errors related to missing libraries, ensure that the necessary libraries are installed on the system.

Incorrect Header Paths:
If the compilation fails with errors related to missing headers, verify the additional header search paths (-include) specified in the command.


Combining with Linkers:
To link the compiled object files into an executable, use the linker command:

ld -o <output_file> <object_files>

Related Commands

  • gcc: GNU C compiler
  • gfortran: GNU Fortran compiler
  • f2c: Converts Fortran 77 code to C