Chapter 2. Compilers and Compiler Documentation

SGI supports several compiler and programming languages. This chapter discusses the different compilers and the documentation that supports those compilers. It covers the following topics:

All documentation mentioned in this chapter is available online or can be ordered. See the SGI Technical Publications Library at http://techpubs.sgi.com for details.

Fortran Compilers

SGI provides support for the FORTRAN 77 and Fortran 90 programming languages, as well as provides directives and extensions to each language.

There are two versions of each compiler, as discussed in the following subsections:

See these subsections for details about the documentation that supports each version of the compiler.

MIPSpro FORTRAN 77 and MIPSpro Fortran 90

MIPSpro FORTRAN 77 and MIPSpro Fortran 90 (sometimes called “MIPSpro 7 Fortran 90”) have been available on SGI systems since the mid-1990s. These compilers support the newer -n32 and -64 Application Binary Interface (ABI).

The following documentation is used with the Fortran 90 compiler:

  • The MIPSpro Fortran 90 Commands and Directives Reference Manual contains information about the command line options, the directives recognized by the compiler, the OpenMP API multiprocessing directives, source preprocessing, and the Auto-Parallelizing Option.

The following books describe the Fortran 90 language as implemented by SGI's MIPSpro Fortran 90 compiler.

  • The MIPSpro Fortran Language Reference Manual, Volume 1. Chapters 1 through 8 correspond to sections 1 through 8 of the Fortran standard.

  • The MIPSpro Fortran Language Reference Manual, Volume 2. Chapter 1 through 6 correspond to sections 9 through 14 of the standard.

  • The MIPSpro Fortran Language Reference Manual, Volume 3. This manual contains compiler information that supplements the standard. This volume also contains the complete Fortran syntax in Backus-Naur form (BNF).

The following books describe the FORTRAN 77 language as implemented by the MIPSpro Fortran 77 compiler:

  • The MIPSpro Fortran 77 Programmer's Guide describes SGI's implementation of the FORTRAN 77 standard. This book contains information about compiling, linking, and running programs; system functions and subroutines; and Fortran program interfaces.

  • The MIPSpro Fortran 77 Language Reference Manual describes the Fortran character set, constants and data structures, specification statements, assignment and data statements, and other elements of the FORTRAN 77 programming language.

In addition to these books, many man pages document the compilers, the libraries used with the compilers, and several of the tools used by the compilers (including f77(1), f90(1), f77.f90.difs(1), and intro_intrin(3i)). These man pages are shipped as part of the software and are available online using the man command.

Fortran 77 and Fortran 90

Prior to 1996, SGI provided support for the FORTRAN 77 and Fortran 90 programming languages. The older version of the FORTRAN 77 compiler supports only the older, o32 ABI. The older version of the Fortran 90 compiler supported the N32 and 64-bit ABI, but that compiler is based on older technology than the current MIPSpro Fotran 90 compiler.

The Fortran 77 Programmer's Guide and Fortran 77 Language Reference Manual document the older versions of the Fortran 77 compiler. The MIPSpro Fortran 90 Programmer's Guide documents the older Fortran 90 compiler.


Note: Documentation for the older compilers is in maintenance, and should not be considered current.

In addition to these books, the MIPS O32 Compiling and Performance Tuning Guide discusses tuning issues in the older, o32 compilers.

C and C++ Compilers

SGI provides support for the C and the C++ programming language. Like the Fortran programming language, SGI has different versions of C and C++:

  • The MIPSpro 32-bit version (invoked with cc -n32) and the MIPSpro 64-bit version (invoked with cc -64).

  • An older, “ucode” version of the compiler (invoked with cc -o32).

The N32 and 64-bit compilers accept a dialect of C++ that closely resembles the ANSI/ISO draft C++ standard. The 32-bit ucode compiler is still available, but it is no longer being enhanced. It is available to support legacy code.

The C++ compiler based on Cfront is still available but is no longer supported.

The following books document the newer versions of the C and C++ compilers:

  • The C++ Programmer's Guide describes SGI's implementation of the C++ standard. It discusses compiling and linking programs; dialect support; how to use templates; and how to transition from the older Cfront compiler.

  • MIPSpro C and C++ Pragmas describes all of the #pragma directives that are supported (including automatic parallelization, DSM optimization, inlining, loader, LNO, multiprocessing, precompiled header, scalar optimization, and warning suppression control pragmas).

  • The C Language Reference Manual contains a summary of the syntax and semantics of the C language as implemented at SGI. It contains an overview of ANSI C, descriptions of lexical conventions, a discussion of operator conversions, and other topics covered in the C standard.

  • The Standard Template Library Programmer's Guide contains information about STL. This documentation is available online at http://www.sgi.com/tech/stl.

In addition to these books, several man pages document the compilers and the compiler libraries (including cc(1) and cpp(1)).

Other Compilers

SGI provides support for several other programming languages:

  • Assembler, which is documented in the MIPSpro Assembly Language Programmer's Guide.

  • Pascal, which is documented in the Pascal Programming Guide

In addition to these books, several man pages document these products (including the as(1) man page).

The MIPSpro N32/64 Compiling and Performance Tuning Guide discusses writing assembly code for the N32 and 64-bit systems.