Fortran User's Guide

Options Summaries

In this section, the compiler options are grouped by function to provide an easy reference. The details will be found on the pages in the following sections, as indicated.

Commonly Used Options

The Sun Fortran compilers have many features that are selectable by optional command-line parameters. The short list below of commonly used options is a good place to start.          

Table 3-3 Commonly Used Options

Action 

Option 

   Details 

Debug--global program checking across routines for consistency of arguments, commons, and so on. 

 -Xlist

"-Xlist[x]"

Debug--produce additional symbol table information to enable the dbx and Sun WorkShop debugger.

 -g

"-g"

Performance--invoke the optimizer to produce faster running programs. 

-O[n]

"-O[n]"

 

Performance--produce efficient compilation and run times for the native platform, using a set of predetermined options 

 -fast

"-fast"

 

Bind as dynamic (or static) any library listed later in the command: -Bdynamic, -Bstatic

 -Bx

" -B{static|dynamic}"

Library--Allow or disallow dynamic libraries for the entire executable: -dy, -dn

 -dx

"-d{y|n}"

Compile only--Suppress linking; make a .o file for each source file.

 -c

"-c"

Output file--Name the executable output file nm instead of a.out.

 -o nm

"-o nm"

Profile--Profile by procedure for gprof.

 -pg

"-pg"

Debugging Options

The following options aid program debugging, including post-mortem, runtime, and static source code analysis. The most useful are listed first.

Table 3-4 Debugging Options 

Action 

Option 

Details 

Compile for use with the debugger. 

-g

"-g"

Global source program checking for consistency. 

-Xlist

"-Xlist[x]"

Check for subscripts out of range. 

-C

"-C"

Undeclared variables--show a warning message. 

-u

"-u"

Version ID--show ID along with name of each compiler pass. 

-V

"-V"

