JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris Studio 12.2: Fortran User's Guide
search filter icon
search icon

Document Information

Preface

1.  Introduction

2.  Using Solaris Studio Fortran

3.  Fortran Compiler Options

3.1 Command Syntax

3.2 Options Syntax

3.3 Options Summary

3.3.1 Commonly Used Options

3.3.2 Macro Flags

3.3.3 Backward Compatibility and Legacy Options

3.3.4 Obsolete Option Flags

3.4 Options Reference

3.4.1 -aligncommon[={1|2|4|8|16}]

3.4.2 -ansi

3.4.3 -arg=local

3.4.4 -autopar

3.4.5 -B{static|dynamic}

3.4.6 -C

3.4.7 -c

3.4.8 -copyargs

3.4.9 -Dname[=def]

3.4.10 -dalign

3.4.11 -dbl_align_all[={yes|no}]

3.4.12 -depend[={yes|no}]

3.4.13 -dn

3.4.14 -dryrun

3.4.15 -d{y|n}

3.4.16 -e

3.4.17 -erroff[={%all|%none|taglist}]

3.4.18 -errtags[={yes|no}]

3.4.19 -errwarn[={%all|%none|taglist}]

3.4.20 -ext_names=e

3.4.21 -F

3.4.22 -f

3.4.23 -f77[=list]

3.4.24 -fast

3.4.25 -fixed

3.4.26 -flags

3.4.27 -fma={none|fused}

3.4.28 -fnonstd

3.4.29 -fns[={yes|no}]

3.4.30 -fpover[={yes|no}]

3.4.31 -fpp

3.4.32 -fprecision={single|double|extended}

3.4.33 -free

3.4.34 -fround={nearest|tozero|negative|positive}

3.4.35 -fsimple[={1|2|0}]

3.4.36 -fstore

3.4.37 -ftrap=t

3.4.38 -G

3.4.39 -g

3.4.40 -hname

3.4.41 -help

3.4.42 -Ipath

3.4.43 -i8

3.4.44 -inline=[%auto][[,][no%]f1,...[no%]fn]

3.4.45 -iorounding[={compatible|processor-defined}]

3.4.46 -keeptmp

3.4.47 -Kpic

3.4.48 -KPIC

3.4.49 -Lpath

3.4.50 -lx

3.4.51 -libmil

3.4.52 -loopinfo

3.4.53 -Mpath

3.4.54 -m32 | -m64

3.4.55 -moddir=path

3.4.56 -mt[={yes|no}]

3.4.57 -native

3.4.58 -noautopar

3.4.59 -nodepend

3.4.60 -nofstore

3.4.61 -nolib

3.4.62 -nolibmil

3.4.63 -noreduction

3.4.64 -norunpath

3.4.65 -O[n]

3.4.66 -O

3.4.67 -O1

3.4.68 -O2

3.4.69 -O3

3.4.70 -O4

3.4.71 -O5

3.4.72 -o name

3.4.73 -onetrip

3.4.74 -openmp

3.4.75 -p

3.4.76 -pad[=p]

3.4.77 -pg

3.4.78 -pic

3.4.79 -PIC

3.4.80 -Qoption pr ls

3.4.81 -qp

3.4.82 -R ls

3.4.83 -r8const

3.4.84 -recl=a[,b]

3.4.85 -reduction

3.4.86 -S

3.4.87 -s

3.4.88 -sb

3.4.89 -sbfast

3.4.90 -silent

3.4.91 -stackvar

3.4.92 -stop_status[={yes|no}]

3.4.93 -temp=dir

3.4.94 -time

3.4.95 -traceback[={%none|common|signals_list}]

3.4.96 -U

3.4.97 -Uname

3.4.98 -u

3.4.99 -unroll=n

3.4.100 -use=list

3.4.101 -V

3.4.102 -v

3.4.103 -vax=keywords

3.4.104 -vpara

3.4.105 -w[n]

3.4.106 -Xlist[x]

3.4.107 -xaddr32[={yes|no}]

3.4.108 -xalias[=keywords]

3.4.109 -xannotate[={yes|no}]

3.4.110 -xarch=isa

3.4.110.1 Special Cautions for x86/x64 Platforms:

