Go to main content
Oracle® Developer Studio 12.5: Fortran User's Guide

Exit Print View

Updated: June 2016
 
 

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 5  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
Do not replace a module file whose content is not changed by the compilation of the associated Fortran module
-keepmod
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
Generate make dependencies
-xM
(Oracle Solaris) Link debug information from object files into executable
-xs
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
(x86) Save copies of register-based function arguments in the stack
-preserve_argvalues
STOP returns integer status value to shell
-stop_status[=yn]
Specify code address space
-xcode=x
Equivalent to -inline
-xinline
Manually change the heuristics used by the compiler for deciding when to inline a function call
-xinline_param
Generate a report written to standard output on the inlining of functions by the compiler
-xinline_report
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
Support file sharing between little-endian and big-endian platforms.
-xfilebyteorder
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
Control how much debugging and observability information is emitted
-xdebuginfo
Compile for Performance Analyzer
-xF
Control globalization of file static variables but not functions
-xglobalize
Keep definitions of unreferenced functions and variables
-xkeep_unref
(Obsolete) 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
(Oracle Solaris) Link debug information from object files into executable
-xs
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 Oracle Developer Studio Performance Library
-xlic_lib=sunperf
Reserve an area of memory before the start of each function
-xpatchpadding
Specify whether the program contains references to dynamically bound symbols
-xunboundsym
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 that the program does not perform I/O in more than one thread at a time.
-fserialio
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]
Invoke interprocedural optimizations pass
-xipo[=n]
Reduce compile time by avoiding optimizations during the initial pass through the compiler, optimizing only at link time
-xipo_build
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
Cause the driver to include a special mapfile on the link line.
-xsegment_align
Do no optimizations that increase code size
-xspace
Specify that the application will be run in situations where many processes are simultaneously running on the system
-xthroughput
Generate calls to vector library functions automatically
-xvector[=yn]
Parallelization:
Enable automatic parallelization of DO loops
-autopar
Equivalent to -xopenmp=parallel
-fopenmp
Show loop parallelization information
-loopinfo
Compile for hand-coded multithreaded programming
-mt
Accept OpenMP API directives. The -xopenmp option flag accepts the following suboption keywords: parallel, noopt, and none.
-xopenmp[=keyword]
Recognize reduction operations in loops with automatic parallelization
-reduction
Verbose parallelization messages
-vpara
Specify that the application will be run in situations where many processes are simultaneously running on the system
-xthroughput
Source Code:
Define preprocessor symbol
-Dname[=val]
Undefine preprocessor symbol
-Uname
Accept extended (250 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 data type 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 6  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 7  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 8  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 9  Obsolete f95 Options
Option Flag
Equivalent
-a
-xprofile=tcov
-native
-xtarget=native
-noqueue
License queueing. No longer needed.
-p
Profiling. Use -pg or the Performance Analyzer
-pic
-xcode=pic13
-PIC
-xcode=pic32
-silent
Ignored.
-xarch={v7,v8,v8a}
Use —m32