Enable VMS Fortran `D' debugging statements with -vax=debug.

-vax=v

"-vax=v"

Allow debugging by dbx without .o files.

-xs

"-xs"

Floating-Point Options

For the following floating-point options, the most significant are listed first.

Table 3-5 Floating-Point Options

Action 

Option 

Details 

Turn on SPARC nonstandard floating-point (SPARC)

 -fns

"-fns[={no|yes}]"

Set IEEE rounding mode in effect at startup

 -fround=r

"-fround=r"

Set IEEE trapping mode in effect at startup 

 -ftrap=t

"-ftrap=t"

Set floating-point optimization preferences 

 -fsimple=n

"-fsimple[=n]"

Se floating-point precision 

 -fprecision=p

"-fprecision=p"

Library Options

For the following library linking options, the most useful are listed first.

Table 3-6 Library Options 

Action 

Option 

Details 

Bind as dynamic or static next library listed on command. 

-Bx

" -B{static|dynamic}"

Allow or disallow dynamic libraries for executable. 

-dx

"-d{y|n}"

Build a dynamic shared library. 

-G

" -G"

Search for libraries in this directory first. 

-Ldir

"-Ldir"

Link with library libx.

-lx

"-lx"

Link with the SunWorkShop Performance Library 

 -xlic_lib=sunperf

" -xlic_lib=libs"

Multithread safe libraries, low level threads.

-mt

"-mt"

No automatic libraries. 

-nolib

"-nolib"

No inline templates. 

-nolibmil

"-nolibmil"

No run path in executable. 

-norunpath

"-norunpath"

Library--do not make library if relocations remain. 

-ztext

"-ztext"

Licensing Options

The following options are for licensing.

Table 3-7 Licensing Options 

Action 

Option 

Details 

Do not queue the license request. 

-noqueue

"-noqueue"

Show license server user IDs. 

-xlicinfo

"-xlicinfo"

Performance Options

For the following performance options, those with the greatest significance are listed first.

Table 3-8 Performance Options 

Action 

Option 

Details 

Faster execution and compilation on native platform by using a set of options. 

-fast

"-fast"

Optimize performance--set optimization level 

-O[n]

"-O[n]"

Specify target hardware system. 

-xtarget=t

"-xtarget=t"

Collect or use data for a profile to optimize (SPARC).

-xprofile=p

"-xprofile=p"

Align COMMON block data and enable multi-word load/stores. (SPARC)

-dalign

"-dalign"

Arithmetic--use simple arithmetic model. 

-fsimple

"-fsimple[=n]"

Arithmetic--use SPARC non-standard floating point (SPARC).

 -fns

"-fns[={no|yes}]"

Use inline library 

-libmil

"-libmil"

Traps--assume no memory-based traps (SPARC).

-xsafe=mem

"-xsafe=mem"

Unroll loops--advise optimizer to unroll loops n times.

-unroll=n

"-unroll=n"

Fast math--use special fast math routines (SPARC).

-xlibmopt

" -xlibmopt"

Architecture--specify target instruction set. 

-xarch=a

"-xarch=a"

Chip--specify target processor.

-xchip=c

"-xchip=c"

Check data dependencies--analyze loops (SPARC).

-depend

"-depend"

Inline the listed user routines to optimize for speed. 

-inline=rlst

"-inline=f1[,...fn]"

Optimize across all source files on command line 

-xcrossfile

" -xcrossfile [=n]"

Do no optimizations that increase code size.

-xspace

"-xspace"

Parallelization Options

For the following parallelization options, those with the greatest impact in most situations are listed first.Parallelization options require a Sun WorkShop license. See the Fortran README files for details

Table 3-9 Parallelization Options (SPARC

Action 

Option 

Details 

Parallelize with -autopar -explicitpar -depend.

-parallel

"-parallel"

Parallelize explicitly marked loops. 

-explicitpar

"-explicitpar"

Parallelize "reduction" loops. 

-reduction

"-reduction"

Parallelize loops automatically. 

-autopar

" -autopar"

Specify the style for MP directives (cray or sun).

-mp=x

" -mp={sun|cray}"

Prepare loops for profiling parallelization. 

-Zlp

"-Zlp"

List which loops are successfully parallelized.

-loopinfo

"-loopinfo"

Stack local variables to optimize for parallelization. 

-stackvar

"-stackvar"

Show warnings about parallelization. 

-vpara

"-vpara"

Profiling Options

The following options enable runtime profiling in the compiled program. Depending on the options, profiling is done at either the basic block, procedure, or loop level.

Table 3-10 Profiling Options 

Action--Enable Profiling by: 

Option 

Details 

Basic block (using tcov, old style).

-a

" -a"

Procedure (using gprof).

-pg

"-pg"

Procedure (using prof).

-p

"-p"

Loops with parallelization (SPARC).

-loopinfo

"-loopinfo"

Basic block (using tcov, new style).

-xprofile=tcov

"-xprofile=p"

Alignment Options

The following options are for specifying data alignment strategies.

Table 3-11 Alignment Options 

Action 

Option 

Details 

Align COMMON block data (SPARC).

-f

"-f"

Force 8-byte alignment on all data. 

 -dbl_align_all=yes

" -dbl_align_all=y"

Align COMMON data and use multi-word load/store. (SPARC)

 -dalign

"-dalign"

Allow misaligned data (SPARC).

-misalign

"-misalign"

Specify what VMS alignment features to use 

-vax=v

"-vax=v"

Backward Compatibility and Legacy Options

The following options are provided for backward compatibility with earlier compiler releases, and certain Fortran legacy capabilities.

Table 3-12 Backward Compatibility Options 

Action 

Option 

Details 

Double default data sizes: use -xtypemap instead.

-r8 or -dbl

"-xtypemap=spec"

Allow assignment to constant arguments. 

-copyargs

" -copyargs"

External names--make external names without underscores. 

-ext_names=e

" -ext_names=e"

Nonstandard arithmetic--allow nonstandard arithmetic. 

-fnonstd

"-fnonstd "

Optimize performance for the host system. 

-native

"-native"

Output--use old style list-directed output. 

-oldldo

"-oldldo"

DO loops--use one trip DO loops.

-onetrip

"-onetrip"

Obsolescent Options

The following options are no longer functional in the current release of the f77 and f90 compilers. Their appearance on a compiler command does not cause an error, and no action is taken; they are ignored.

Table 3-13 Obsolescent Options 

Original Intention 

Option 

Compile for Thread Analyzer 

-Ztha

Compile for f90browse (f90) 

 -db

Disable exception traps (f90) 

 -fnonstop