3.4.111 -xassume_control[=keywords]

3.4.112 -xautopar

3.4.113 -xbinopt={prepare | off}

3.4.114 -xcache=c

3.4.115 -xcheck=keyword

3.4.116 -xchip=c

3.4.117 -xcode=keyword

3.4.117.1 Position-Independent Code:

3.4.118 -xcommonchk[={yes|no}]

3.4.119 -xcrossfile[={1|0}]

3.4.120 -xdebugformat={dwarf|stabs}

3.4.121 -xdepend

3.4.122 -xF

3.4.123 -xfilebyteorder=options

3.4.123.1 Examples:

3.4.123.2 Notes:

3.4.124 -xhasc[={yes|no}]

3.4.125 -xhelp={readme|flags}

3.4.126 -xhwcprof[={enable | disable}]

3.4.127 -xia[={widestneed|strict}]

3.4.128 -xinline=list

3.4.129 -xinstrument=[%no]datarace

3.4.130 -xinterval[={widestneed|strict|no}]

3.4.131 -xipo[={0|1|2}]

3.4.132 -xipo_archive[={none|readonly|writeback}]

3.4.133 -xivdep[=p]

3.4.134 -xjobs=n

3.4.135 -xkeepframe[=[%all,%none,name,no%name]]

3.4.136 -xknown_lib=library_list

3.4.137 -xl

3.4.138 -xlang=f77

3.4.139 -xld

3.4.140 -xlibmil

3.4.141 -xlibmopt

3.4.142 -xlic_lib=sunperf

3.4.143 -xlicinfo

3.4.144 -xlinkopt[={1|2|0}]

3.4.145 -xloopinfo

3.4.146 -xmaxopt[=n]

3.4.147 -xmemalign[=<a><b>]

3.4.148 -xmodel=[small | kernel | medium]

3.4.149 -xnolib

3.4.150 -xnolibmil

3.4.151 -xnolibmopt

3.4.152 -xOn

3.4.153 -xopenmp[={parallel|noopt|none}]

3.4.154 -xpad

3.4.155 -xpagesize=size

3.4.156 -xpagesize_heap=size

3.4.157 -xpagesize_stack=size

3.4.158 -xpec[={yes|no}]

3.4.159 -xpg

3.4.160 -xpp={fpp|cpp}

3.4.161 -xprefetch[=a[,a]]

3.4.161.1 Defaults:

3.4.161.2 Interactions:

3.4.161.3 Warnings:

3.4.162 -xprefetch_auto_type=indirect_array_access

3.4.163 -xprefetch_level={1|2|3}

3.4.164 -xprofile=p

3.4.165 -xprofile_ircache[=path]

3.4.166 -xprofile_pathmap=collect_prefix:use_prefix

3.4.167 -xrecursive

3.4.168 -xreduction

3.4.169 -xregs=r

3.4.170 -xs

3.4.171 -xsafe=mem

3.4.172 -xsb

3.4.173 -xsbfast

3.4.174 -xspace

3.4.175 -xtarget=t

3.4.175.1 Generic and Native Platforms

3.4.175.2 SPARC Platforms

3.4.175.3 x86 Platforms

3.4.176 -xtime

3.4.177 -xtypemap=spec

3.4.178 -xunroll=n

3.4.179 -xvector[= [[no%]lib, [no%]simd, %none] ]

3.4.180 -ztext

4.  Solaris Studio Fortran Features and Differences

5.  FORTRAN 77 Compatibility: Migrating to Solaris Studio Fortran

A.  Runtime Error Messages

B.  Features Release History

C.  Fortran Directives Summary

Index

3.3 Options Summary

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.

Note that not all options are available on both SPARC and x64/x86 platforms. Check the detailed reference section for availability.

The following table summarizes the f95 compiler options by functionality. The table does not include obsolete and legacy option flags. Some flags serve more than one purpose and appear more than once.

Table 3-3 Compiler Options Grouped by Functionality

