Sun Studio 12: Fortran Programming Guide

9.1.1.1 -fast

This single option selects a number of performance options.


Note –

This option is defined as a particular selection of other options that is subject to change from one release to another, and between compilers. Also, some of the options selected by -fast might not be available on all platforms. Compile with the -dryrun flag to see the expansion of -fast.


-fast provides high performance for certain benchmark applications. However, the particular choice of options may or may not be appropriate for your application. Use -fast as a good starting point for compiling your application for best performance. But additional tuning may still be required. If your program behaves improperly when compiled with -fast, look closely at the individual options that make up- fast and invoke only those appropriate to your program that preserve correct behavior.

Note also that a program compiled with -fast may show good performance and accurate results with some data sets, but not with others. Avoid compiling with-fast those programs that depend on particular properties of floating-point arithmetic.

Because some of the options selected by -fast have linking implications, if you compile and link in separate steps be sure to link with- fast also.

–fast selects the following options:

-fast provides a quick way to engage much of the optimizing power of the compilers. Each of the composite options may be specified individually, and each may have side effects to be aware of (discussed in the Fortran User’s Guide). Note also that the exact expansion of -fast may change with each compiler release. Compiling with -dryrun will show the expansion of all command-line flags.

Following -fast with additional options adds further optimizations. For example:

f95 -fast -m64 ...

compiles for a 64-bit enabled platform.

Because -fast invokes -dalign, -fns, -fsimple=2, programs compiled with- fast can result in nonstandard floating-point arithmetic, nonstandard alignment of data, and nonstandard ordering of expression evaluation. These selections might not be appropriate for most programs.