GFortran

GFortran is the name of the GNU Fortran project, developing a free Fortran compiler for GCC, the GNU Compiler Collection. GFortran was forked from G95 in January 2003. GFortran 4.4 was released on April 21, 2009. The current development version is GFortran 4.5. When the GNU Fortran compiler is fnished, it will do everything you expect from any decent compiler:

connet Read a user’s program, stored in a fle and containing instructions written in Fortran 77, Fortran 90, Fortran 95 or Fortran 2003. This fle contains source code.

connet Translate the user’s program into instructions a computer can carry out more quickly than it takes to translate the instructions in the first place. The result after compilation of a program is machine code, code designed to be efciently translated and processed by a machine such as your computer. Humans usually aren’t as good writing machine code as they are at writing Fortran (or C++, Ada, or Java), because is easy to make tiny mistakes writing machine code.

connet Provide the user with information about the reasons why the compiler is unable to create a binary from the source code. Usually this will be the case if the source code is fawed. When writing Fortran, it is easy to make big mistakes. The Fortran 90 requires that the compiler can point out mistakes to the user. An incorrect usage of the language causes an error message. The compiler will also attempt to diagnose cases where the user’s program contains a correct usage of the language, but instructs the computer to do something questionable. This kind of diagnostics message is called a warning message.

connet Provide optional information about the translation passes from the source code to machine code. This can help a user of the compiler to fnd the cause of certain bugs which may not be obvious in the source code, but may be more easily found at a lower level compiler output. It also helps developers to fnd bugs in the compiler itself.

connet Provide information in the generated machine code that can make it easier to fnd bugs in the program (using a debugging tool, called a debugger, such as the GNU Debugger.

connet Locate and gather machine code already generated to perform actions requested by statements in the user’s program. This machine code is organized into modules and is located and linked to the user program.

The GNU Fortran compiler consists of several components:

connet A version of the gcc command (which also might be installed as the system’s cc command) that also understands and accepts Fortran source code. The gcc command is the driver program for all the languages in the GNU Compiler Collection (GCC); Withgcc, you can compile the source code of any language for which a front end is available in GCC.

connet The gfortran command itself, which also might be installed as the system’s f95 command. gfortran is just another driver program, but specifcally for the Fortran compiler only. The diference with gcc is that gfortran will automatically link the correct libraries to your program.

connet A collection of run-time libraries. These libraries contain the machine code needed to support capabilities of the Fortran language that are not directly provided by the machine code generated by the gfortran compilation phase, such as intrinsic functions and subroutines, and routines for interaction with fles and the operating system.

connet The Fortran compiler itself, (f951). This is the GNU Fortran parser and code generator, linked to and interfaced with the GCC backend library. f951 “translates” the source code to assembler code. You would typically not use this program directly; instead, the gcc or gfortran driver programs will call it for you.

The gfortran compiler actually started life known as g95, meant to replace the older and problematic g77 compiler. Somewhere along the development path, the project maintainer of g95 began violating the terms of the GNU compiler, namely only offering binary versions of the software. Because of the violations, some team members branched gfortran from an older g95 version and completed development of the compiler. A more thorough history can be found here. Long story short, the gfortran compiler is the GNU-supported Fortran 90 compiler. At this time, gfortran can be considered a "version 1" product, meaning some bugs may be present, but it is ready for the production environment. In the past the old GNU g77 compiler was often avoided for its lack of any language extensions, especially Cray pointers. The new gfortran now supports Cray pointers (as of version 4.2.0), a long-demanded feature. The GNU team also provides a compatability list to highlight the completeness of gfortran. In my experience, gfortran is quite capable of compiling complex programs involving heavy use of Fortran 90 pointers and user-defined types.