Function
Option Flag
Compilation Mode:
Compile only; do not produce an executable file
-c
Show commands built by the driver but do not compile
-dryrun
Support Fortran 77 extensions and compatibility
-f77
Retains the temporary files that are created during compilation.
-keeptmp
Specify path for writing compiled .mod Module files
-moddir=path
Specify name of object, library, or executable file to write
-o filename
Compile and generate only assembly code
-S
Strip symbol table from executable
-s
Suppress compiler messages, except error messages
-silent
Define path to directory for temporary files
-temp=path
Show elapsed time for each compilation phase
-time
Show version number of compiler and its phases
-V
Verbose messages
-v
Specify non-standard aliasing situations
-xalias=list
Compile with multiple processors
-xjobs=n
Compiled Code:
Add/suppress trailing underscores on external names
-ext_names=x
Inline specified user functions
-inline=list
Compile position independent code
-KPIC/-kpic
Inline certain math library routines
-libmil
STOP returns integer status value to shell
-stop_status[=yn]
Specify code address space
-xcode=x
Enable prefetch instructions
-xprefetch[=x]
Specify use of optional registers
-xregs=x
Specify default data mappings
-xtypemap=x
Data Alignment:
Specify alignment of data in COMMON blocks
-aligncommon[=n]
Force COMMON block data alignment to allow double word fetch/store
-dalign
Force alignment of all data on 8-byte boundaries
-dbl_align_all
Align COMMON block data on 8-byte boundaries
-f
Specify memory alignment and behavior
-xmemalign[=ab]
Debugging:
Enable runtime subscript range checking
-C
Compile for debugging with dbx
-g
Flag use of undeclared variables
-u
Check !$PRAGMA ASSUME assertions
-xassume_control=check
Check for stack overflow at runtime
-xcheck=stkovf
Enable runtime task common check
-xcommonchk
Compile for Performance Analyzer
-xF
Generate cross-reference listings
-Xlistx
Enable debugging without object files
-xs
Diagnostics:
Flag use of non-standard extensions
-ansi
Suppress named warning messages
-erroff=
Display error tag names with error messages
-errtags
Show summary of compiler options
-flags, -help
Show version number of the compiler and its phases
-V
Verbose messages
-v
Verbose parallelization messages
-vpara
Show/suppress warning messages
-wn
Display compiler README file
-xhelp=readme
Licensing:
Show license server information
-xlicinfo
Linking and Libraries:
Allow/require dynamic/static libraries
-Bx
Allow only dynamic/static library linking
-dy, -dn
Build a dynamic (shared object) library
-G
Assign name to dynamic library
-hname
Add directory to library search path
-Lpath
Link with library libname.a or libname.so
-lname
Do not build library search path into executable.
-norunpath
Build runtime library search path into executable
-Rpath
Disable use of incremental linker, ild
-xildoff
Link with optimized math library
-xlibmopt
Link with Sun Performance Library
-xlic_lib=sunperf
Link editor option
-zx
Generate pure libraries with no relocations
-ztext
Numerics and Floating-Point:
Use non-standard floating-point preferences
-fnonstd
Select non-standard floating point
-fns
Enable runtime floating-point overflow during input
-fpover
Select IEEE floating-point rounding mode
-fround=r
Select floating-point optimization level
-fsimple=n
Select floating-point trapping mode
-ftrap=t
Specify rounding method for formatted input/output
-iorounding=mode
Promote single precision constants to double precision
-r8const
Enable interval arithmetic and set the appropriate floating-point environment (includes -xinterval)
-xia[=e]
Enable interval arithmetic extensions
-xinterval[=e]
Optimization and Performance:
Analyze loops for data dependencies
-depend
Optimize using a selection of options
-fast
Specify optimization level
-On
Pad data layout for efficient use of cache
-pad[=p]
Allocate local variables on the memory stack
-stackvar
Enable loop unrolling
-unroll[=m]
Enable optimization across source files
-xcrossfile[=n]
Invoke interprocedural optimizations pass
-xipo[=n]
Set highest optimization level for #pragma OPT
-xmaxopt[=n]
Compile for post-compilation optimizations
-xbinopt=prepare
Enable/adjust compiler generated prefetch instructions
-xprefetch=list
Control automatic generation of prefetch instructions
-xprefetch_level=n
Enable generation or use of performance profiling data
-xprofile=p
Assert that no memory-based traps will occur
-xsafe=mem
Do no optimizations that increase code size
-xspace
Generate calls to vector library functions automatically
-xvector[=yn]
Parallelization:
Enable automatic parallelization of DO loops
-autopar
Show loop parallelization information
-loopinfo
Compile for hand-coded multithreaded programming
-mt
Accept OpenMP API directives and set appropriate environment
-xopenmp[=keyword]
Recognize reduction operations in loops with automatic parallelization
-reduction
Verbose parallelization messages
-vpara
Source Code:
Define preprocessor symbol
-Dname[=val]
Undefine preprocessor symbol
-Uname
Accept extended (132 character) source lines
-e
Apply preprocessor to .F and/or .F90 and .F95 files but do not compile
-F
Accept Fortran 95 fixed-format input
-fixed
Preprocess all source files with the fpp preprocessor
-fpp
Accept Fortran 95 free-format input
-free
Add directory to include file search path
-Ipath
Add directory to module search path
-Mpath
Recognize upper and lower case as distinct
-U
Tread hollerith as character in actual arguments
-xhasc={yes|no}
Select preprocessor, cpp or fpp, to use
-xpp[={fpp|cpp}]
Allow recursive subprogram calls
-xrecursive
Target Platform:
Specify memory model, 32 or 64 bits.
-m32 | —m64
Specify target platform instruction set for the optimizer
-xarch=a
Specify target cache properties for optimizer
-xcache=a
Specify target processor for the optimizer
-xchip=a
Specify target platform for the optimizer
-xtarget=a

