|
Fortran on TuringWhat Compilers are availableMany different compilers exist for the Fortran computer language. The two main flavors of Fortran are Fortran 77 and Fortran 90. Each of these has separate compilers and the user must decide which flavor and compiler to use. Turing has three different Fortran compilers available. For Fortran 77, Turing has the Portland Group's pghpf (High Performance Fortran Compiler), the GNU compiler g77, APOGEE's Fortran 77 compiler. To compile code for Fortran 90, Turing has APOGEE's Fortran 90 compiler.
Like most other languages, Fortran source code is ASCII text that is compiled into executable machine code. Use your favorite text editor to put the text into a file with the appropriate file extension. Fortran is picky about file extensions because it uses these to decide which type of code it is trying to compile. In general, use the extensions listed here for each different compiler. This will keep you file naming scheme consistent and later on you will know which compiler the code is written for.
Compiling with pghpf (Portland Group's Compiler)The command to compile Fortran code using the Portland Group's compiler is pghpf.
GNU CompilersThe command to invoke the GNU compiler for Fortran 70 is g77. The basic commands to compile Fortran code are the same for GNU Fortran and the Portland groups compiler.
APOGEE CompilersTuring has APOGEE's Fortran 90 compiler and Fortran 77 compiler. The programs are called apf90 and apf77, respectively. The basic commands are the same as those for the Portland Compiler and the GNU compiler. Here is a quick summary:
Running your Program
Other resourcesThis page is not the only resource on the compilers. Try the man pages for information on compiler specific switches and other interesting facts. Below are a few good manuals found on the web that I used to write this qref. They contain much more in depth information about using Fortran.The Portland Group maintains an excellent web site with a online manual. This manual covers everything a person every wanted to know about Fortran and much more. The manual is available at http://www.pgroup.com/hpf_docs/pghpf_ug/hpfug03.htm The man pages available with UNIX list all of the switches and options available for each compiler. These are a good reference for debugging commands and other switches. When in doubt, ask someone. Some of the staff members know Fortran and can probably help you. Copyright (c) HMC Computer Science Department.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1
or any later version published by the Free Software Foundation;
with the no Invariant Sections, with no
Front-Cover Texts, and with no Back-Cover Texts.
A copy of the license is included in the section entitled ``GNU Free Documentation License.''
HMC Computer Science Department Contact Information |