Skip to content, skip to search, or skip to navigation

How to use the FORTRAN compiler for Linux

Open Source Gnu Compilers g77 and gfortran

These are installed on most department Linux systems or upon request (also on Macs). g77 is a FORTRAN 77 compiler similar to f77. gfortran is a FORTRAN 95/2003 compiler. Most legacy code written for the Solaris f77 compiler will not compile by simply replacing f77 with g77 in the compile statement. This is because the Solaris f77 compiler was lenient about code standards. There are a number of command line options for g77 that relax the requirements for compilation.

Commercial Intel f90/f95 Compiler

All you need to do to use the Intel f90/95 compiler for
Linux is to

source /apps2/linux-apps/intel/fc/9.0/bin/ifortvars.csh

and then the compiler is


and it should be in your executable path.  Usage is

ifort [options] program_name.f[90]