3.3.1 Commonly Used Options

The compiler has 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-4 Commonly Used Options

Action
Option
Debug—global program checking across routines for consistency of arguments, commons, and so on.
–Xlist
Debug—produce additional symbol table information to enable the dbx and debugging.
–g
Performance—invoke the optimizer to produce faster running programs.
–O[n]
Performance—Produce efficient compilation and run times for the native platform, using a set of predetermined options.
–fast
Dynamic (–Bdynamic) or static (–Bstatic) library binding.
–Bx
Compile only—Suppress linking; make a .o file for each source file.
–c
Output file—Name the executable output file nm instead of a.out.
–o nm
Source code—Compile fixed format Fortran source code.
-fixed

3.3.2 Macro Flags

Some option flags are macros that expand into a specific set of other flags. These are provided as a convenient way to specify a number of options that are usually expressed together to select a certain feature.

Table 3-5 Macro Option Flags

Option Flag
Expansion
-dalign
-xmemalign=8s -aligncommon=16
-f
-aligncommon=16
-fast
See description of —fast for complete current expansion.
-fnonstd
-fns -ftrap=common
-xia=widestneed
-xinterval=widestneed -ftrap=%none -fns=no -fsimple=0
-xia=strict
-xinterval=strict -ftrap=%none -fns=no -fsimple=0
-xtarget
-xarch=a -xcache=b -xchip=c

Settings that follow the macro flag on the command line override or add to the the expansion of the macro.

3.3.3 Backward Compatibility and Legacy Options

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

Table 3-6 Backward Compatibility Options

Action
Option
Preserve actual arguments over ENTRY statements
-arg=local
Allow assignment to constant arguments.
–copyargs
Treat hollerith constant as character or typeless in call argument lists.
-xhasc[={yes|no}]
Support Fortran 77 extensions and conventions
-f77
Nonstandard arithmetic—allow nonstandard arithmetic.
–fnonstd
Optimize performance for the host system.
–native
DO loops—use one trip DO loops.
–onetrip
Allow legacy aliasing situations
-xalias=keywords

Use of these option flags is not recommended for producing portable Fortran programs.

3.3.4 Obsolete Option Flags

The following options are considered obsolete and should not be used. They might be removed from later releases of the compiler.

Table 3-7 Obsolete f95 Options

Option Flag
Equivalent
-a
-xprofile=tcov
-cg89
-xtarget=ss2
-cg92
-xtarget=ss1000
-native
-xtarget=native
-noqueue
License queueing. No longer needed.
-p
Profiling. Use -pg or the Performance Analyzer
-pic
-xcode=pic13
-PIC
-xcode=pic32
-sb
Ignored.
-sbfast
Ignored.
-silent
Ignored.
-xarch={v7,v8,v8a}
Use —m32