Sun Fortran Compiler Options |
3 |
This chapter details the command-line options for the f77 and f90 compilers running under Solaris 2.x. Features unique to one or more platforms are identified as "(SPARC)", "(Intel)", and/or "(PowerPC)". Features unique to one or the other compiler are marked "f77 only" or "f90 only". See the description of this multi-platform release in the Preface.
The general syntax of the compiler command line is:
f77 [options] list_of_files [-lx] |
f90 [options] list_of_files [-lx] |
Typical compiler option formats are:
Table 3-1 Options Syntax |
|
Syntax Format |
Example |
|
|
|
|
|
|
|
|
Some general guidelines for options are:
Source files, object files, and libraries are compiled and linked in the order in which they appear on the command line.
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.
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.
For the following debugging options, the most useful are listed first.
For the following floating-point options, the most significant are listed first.
For the following library linking options, the most useful are listed first.
The following options are for licensing.
Table 3-7 Licensing Options |
||
Action |
Option |
Details |
Do not queue the license request. | -noqueue | page 67 |
Show license server user IDs. | -xlicinfo | page 93 |
For the following performance options, those with the greatest significance are listed
first.
For the following parallelization options, those with the greatest impact in most
situations are listed first.Parallelization options require a WorkShop license. See the
Fortran README files for details
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.
The following options are for specifying data alignment strategies.
The following options are provided for backward compatibility with earlier compiler
releases, and certain Fortran legacy capabilities.
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.
The following table lists all the Fortran 77 and Fortran 90 compiler options, and
indicates any platform restrictions. The SPARC, PPC, and
Intel columns indicate availability of an option on SPARC, PowerPC, and
Intel Solaris 2.x systems, respectively:
Note that f90 1.2 is only available on SPARC systems.
The options reference section that follows gives full details and
examples for each option. (Obsolescent options are not listed; see page 32.)
This section shows all f77 and f90 compiler command-line option flags, including various risks, restrictions, caveats, interactions, examples, and other details. Each description indicates platform availability of the option, using the same legend as in the summary list,
page 33.Compile for Intel 80386.
SPARC: - PPC: - Intel:77 |
Generate code that exploits features available on Intel 80386 compatible processors.
The default is -386
.
Compile for Intel 80486.
SPARC: - PPC: - Intel:77 |
Generate code that exploits features available on Intel 80486 compatible processors.
The default is -386.
Code compiled with -486 does run on 80386
hardware, but it may run slightly slower.
Profile by basic block using tcov, old style.
SPARC:77 PPC:77 Intel:77 |
This is the old style of basic block profiling for tcov. See -xprofile=tcov for information on the new style of profiling and the tcov(1) man page for more details. Also see the manual, Performance Profiling Tools.
Insert code to count the times each basic block of statements is executed. This invokes a runtime recording mechanism that creates one .d file for every .f file at normal program termination. The .d file accumulates execution data for the corresponding source file. The tcov(1) utility can then be run on the source file(s) to generate statistics about the program. The summary output produced by tcov is written to file.tcov for each source file. -pg and gprof are complementary to -a and tcov. If set at compile-time, the TCOVDIR environment variable specifies the directory where the .d and .tcov files are located. If this variable is not set, then the .d files remain in the same directory as the .f files. The -xprofile=tcov and the -a options are compatible in a single executable. That is, you can link a program that contains some files which have been compiled with -xprofile=tcov, and others with -a. You cannot compile a single file with both options. If you compile and link in separate steps, and you compile with -a, then be sure to link with -a. You can mix -a with -On; in some earlier versions -a overrode -On. For details, see the chapter Performance Profiling in the Fortran Programmer's Guide.Identify many non-ANSI extensions.
SPARC: 77/90 PPC:77 Intel:77 |
Warning messages are issued for any uses of non-standard Fortran 77 or Fortran 90 extensions in the source code.
Preserve actual arguments over ENTRY
statements.
SPARC:77 PPC:77 Intel:77 |
When you compile a subprogram with alternate entry points with this option, f77
uses copy restore to preserve the association of dummy and actual arguments. For
example, the following program would require compilation with -arg=local
to
insure proper execution:
A = SETUP(ALPHA,BETA,GAMMA) ZORK = FXGAMMA(GCONST) ... FUNCTION SETUP(A1,A2,A3) ... ENTRY FXGAMMA(F) FXGAMMA = F*GAMMA ... RETURN END |
Enable automatic loop parallelization.
SPARC:77 PPC: - Intel: - |
Finds and parallelizes appropriate loops for running in parallel on multiple processors. Analyzes loops for inter-iteration data dependencies and loop restructuring. If the optimization level is not specified -O3 or higher, it will automatically be raised to -O3.
-g cancels-autopar
. Debugging is
facilitated by specifying -g
without any optimization or parallelization
options since not all debugging features are available when these options are invoked. See
the dbx documentation for details.
To improve performance, also specify the -stackvar
option when using any of the parallelization options, including -autopar
.
Avoid -autopar if the program already contains explicit
calls to the libthread threads library. See note with -mt
on page 65.
Refer to the Fortran: Programmer's Guide for more information on parallelization.
Allow dynamic or require static library linking.
SPARC: 77/90 PPC:77 Intel:77 |
No space is allowed between -B and dynamic or static.
The default, without -B
specified, is -Bdynamic
.
Also note:
You can toggle -Bstatic and -Bdynamic on the command line. That is, you can link some libraries statically and some dynamically by specifying -Bstatic and -Bdynamic any number of times on the command line.
These are loader and linker options. Compiling and linking in separate steps with -Bx on the compile command will require it in the link step as well.Check array references for out of range subscripts.
SPARC:77 PPC:77 Intel:77 |
Subscripting arrays beyond their declared sizes may result in unexpected results,
including segmentation faults. The -C
option checks for possible array
subscript violations in the source code and during execution.
-C
may make the executable file larger.
If the -C
option is used, array subscript violations
are treated as an error. If an array subscript range violation is detected in the source
code during compilation, it is treated as a compilation error.
If an array subscript violation can only be determined at runtime,
the compiler generates range-checking code into the executable program. This may cause an
increase in execution time. As a result, it is appropriate to enable full array subscript
checking while developing and debugging a program, then recompiling the final production
executable without subscript checking.
Compile only; produce object .o files, but suppress linking.
SPARC: 77/90 PPC:77 Intel:77 |
Suppress linking. Compile a .o file for each source file. If only a single
source file is being compiled, the -o
option can be used to specify the name
of the .o file written.
Compile for generic SPARC architecture.
SPARC: 77/90 PPC: - Intel: - |
This option is a macro for: -xarch=v7 -xchip=old -xcache=64/32/1
which is equivalent to -xtarget=ss2
.
Compile for SPARC V8 architecture.
SPARC: 77/90 PPC: - Intel: - |
This option is a macro for:
-xarch=v8 -xchip=super -xcache=16/32/4:1024/32/1 which is
equivalent to -xtarget=ss1000
.
Allow assignment to constant arguments.
SPARC:77 PPC:77 Intel:77 |
Allow a subprogram to change a dummy argument that is a constant. This option is provided only to allow legacy code to compile and execute without a runtime error.
Code that aborts unless compiled with -copyargs is, of course, not FORTRAN standard compliant. Also, such code is often unpredictable.
Define symbol name for the preprocessor.
SPARC: 77/90 PPC:77 Intel:77 |
-D
name=def-D
nameWith .F and .F90 (f90 only) source files, define name to the source-code preprocessor as if:
had appears in the source file. If no =def specified, the name name is defined as the value 1.
Following are the predefined values: _ _i386
is defined on systems compatible with the
80386 (including the 80486), and it is not defined on SPARC systems. You can use these
values in such preprocessor conditionals as the following. The compilers use the fpp(1) preprocessor by default. Like the C
preprocessor cpp(1), fpp expands source code macros and enables
conditional compilation of code. Unlike cpp, fpp understand Fortran
syntax, and is preferred as a Fortran preprocessor. Use the -xpp=cpp
flag to
force the compiler to specifically use cpp rather than fpp.
Force 8-byte alignment and enable double word load/stores.
SPARC: 77/90 PPC: - Intel: - |
Wherever profitable, the compiler will generate double-word load/store instructions for faster execution of double and quad precision computations.
Using this option automatically triggers the -f option, which causes all double-precision and quadruple-precision data types (both real and complex) to be aligned on 8-byte boundaries. Using both -dbl and -dalign also causes 64-bit integer data type to be 8-byte aligned.
Caution - -dalign may result in non-ANSI standard alignment of data, which could cause problems with variables in
EQUIVALENCE
orCOMMON
.
If you compile one subprogram with -dalign, compile all subprograms of the program with -dalign.
Generate a compiler information file (CIF).
SPARC:90 PPC: - Intel: - |
The CIF is used by f90browse. See the f90browse manual.
Double the default size for REAL
, INTEGER
, DOUBLE
,
and COMPLEX
.
SPARC:77 PPC:77 Intel:77 |
-dbl
promotes the default byte size for REAL, INTEGER,DOUBLE,and COMPLEX variables declared without an explicit byte size as follows:Table 3-15 Default Data Sizes and -
|
||||
Without -dbl option |
With -dbl option |
|||
Data Type |
default |
SPARC |
Intel |
PowerPC |
INTEGER |
4 | 8 | 8 | 8 |
REAL |
4 | 8 | 8 | 8 |
DOUBLE |
8 | 16 | 8 | 16 |
This option applies to variables, parameters, constants, and functions.
Also, LOGICAL
is treated as INTEGER
, COMPLEX
as two REAL
s, and DOUBLE
COMPLEX
as two DOUBLE
s.
-dbl
and -r8
can be expressed in terms of
the more general -xtypemap=
option:
In general, if you compile one subprogram with -dbl, then be sure to compile all subprograms of that program with -dbl. This is particularly important with programs communicating through files with unformatted I/O -- if one program is compiled with -dbl, then the other program must similarly be compiled. Be also aware that this option alters the default data size of function names, including calls to library functions, unless the function name is typed explicitly with a data size.
Force alignment of all data on 8-byte boundaries.
SPARC:77 PPC:77 Intel:77 |
y
is eitheryes
or no
. If y is yes
,
all variables will be aligned on 8-byte boundaries. Default is -dbl_align_all=no
.
Analyze loops for data dependencies.
SPARC:77 PPC: - Intel: - |
Analyze loops for inter-iteration data dependencies and do loop restructuring. This
option will raise the optimization level to O3
if no optimization level is
specified, or if it is specified less than O3
. Dependence analysis is also
included with -autopar or -parallel
. The dependence analysis is
done at compile time. (See the Fortran Programmer's Guide.)
-g
cancels -depend
.
Show commands built by driver, but do not compile.
SPARC: 77/90 PPC:77 Intel:77 |
Useful when debugging, this option displays the commands it will run to perform the compilation.
Allow or disallow dynamic libraries for the entire executable
SPARC: 77/90 PPC:77 Intel:77 |
The default, if not specified, is -dy.
Unlike -B
x, this option applies to the whole
executable and need appear only once on the command line.
-dy|-dn
are loader and linker options. If you compile
and link in separate steps with these options, then you need the same option in the link
step.
Accept extended length input source line.
SPARC: 77/90 PPC:77 Intel:77 |
Accept source lines up to 132 characters long. The compiler pads on the right with trailing blanks to column 132. If you use continuation lines while compiling with -e, then do not split character constants across lines, otherwise, unnecessary blanks may be inserted in the constants.
Suppress warning messages listed by tag name.
SPARC:77 PPC:77 Intel:77 |
Suppress displaying the warning messages specified in the comma-separated list of tag
names taglist. If taglist consists of %none
, no warnings
are suppressed. If taglist consists of %all
, all warnings are
suppressed (this is equivalent to the -w
option.)
Display the message tag with each warning message.
SPARC:77 PPC:77 Intel:77 |
With this option, the compiler's internal error tag name will appear along with warning
messages. The default is not to display the tag.
demo% f77 -errtags ink.f ink.f: MAIN: "ink.f", line 11: Warning: local variable "i" never used (WDECL_LOCAL_NOTUSED) <- The warning message's tag name |
Parallelize loops explicitly marked by directives.
SPARC: 77/90 PPC: - Intel: - |
This option turns on explicit parallelization. DO
loops immediately
preceded by DOALL
directives will have threaded, parallel code compiled for
them. Parallelization is only appropriate on multiprocessor systems. This option should
not be used to compile programs that already do their own multithreading with calls to the
libthread library.
-O3
or higher, it is
raised to -O3
automatically.
The compiler will generate parallel code even if there are data
dependencies in the DO
loop that would cause the loop to generate incorrect
results when run in parallel. With explicit parallelization, it is the user's
responsibility to correctly analyze loops for data dependency problems before marking them
with parallelization directives.
For details, see the Parallelization chapter in the Fortran
Programmer's Guide.
To improve performance, also specify the -stackvar
option when using any of the parallelization options, including -explicitpar
.
-g cancels -explicitpar
. Debugging is
facilitated by specifying -g
without any optimization or parallelization
options since not all debugging features are available when these options are invoked. See
the dbx documentation for details.
If you use -explicitpar and compile and link in one
step, then linking automatically includes the microtasking library and the threads-safe
FORTRAN runtime library. If you use -explicitpar and compile and link in separate
steps, then you must also link with -explicitpar.
Create external names with or without trailing underscore.
SPARC:77 PPC:77 Intel:77 |
e
must be either plain or underscore. The default is underscore. -ext_names=plain: Do not add trailing underscore. -ext_names=underscore: Add trailing underscore. An external name is a name of a subroutine, function, block data subprogram, or labeled common. This option affects both the name of the routine's entry point and the name used in calls to it. This option may be used to allow Fortran 77 routines to call and be called by other language routines.Invoke the source file preprocessor, but do not compile.
SPARC: 77/90 PPC:77 Intel:77 |
Apply the fpp preprocessor to .F files (and .F90 files with f90) and write the processed result on a file with the same name but with suffix changed to .f (or .f90), but do not compile.
fpp
is the default preprocessor for Fortran. The C preprocessor, cpp, can be selected instead by specifying -xpp=cpp
.
Align data on 8-byte boundaries.
SPARC: 77/90 PPC: - Intel: - |
Align all COMMON blocks and all double-precision and quadruple-precision local data on 8-byte boundaries. This applies to complex data as well.
Using -dbl with -f aligns all 64-bit integer data on 8-byte boundaries as well. A program requiring-f
may not be standard and may not
be portable.
Compiling any part of a program with -f
requires compiling all subprograms of that program with -f.
By itself, this option does not enable the compiler to generate
faster double word fetch/store instructions on double and quad precision data. -dalign
, page 45
Optimize for speed of execution using a selection of options.
SPARC: 77/90 PPC:77 Intel:77 |
Select options that optimize for speed of execution without excessive compilation time. This option provides close-to-the-maximum performance for many applications.
If you compile and link in separate steps, and you compile with -fast, then be sure to link with -fast.
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
may not be available on some platforms.
-fast
selects the following options:f77 -fast xtarget=ultra
... -depend
option (SPARC only) The set of options selected by -fast
differ across platforms:
Note - With
f90
, the-f
option is substituted for-libmil
on SPARC.
It is possible to add or subtract from this list by following the -fast
option with other options, as in:
f77 -fast -fsimple=2 -xnolibmopt ...
which overrides the -fsimple=1
option and disables the -xlibmopt
selected by -fast
.
Specify fixed-format source input files.
SPARC:90 PPC: - Intel: - |
All source files on the command-line will be interpreted as f77
fixed
format regardless of filename extension. Normally, f90 interprets only .f
files as fixed format, .f90 as free format.
Synonym for -help.
SPARC: 77/90 PPC:77 Intel:77 |
Initialize floating-point hardware to non-standard preferences.
SPARC: 77/90 PPC:77 Intel:77 |
This option is a synonym for the combination -fns -ftrap=common
on SPARC, -ftrap=common
on Intel and PowerPC.
i=ieee_handler("set", "common", SIGFPE_ABORT) call nonstandard_arithmetic() |
To be effective, the main program must be compiled with this option.
Disable floating-point exception trapping.
SPARC:90 PPC: - Intel: - |
Default behavior of f90 is to trap on invalid, overflow, and divide by zero
floating-point exceptions. Specifying -fnonstop
disables exception trapping;
execution continues without stopping.
Select the SPARC nonstandard floating-point mode.
SPARC: 77/90 PPC: - Intel: - |
The default is the SPARC standard floating-point mode. (See the Floating-Point chapter of the Fortran Programmer's Guide.)
Floating-point arithmetic is initialized to nonstandard preferences on program startup:Where x does not cause total underflow, x is a denormalized
number if and only if |x| is in one of the ranges indicated:
Data Type |
Range |
REAL | 0.0 < |x| < 1.17549435e-38 |
DOUBLE PRECISION | 0.0 < |x| < 2.22507385072014e-308 |
The standard initialization of floating-point preferences is the default:
To be effective, the main program must be compiled with this option.
Initialize floating-point precision mode on Intel.
SPARC: - PPC: - Intel:77 |
p
is eithersingle
, double
, or extended
.
Initialize the floating-point hardware precision mode to single,
double, or extended. Compile the main program with this option. (See the Floating-Point
chapter of the Fortran Programmer's Guide.)
Specify free-format source input files.
SPARC:90 PPC: - Intel: - |
All source files on the command-line will be interpreted as f90
free
format regardless of filename extension. Normally, f90 interprets .f
files as fixed format, .f90 as free format.
Set the IEEE rounding mode in effect at startup.
SPARC: 77/90 PPC:77 Intel:77 |
r
must be one of: nearest, tozero, negative, positive. The default is -fround=nearest. This option sets the IEEE 754 rounding mode that:The meanings are the same as those for the ieee_flags function. (See the Floating-Point chapter of the Fortran Programmer's Guide.)
To be effective, compile the main program with this option.Select floating-point optimization preferences.
SPARC:77 PPC:77 Intel:77 |
Allow the optimizer to make simplifying assumptions concerning floating-point arithmetic. (See the Floating-Point chapter of the Fortran Programmer's Guide.)
For consistent results, compile all units of a program with the same -fsimple
option.
If n is present, it must be 0, 1, or 2. The defaults are:
-fsimple=0
-fsimple=1
-fsimple=2
Even with -fsimple=2, the optimizer still is not permitted to introduce a floating point exception in a program that otherwise produces none.
Force precision of floating-point expressions.
SPARC: - PPC: - Intel:77 |
Use the precision of destination variable to determine the precision of the
right-hand-side expression on assignment statements. The default is -fstore.
(The -fast
option sets -nofstore
to disable this option.)
Set floating-point trapping mode in effect at startup.
SPARC: 77/90 PPC:77 Intel:77 |
t
is a comma-separated list that consists of one or more of the following:The default is -ftrap=%none. Where the % is shown, it is a required character.
This option sets the IEEE 754 trapping modes that are established at program initialization. Processing is left-to-right. The common exceptions, by definition, are invalid, division by zero, and overflow. For example: -ftrap=overflow. Example: -ftrap=%all,no%inexact means set all traps, except inexact. The meanings for -ftrap=t are the same as for ieee_flags(), except that:To be effective, compile the main program with this option.
For further information, see the Floating-Point chapter in the Fortran Programmer's Guide.Build a dynamic shared library instead of an executable file.
SPARC: 77/90 PPC:77 Intel:77 |
Direct the linker to build a shared dynamic library. Without -G,
the linker builds an executable file. With -G, it builds a dynamic library. Use
-o
with -G
to specify the name of the file to be written. See
the Fortran Programmer's Guide chapter Libraries for details.
Compile for debugging.
SPARC: 77/90 PPC:77 Intel:77 |
Produce additional symbol table information for the debugging with dbx(1) and the Sun WorkShop debugging utility.
Although a some debugging is possible without specifying -g
,
the full capabilities of dbx and debugger are only available to
those compilation units compiled with -g
.
Some capabilities of other options specified along with -g
may be limited. The -g option suppresses the automatic inlining usually
obtained with -O4, but it does not suppress -On optimizations.
-g cancels any parallelization option (-autopar,
-explicitpar,
-parallel
) as well as -depend
and -reduction
. Debugging
is facilitated by specifying -g
without any optimization or parallelization
options since not all debugging features are available when these options are invoked. See
the dbx documentation for details.
For Intel and PowerPC: -g
is ignored when
specified with a -O
n option or fast
.
For SPARC: The -g
option makes -xildon
the default incremental linker option (see "-xildon"
on page 91). That is, with -g, the compiler default behavior is to
automatically invoke ild in place of ld, unless the -G
option is present, or any source file is named on the command line.
Specify the name of the generated dynamic shared library.
SPARC: 77/90 PPC:77 Intel:77 |
This option is passed on to the linker. For details, see the Linker and Libraries Guide, and the Fortran Programmer's Guide chapter Libraries.
The -hnm option records the name nm to the shared dynamic library being created as the internal name of the library. A space between -h and nm is optional. In general, nm must be the same as what follows the -o. Use of this option is meaningless without also specifying -G
.
Without the -hnm option, no internal name is
recorded in the library file.
If the library has an internal name, whenever an executable program
referencing the library is run the runtime linker will search for a library with the same
internal name in any path the linker is searching. With an internal name specified,
searching for the library at runtime linking is more flexible. This option can also be
used to specify versions of shared libraries.
If there is no internal name of a shared library, then the linker
uses a specific path for the shared library file instead.
Display a summary list of compiler options.
SPARC: 77/90 PPC:77 Intel:77 |
Displays a list of option summaries and indicates how to send feedback comments to Sun.
See also -xhelp=
h on
Add dir to the INCLUDE
file search path.
SPARC: 77/90 PPC:77 Intel:77 |
Insert the directory dir at the start of the INCLUDE
file search
path. No space is allowed between -I and dir. Invalid directories are
ignored with no warning message.
INCLUDE
files: file names appearing on preprocessor #include
directives, or Fortran INCLUDE
statements.
Example: Search for INCLUDE
files in /usr/app/include:
demo% f77 -I/usr/app/include growth.F |
The search order for relative path on INCLUDE
or #include
is:
The default list for -Idir depends on the installation directory
for the compiler. In a standard install, compiler software packages reside in the /opt
directory; however, systems administrators may decide to install packages in other
locations. If an environment variable, INSTALL_HOME
say, points at the
installation path (e.g. /opt, or /some/place), the default search
paths for INCLUDE
files are:
Set the default integer size to two bytes.
SPARC:77 PPC:77 Intel:77 |
Set the default size to 2 bytes for integer and logical constants and variables
declared without an explicit size. ( INTEGER*n Y still
declares Y
to be n bytes regardless of the -i2.) This
option may degrade performance. It is generally recommended to declare specific variables INTEGER*2
rather than use -i2
.
Set the default integer size to four bytes.
SPARC: 77/90 PPC:77 Intel:77 |
Set the default size to 4 bytes for integer and logical constants and variables
declared without an explicit size. ( INTEGER*n Y still
declares Y
to be n bytes regardless of the -i4.).
INTEGER
and LOGICAL
, this option can be used for overriding settings made by options
like -dbl
and -r8
, which set these defaults to 8:demo% f77 -dbl -i4 *.f Command line warning: -i4 overrides integer part of -dbl ... |
Inline specified routines.
SPARC:77 PPC:77 Intel:77 |
Request that the optimizer inline the user-written routines named in the f1,...,fn
list. Inlining is an optimization technique whereby the compiler effectively replaces a
subprogram reference such as a CALL
or function call with the actual
subprogram code itself. Inlining often provides the optimizer more opportunities to
produce efficient code.
xbar
, zbar
, vpoint
:
demo% f77 -O3 -inline= |
Following are the restrictions; no warnings are issued:
-xcrossfile
is also specified. Note that with -O4, f77 normally tries to inline all appropriate
user-written subroutines and functions. Adding -inline with -O4
actually
degrades performance by restricting the optimizer's inlining to only those routines in the
list.
Synonym for -pic.
SPARC:77 PPC:77 Intel:77 |
Synonym for -PIC.
SPARC:77 PPC:77 Intel:77 |
Add dir to list of directories to search for libraries.
SPARC: 77/90 PPC:77 Intel:77 |
Add dir at the start of the list of object-library search
directories. A space between -L and dir is optional. This option is
passed to the linker. See also -l
x on
Example: Use -Ldir to specify a library search
directory:
demo% f77 -Ldir1 any.f |
Example: Use -Ldir again to add more directories:
demo% f77 -Ldir1 -Ldir2 any.f |
Note - Specifying /usr/lib or /usr/ccs/lib with -Ldir may prevent linking the unbundled libm. These directories are searched by default.
Add library libx.a to linker's list of search libraries.
SPARC: 77/90 PPC:77 Intel:77 |
Pass -lx to the linker to specify additional libraries for ld
to search for unresolved references. ld links with object library libx.
If shared library libx.so is available (and -Bstatic
or
-dn
are not specified), ld uses it, otherwise, ld uses static
library libx.a. If it uses a shared library, the name is
built in to a.out. No space is allowed between -l and x
character strings.
demo% f77 any.f -lV77 |
Use -lx again to link with more libraries.
Example: Link with the libraries liby and libz:
demo% f77 any.f -ly -lz |
Inline selected libm library routines for optimization.
SPARC:77 PPC:77 Intel:77 |
There are inline templates for some of the libm library routines. This option selects those inline templates that produce the fastest executables for the floating-point options and platform currently being used. The routines include the following:
d_infinity, d_max_normal, d_max_subnormal, d_min_normal, d_min_subnormal, d_quiet_nan, d_signaling_nan, d_sqrt, ir_finite, ir_fp_class, ir_isinf, ir_isnan, ir_isnormal, ir_issubnormal, ir_iszero, ir_signbit, r_copysign, r_fabs, r_hypot, r_infinity, r_max_normal, r_max_subnormal, r_min_normal, r_min_subnormal, r_quiet_nan, r_signalling_nan, r_sqrt
This list of routines may change with subsequent compiler releases. For more information, see the man pages libm_single(3F) and libm_double(3F)
Show parallelization results.
SPARC:77 PPC: - Intel: - |
Show which loops parallelized and which did not with the -parallel,
-autopar, or -explicitpar
options.
-loopinfo
generates a list of messages on standard
error:Example: -loopinfo, in sh, pass standard
error to the error utility:
demo$ f77 -autopar -loopinfo any.f 2>&1 | error options |
Add dir to directories searched for Fortran 90 modules.
SPARC:90 PPC: - Intel: - |
Add dir to the list of directories to be searched for module files. No space
appears between the -M
and dir.
M
are searched after the
current directory. Compiling a source file containing a module generates a .M
module file in addition to the .o file. See Appendix C, "Module Files" on page 149 for more
information about modules in Fortran 90.
Allow misaligned data.
SPARC:77 PPC:77 Intel: - |
The -misalign
option permits misaligned data in memory that would
otherwise produce an error. Particular uses of COMMON
and EQUIVALENCE
statements cause data to be misaligned. Using this option may degrade performance;
recoding to eliminate the cause of data misalignment is recommended instead.
INTEGER*2 I(4) REAL R1, R2 EQUIVALENCE (R1, I(1)), (R2, I(2)) END |
"misalign.f", line 4: Error: bad alignment for "r2" forced by equivalence |
Select the style for parallelization directives.
SPARC:77 PPC: - Intel: - |
The default without specifying -mp
is sun. Do not combine use
in a single application.
Require multithread-safe libraries.
SPARC: 77/90 PPC:77 Intel:77 |
Require linking to multithread-safe libraries. If you do your own low-level thread
management (e.g. calls to the libthread library), compiling with -mt
prevents conflicts.
Optimize performance for the host system.
SPARC: 77/90 PPC:77 Intel:77 |
This option is a synonym for -xtarget=native. This is one of the options included in the expansion of the -fast option .
Disable automatic parallelization.
SPARC:77 PPC: - Intel: - |
Disables automatic parallelization invoked by -autopar
earlier on the
command line.
Cancel -depend in command line.
SPARC:77 PPC: - Intel: - |
Cancel any -depend appearing earlier on the command line.
Disable explicit parallelization.
SPARC:77 PPC: - Intel: - |
Disables explicit parallelization invoked by -explicitpar
earlier on the
command line.
Disable forcing precision of expression.
SPARC: - PPC: - Intel:77 |
Disables forcing precision of expressions in assignment statements invoked by -fstore
earlier on the command line (Intel only). -nofstore
is invoked if -fast
is specified.
Disable linking with system libraries.
SPARC: 77/90 PPC:77 Intel:77 |
Do not automatically link with any system or language library; that is do not pass any default -lx options on to ld. The normal behavior is to link system libraries into the executables automatically, without the user specifying them on the command line.
The -nolib option makes it easier to link one of these libraries statically. The system and language libraries are required for final execution. It is your responsibility to link them in manually. This option provides you with complete control. For example, consider a program linked dynamically with libF77 that fails on a remote system because has no libF77. With this option you can link the library into your program statically. Link libF77 statically and link libc dynamically with f77:demo% f77 -nolib any.f -Bstatic -lF77 -Bdynamic -lm -lc |
Link libm statically and libc dynamically with f90:
demo% f90 -nolib any.f90 -lf90 -Bstatic -lm -Bdynamic -lc |
libf90 is always linked statically.
The order for the -lx options is important. Follow the order shown in the examples.
Cancel -libmil
on command line.
SPARC:77 PPC:77 Intel:77 |
Use this option after the -fast option to disable inlining of libm
math routines:
demo% f77 -fast -nolibmil ... |
Disable license queueing.
SPARC:77 PPC:77 Intel:77 |
With this option, if no software license is available to run the compiler, it returns without queueing your request and without compiling. A nonzero environment status is returned for testing in make files.
Cancel -reduction
on command line.
SPARC: 77/90 PPC: - Intel: - |
-reduction
is used with other parallelization options. This option cancels -reduction
.
Do not build a runtime shared library search path into the executable.
SPARC: 77/90 PPC:77 Intel:77 |
The compiler normally builds into an executable a path that tells the runtime linker where to find the shared libraries it will need. The path is installation dependent. The -norunpath option prevents that path from being built in to the executable.
This option is helpful when libraries have been installed in some nonstandard location, and you do not wish to make the loader search down those paths when the executable is run at another site. Compare with -Rpaths. See the Fortran Programmer's Guide chapter on Libraries for more information.Specify optimization level.
SPARC: 77/90 PPC:77 Intel:77 |
n
can be 1, 2, 3, 4, or 5. No space is allowed between -O and n. If -O[n] is not specified, only a very basic level of optimization limited to local common subexpression elimination and dead code analysis is performed. A program's performance may be significantly improved when compiled with an optimization level than without optimization. Use of -O
(which
implies -O3
) or -fast
(which implies -O4
) is
recommended for most programs.
Each -O
n level includes the optimizations
performed at the levels below it. Generally, the higher the level of optimization a
program is compiled with, the better runtime performance obtained. However, higher
optimization levels may result in increased compilation time and larger executable files.
Debugging with -g does not suppress -On,
but -On limits -g in certain ways; this is described on page 57.
This is equivalent to -O3
.
Provides a minimum of statement-level optimizations.
Use if higher levels result in excessive compilation time, or exceed available swap space.Enables basic block level optimizations.
This level usually gives the smallest code size. (See also-xspace
.)
-O3 is preferred over -O2
unless -O3
results in unreasonably long compilation time, exceeds swap space, or generates
excessively large executable files.
Adds loop unrolling and global optimizations at the function level.
Usually -O3 generates larger executable files.Adds automatic inlining of routines contained in the same file.
Usually -O4 generates larger executable files due to inlining. (f77 only; for f90, -O4 is equivalent to -O3) The -g option suppresses the -O4 automatic inlining described above.-xcrossfile
increases the scope of inlining with -O4
.
Attempt aggressive optimizations. (f77 only).
Suitable only for that small fraction of a program that uses the largest fraction of compute time.-O5
's optimization algorithms take more
compilation time, and may also degrade performance when applied to too large a fraction of
the source program.
Optimization at this level is more likely to improve performance if
done with profile feedback. See -xprofile=p.
Specify the name of the executable file to be written.
SPARC: 77/90 PPC:77 Intel:77 |
There must be a blank between -o and nm. Without this option, the
default is to write the executable file to a.out. When used with -c
,
-o
specifies the target .o
object file; with -G
it
specifies the target .so
library file.
Select "old" list-directed output style.
SPARC:77 PPC:77 Intel:77 |
Omit the blank that starts each record for list-directed output. This is a change from f77 releases 1.4 and earlier. The default behavior is to provide that blank, since the Fortran Standard requires it. Note also the FORM='PRINT' option of OPEN. You can compile parts of a program with -oldldo and other parts without it.
Enable one trip DO loops.
SPARC: 77/90 PPC:77 Intel:77 |
Compile DO loops such that they are executed at least once. DO loops in standard Fortran are not performed at all if the upper limit is smaller than the lower limit, unlike some legacy implementations of Fortran.
Compile for profiling with the prof profiler.
SPARC: 77/90 PPC:77 Intel:77 |
Prepare object files for profiling, see prof (1). If you compile and link in separate steps, and if you compile with the -p option, then be sure to link with the -p option. -p with prof is provided mostly for compatibility with older systems. -pg profiling with gprof is possibly a better alternative. See the Fortran Programmer's Guide chapter on Performance Profiling for details.
Insert padding for efficient use of cache.
SPARC:77 PPC: - Intel: - |
This option inserts padding between arrays or character variables if they are static local and not initialized, or in common blocks. The extra padding positions the data to make better use of cache. In either case, the arrays or character variables can not be equivalenced.
For -pad[=p], if p is present, it must be either (or both):local | Put padding between adjacent local variables |
common | Put padding between variables in common blocks |
The following are equivalent:
The -pad[=p] option applies to items that satisfy the following criteria:
For a definition of local or static variables, see -stackvar
,
Parallelize loops with: -autopar, -explicitpar, -depend
SPARC: 77/90 PPC: - Intel: - |
Parallelize loops chosen automatically by the compiler and explicitly specified by user supplied directives. Optimization level is automatically raised to -O3 if it is lower.
-g cancels-parallel
. Debugging is
facilitated by specifying -g
without any optimization or parallelization
options since not all debugging features are available when these options are invoked. See
the dbx documentation for details.
To improve performance, also specify the -stackvar
option when using any of the parallelization options, including -autopar
.
Avoid -parallel if you do your own thread management. See
the discussion of -mt on page 65.
See the Fortran Programmer's Guide chapter Parallelization for further information.
Compile for Intel Pentium.
SPARC: - PPC: - Intel:77 |
Generate code that exploits features available on Intel Pentium compatible computers.
The default on Intel is -386
. Code compiled with -pentium does run
on 80386 and 80486 hardware, but it may be slower. Use of the option
-xtarget=pentium
is preferred over -pentium
.
Compile for profiling with the gprof profiler.
SPARC: 77/90 PPC:77 Intel:77 |
Compile self-profiling code in the manner of -p, but invoke a runtime recording mechanism that keeps more extensive statistics and produces a gmon.out file when the program terminates normally. Generate an execution profile by running gprof (1).
Library options must be after the .f and .o files (-pg libraries are static). If you compile and link in separate steps, and you compile with -pg, then be sure to link with -pg.Compile position-independent code for shared library.
SPARC: 77/90 PPC:77 Intel:77 |
This kind of code is for dynamic shared libraries. Each reference to a global datum is generated as a dereference of a pointer in the global offset table. Each function call is generated in program-counter-relative addressing mode through a procedure linkage table.
There are two nominal performance costs with -pic and -PIC:
When considering the above costs, remember that the use of -pic and
-PIC can significantly reduce system memory requirements, due to the effect of
library code sharing. Every page of code in a shared library compiled
-pic or -PIC can be shared by every process that uses the library.
If a page of code in a shared library contains even a single non-pic (that is,
absolute) memory reference, the page becomes nonsharable, and a copy of the page must be
created each time a program using the library is executed.
% nm file.o | grep _GLOBAL_OFFSET_TABLE_ U _GLOBAL_OFFSET_TABLE_ |
Compile position-independent code, but with 32-bit addresses.
SPARC: 77/90 PPC:77 Intel:77 |
This option is similar to -pic, but it allows the global offset table to span the range of 32-bit addresses. Use it in those rare cases where there are too many global data objects for -pic. Do not mix -pic and -PIC.
On PowerPC, the size of the global offset table is unlimited. On Intel, -PIC
is identical to -pic
.
Pass options to compilation phase pr.
SPARC: 77/90 PPC:77 Intel:77 |
Pass the suboption list ls to the compilation phase pr. There must be blanks separating Qoption, pr, and ls. The Q can be uppercase or lowercase. The list is a comma-delimited list of suboptions, with no blanks within the list. Each suboption must be appropriate for that program phase, and can begin with a minus sign.
pr can be one of the following: as, cg, cpp, fbe,fpp
, f77pass0, f77pass1,
iropt, ld, or ratfor. This option is provided primarily
for internal debugging.
Example: Pass the -s and -m
options to the
linker ld:demo% f77 -Qoption ld -s,-m src.f |
Synonym for -p
.
SPARC: 77/90 PPC:77 Intel:77 |
Build dynamic library search paths into the executable file.
SPARC: 77/90 PPC:77 Intel:77 |
With this option, the linker, ld(1), stores a list of dynamic library search paths into the executable file.
ls is a colon-separated list of directories for library search paths. The blank between -R and ls is optional. Multiple instances of this option are concatenated together, with each list separated by a colon. The list is used at runtime by the runtime linker, ld.so. At runtime, dynamic libraries in the listed paths are scanned to satisfy any unresolved references. Use this option to let users run shippable executables without a special path option to find needed dynamic libraries. Building an executable file using-R
paths
adds directory paths to a default path that is always searched last:
For more information, see the Libraries chapter in the Fortran Programmer's Guide, and the Solaris Linker and Libraries Guide.
Double default byte size for REAL,INTEGER, DOUBLE
and COMPLEX.
SPARC:77 PPC:77 Intel:77 |
-r8
promotes the default byte size for REAL, INTEGER, DOUBLE, and COMPLEX variables declared without an explicit byte size as follows:Table 3-17 Default Data Sizes and -
|
||||
Without -r8 option |
With -r8 option |
|||
Data Type |
default |
SPARC |
Intel |
PowerPC |
INTEGER |
4 | 8 | 8 | 8 |
REAL |
4 | 8 | 8 | 8 |
DOUBLE |
8 | 16 | 8 | 16 |
This option applies to variables, parameters, constants, and functions.
Also, LOGICAL
is treated as INTEGER
, COMPLEX
as two REAL
s, and DOUBLE
COMPLEX
as two DOUBLE
s.
-dbl
and -r8
can be expressed in terms of
the more general -xtypemap=
option:
In general, if you compile one subprogram with -r8, then be sure to compile all subprograms of that program with -r8. This also important with programs communicating through unformatted I/O files -- if one program is compiled with -r8, then the other program must be similarly compiled. Be also aware that this option alters the default data size of function names, including calls to library functions, unless the function name is typed explicitly with a data size.
The impact on runtime performance may be great. With -r8, an expression like float = 15.0d0*float is evaluated in quadruple precision due to the declaration of the constant. If you select both -r8 and -i2, the results are unpredictable.Recognize reduction operations in loops.
SPARC: 77/90 PPC: - Intel: - |
Analyze loops for reduction operations during automatic parallelization. There is potential for roundoff error with the reduction.
A loop that transforms the elements of an array into a single scalar value is called a reduction operation. For example, summing the elements of a vector is a typical reduction operation. Although these operations violate the criteria for parallelizability, the compiler can recognize them and parallelize them as special cases when-reduction
is specified. See the Fortran Programmer's
Guide chapter Parallelization for information on reduction operations
recognized by the compilers.
This option applies only with the automatic parallelization options
-autopar
or -parallel
. It is ignored otherwise. Explicitly
parallelized loops are not analyzed for reduction operations.
Example: Automatically parallelize with reduction:demo% f77 -parallel -reduction any.f |
Compile and only generate assembly code.
SPARC: 77/90 PPC:77 Intel:77 |
Compile the named programs and leave the assembly-language output on corresponding files suffixed with .s. No .o file is created.
Strip the symbol table out of the executable file.
SPARC: 77/90 PPC:77 Intel:77 |
This option makes the executable file smaller and more difficult to reverse engineer.
However, this option inhibits debugging with dbx or other tools, and overrides -g
.
Produce table information for the WorkShop source code browser.
SPARC:77 PPC:77 Intel:77 |
See WorkShop: Getting Started for more information.
Produce only source code browser tables.
SPARC:77 PPC:77 Intel:77 |
Produce only table information for the WorkShop source code browser and stop. Do not assemble, link, or make object files.
Suppress compiler messages.
SPARC:77 PPC:77 Intel:77 |
Use this option to suppress non-essential messages from the compiler; error and warning messages are still issued. The default is to show file and entry names as they are reached during the compilation.
Force all local variables to be allocated on the memory stack.
SPARC: 77/90 PPC:77 Intel:77 |
Allocate all the local variables and arrays in a routine onto the memory stack, unless otherwise specified. This option makes them automatic, rather than static, and provides more freedom to the optimizer for parallelizing a CALL in a loop.
Use of -stackvar
is recommended with any of the
parallelization options.
Variables and arrays are local, unless they are:
SUBROUTINE
or FUNCTION
statement (already on
stack) STATIC
statement
REAL X/8.0/
or DATA X/8.0/
Initializing a local variable in a DATA
statement after an executable
reference to that variable is flagged as an error when -stackvar
is used:
demo% cat stak.f real x x = 1. t = 0. print*, t data x/3.0/ print *,x+t end demo% f77 -o stak -stackvar stak.f stak.f: MAIN: "stak.f", line 5: Error: attempt to initialize an automati variable: x |
The default stack size is about 8 Megabytes for the main stack and 256 KBytes for each thread stack. The limit command (with no parameters) shows the current main stack size. If you get a segmentation fault using -stackvar, you might try doubling the main stack size at least once.
Example: Show the current main stack size:demo% limit cputime unlimited filesize unlimited datasize 523256 kbytes stacksize 8192 kbytes <--- coredumpsize unlimited descriptors 64 memorysize unlimited demo% |
Example: Set the main stack size to 64 Megabytes:
demo% limit stacksize 65536 |
Example: Set each thread stack size to 8 Megabytes:
demo% setenv STACKSIZE 8192 |
Permit STOP statement to return an integer status value.
SPARC:77 PPC:77 Intel:77 |
yn
is eitheryes
or no
. The default is no
.
With -stop_status=yes
, a STOP
statement
may contain an integer constant. That value will be passed to the environment as the
program terminates:
STOP 123
The value must be in the range 0 to 255. Larger values are truncated and a run-time message issued. Note that
STOP `stop string'
is still accepted and returns a status value of 0 to the environment, although a compiler warning message will be issued.
The environment status variable is$status
for the C
shell csh, and $?
for the Bourne and Korn shells, sh
and ksh.
Define directory for temporary files.
SPARC: 77/90 PPC:77 Intel:77 |
Set directory for temporary files used by the compiler to be dir. No space is allowed within this option string. Without this option, the files are placed in the /tmp directory.
Time each compilation phase.
SPARC: 77/90 PPC:77 Intel:77 |
The time spent and resources used in each compiler pass is displayed.
Recognize upper and lower case in source files.
SPARC:77 PPC:77 Intel:77 |
Do not treat uppercase letters as equivalent to lowercase. The default is to treat uppercase as lowercase except within character-string constants. With this option, the compiler treats Delta, DELTA, and delta as different symbols.
Portability and mixing Fortran with other languages may require use of-U
. These are discussed in the Fortran Programmer's Guide. (Note
that f90 does not have this option, always treating upper and lower case as
equivalent.)
Report undeclared variables.
SPARC:77 PPC:77 Intel:77 |
Make the default type for all variables be undeclared rather than using Fortran implicit typing. This option warns of undeclared variables, and does not override any IMPLICIT statements or explicit type statements.
Enable unrolling of DO loops where possible.
SPARC:77 PPC:77 Intel:77 |
n
is a positive integer. The choices are:Loop unrolling generally improves performance, but will increase the size of the
executable file. For more information on this and other compiler optimizations, see the Performance
and Optimization chapter in the Fortran Programmer's Guide. See also the
discussion of the UNROLL
directive on
Show name and version of each compiler pass.
SPARC: 77/90 PPC:77 Intel:77 |
This option prints the name and version of each pass as the compiler executes:
This information will be helpful when discussing problems with Sun service engineers.
Verbose mode - show details of each compiler pass.
SPARC: 77/90 PPC:77 Intel:77 |
Like -V
, shows the name of each pass as the compiler executes, and details
the options and environment variables used by the driver.
Specify choice of VMS Fortran extensions enabled.
SPARC:77 PPC:77 Intel:77 |
v
must be a comma-separated list of at least one suboption. Negatives may be constructed by prefixing each suboption keyword byno%
(as in no%logical_name
).
The primary options are -vax=align
and -vax=misalign
.
-vax=align
selects all the suboptions without allowing
misaligned data. This is the behavior of the -xl
option prior to f77
release 3.0.1.
-vax=misalign
selects all the suboptions and allows
misaligned data. This is the behavior of the -xl
option with f77
release 3.0.1 and later.
Table 3-18 lists suboptions that can be individually selected.
%all
and %none
can also be used to select all
or none of these suboptions.
Show verbose parallelization messages.
SPARC:77 PPC: - Intel: - |
As the compiler analyzes loops explicitly marked for parallelization with directives, it issues a warning message about certain data dependencies it detects; but the loop will still be parallelized.
Example: -vpara for verbose parallelization warnings:demo% f77 -explicitpar -vpara any.f any.f: MAIN any: "any.f", line 11: Warning: the loop may have parallelization inhibiting reference |
Suppress warning messages.
SPARC: 77/90 PPC:77 Intel:77 |
This option suppresses most warning messages. However, if one option overrides all or part of an option earlier on the command line, you do get a warning.
Example: -w still allows some warnings to get through:demo% f77 -w -fast -silent -O4 any.f f77: Warning: -O4 overwrites previously set optimization level of -O3 demo% |
Synonym for -a.
SPARC:77 PPC:77 Intel:77 |
Specify target architecture instruction set.
SPARC:77 PPC:77 Intel:77 |
Target architectures specified by keyword a are:
Table 3-19
|
|
On SPARC: | generic, v7, v8a, v8, v8plus, v8plusa |
On PowerPC: | generic, ppc, ppc_nofma |
On Intel: | generic, 386, pentium_pro |
For PowerPC:
generic
and ppc
are equivalent in this release and direct the
compiler to produce code for the PowerPC 603 and 604 instruction set. ppc_nofma
is the same as ppc
except that the compiler will not
issue the "fused multiply-add" instruction. For Intel:
generic
and 386
are equivalent in this release. pentium_pro
directs the compiler to issue instructions for the Intel
PentiumPro chip. Synonym for -autopar.
SPARC:77 PPC: - Intel: - |
Define cache properties for the optimizer.
SPARC:77 PPC: - Intel: - |
c
must be one of the following:The si/li/ai are defined as follows:
si | The size of the data cache at level i, in kilobytes |
li | The line size of the data cache at level i, in bytes |
ai | The associativity of the data cache at level i |
Example: -xcache=16/32/4:1024/32/1 specifies the following:
Level 1 cache has: 16K bytes 32 bytes line size 4-way associativity |
Level 2 cache has: 1024K bytes 32 bytes line size Direct mapping associativity |
Synonym for -cg89.
SPARC:77 PPC: - Intel: - |
Synonym for -cg92.
SPARC:77 PPC: - Intel: - |
Specify target processor for the optimizer.
SPARC:77 PPC:77 Intel:77 |
This option specifies timing properties by specifying the target processor.
Although this option can be used alone, it is part of the expansion of the-xchip
value
implied by the a specific -xtarget option.
Some effects of -xchip=c are:
Table 3-21
lists the valid-xchip
values:Enable optimization and inlining across source files.
SPARC:77 PPC: - Intel: - |
Normally, the scope of the compiler's analysis is limited to each separate file on the
command line. For example, -O4
's automatic inlining is limited to subprograms
defined and referenced within the same source file.
-xcrossfile
, the compiler analyzes all the files
named on the command line as if they had been concatenated into a single source file.
-xcrossfile
is only effective when used with -O4
or -O5
.
Cross-file inlining creates a possible source file interdependence
that would not normally be there. If any file in a set of files compiled together with -xcrossfile
is changed, then all files must be recompiled to insure that the
new code is properly inlined. See the discussion of inlining on page 60.
Synonym for -depend.
SPARC:77 PPC: - Intel: - |
Synonym for -explicitpar.
SPARC:77 PPC: - Intel: - |
Allow function-level reordering by WorkShop Analyzer.
SPARC:77 PPC:77 Intel:77 |
Allow the reordering of functions (subprograms) in the core image using the compiler, the Analyzer and the linker. If you compile with the -xF option, then run the Analyzer, you can generate a map file that optimizes the ordering of the functions in memory depending on how they are used together. A subsequent link to build the executable file can be directed to use that map by using the linker -Mmapfile option. It places each function from the executable file into a separate section.
Reordering the subprograms in memory is useful only when the application text page fault time is consuming a large percentage of the application time. Otherwise, reordering may not improve the overall performance of the application. The Analyzer is part of the Sun WorkShop. See WorkShop: Getting Started and Beyond the Basics for further information on the Analyzer.Show summary help information on options or README file.
SPARC:77 PPC:77 Intel:77 |
The h is either readme or flags.
readme: Show the online README file for this release of the compiler.Turn off the Incremental Linker.
SPARC: 77/90 PPC: - Intel: - |
This forces the use of the standard linker, ld.
This option is the default if you do not use the -g option. It is also the default if you use -G or name any source file on the command line. Override this default by using the -xildon option.Turn on the Incremental Linker.
SPARC: 77/90 PPC: - Intel: - |
Turn on the Incremental Linker and force the use of ild in incremental mode.
This option is the default if you use -g and do not use -G, and do not name any source file on the command line. Override this default by using the -xildoff option. See the Incremental Link Editor guide.Synonym for -inline=f1[,...,fn].
SPARC:77 PPC:77 Intel:77 |
Enable more VMS Fortran extensions.
SPARC:77 PPC:77 Intel:77 |
-xl:
Enable the compiler to accept more VMS Fortran extensions. This is a macro that is translated to-vax=misalign
, and provides the language features that
are listed later in this description. See the description of -vax=
, page 83.
The following VMS language features are covered with this option:
Use the -xl to get VMS alignment if your program has some detailed knowledge of how VMS structures are implemented.
-xld
: Specifying -xld option causes
debugging comments (D or d in column one) to be compiled. Without
the -xld option, they remain comments only. No space is allowed between -xl
and d.
Programs that need to share structures with C programs should use
the default and not -xl.
You may also be interested in -lV77 and the VMS library.
See the Fortran Library Reference for information on the VMS libraries.
Read the chapter on VMS language extensions in the Fortran 77
Language Reference for details of the VMS features that you get automatically.
Synonym for -libmil.
SPARC:77 PPC:77 Intel:77 |
Use library of optimized math routines.
SPARC: 77/90 PPC: - Intel: - |
Use selected math routines optimized for speed. This option usually generates faster code. It may produce slightly different results; if so, they usually differ in the last bit. The order on the command line for this library option is not significant.
Link with the specified Sun licensed libraries.
SPARC: 77/90 PPC:77 Intel:77 |
Specifies a comma-separated list of license-controlled libraries to link with. For
example:
f77 -o pgx -fast pgx.f -xlic_lib=sunperf |
As with -l, this option should appear on the command line after all source and object file names.
Show license server information.
SPARC: 77/90 PPC:77 Intel:77 |
Use this option to return license information about the licensing system--in particular, the name of the license server and the user ID for each of the users who have licenses checked out.
Generally, with this option, no compilation takes place, and a license is not checked out. This option is normally used alone with no other options. However, if a conflicting option is used, then the last one on the command line prevails, and there is a warning.Produce listings and do global program checking.
SPARC: 77/90 PPC:77 Intel:77 |
Use this option to find potential programming bugs. It invokes an extra compiler pass
to check for consistency in subprogram call arguments, common blocks, and parameters,
across the global program. The option also generates a line-numbered listing of the source
code, including a cross reference table. The error messages issued by the -Xlist
options are advisory warnings and do not prevent the program from being compiled and
linked.
Note - Not all
-Xlist
suboptions are available with release 1.2 off90
. Full global program checking will be available in a later f90 release.
Example: Check across routines for consistency:
demo% f77 -Xlist fil.f |
The above example writes the following to the output file fil.lst:
By default, the listings are written to the file name.lst, where name is taken from the first listed source file on the command line.
A number of sub-options provide further flexibility in the selection of actions. These are specified by suffixes to the main -Xlist
option, as shown in the following table:See the Fortran Programmer's Guide chapter Program Analysis and Debugging for details.
Synonym for -loopinfo.
SPARC:77 PPC: - Intel: - |
Synonym for -nolib.
SPARC: 77/90 PPC:77 Intel:77 |
Synonym for -nolibmil.
SPARC: 77/90 PPC:77 Intel:77 |
Do not use fast math library.
SPARC: 77/90 PPC:77 Intel:77 |
Use with -fast to override linking the optimized math library:
f77 -fast -xnolibmopt ...
Synonym for -O[n].
SPARC: 77/90 PPC:77 Intel:77 |
Synonym for -pad
.
SPARC:77 PPC: - Intel: - |
Synonym for -parallel.
SPARC: 77/90 PPC: - Intel: - |
Synonym for -pg.
SPARC: 77/90 PPC:77 Intel:77 |
Select source file preprocessor.
SPARC: 77/90 PPC:77 Intel:77 |
The default is -xpp=fpp.
The compilers use fpp(1) to preprocess .F or .F90 source files. This preprocessor is appropriate for Fortran. Previous versions used the standard C preprocessor cpp. To select cpp, specify-xpp=cpp
.
Collect or optimize with runtime profiling data.
SPARC:77 PPC: - Intel:77 |
p
must be one of collect[:nm], use[:nm], or tcov. Optimization level must be -O2
or greater.
Only -xprofile=tcov
is available on Intel.
collect[:nm] (SPARC)
-xprofile=collect:
nm will
create the subdirectory nm.profile to hold the runtime feedback
information. Data is written to the file feedback in this subdirectory. If you
run the program several times, the execution frequency data accumulates in the feedback
file; that is, output from prior runs is not lost. use
[:nm] (SPARC)collect:nm
, the nm is optional and may be used to specify
the name of the program. -xprofile=collect:
nm, the same program name nm
must appear in the optimizing compilation:
-xprofile=use:
nm. tcov
(SPARC, Intel)Synonym for -reduction.
SPARC: 77/90 PPC: - Intel: - |
Specify register usage.
SPARC:77 PPC: - Intel: - |
r
is a comma-separated list that consists of one or more of the following:Where the % is shown, it is a required character.
Example: -xregs=appl,no%float appl: Allow using the registers g2, g3, and g4.no%appl
: Do not use the appl registers. float: Allow using the floating-point registers as specified in the SPARC ABI.no%float
: Do not use the floating-point registers.The default is: -xregs=appl,float.
Allow debugging by dbx without object (.o) files .
SPARC:77 PPC:77 Intel:77 |
With -xs, if you move executables to another directory, then you can use dbx and ignore the object (.o) files. Use this option when you cannot keep the .o files.
Without -xs, if you move the executables, you must move both the source files and the object (.o) files, or set the path with either the dbx pathmap or use command.
Assume no memory-based traps.
SPARC:77 PPC: - Intel: - |
Using this option allows the compiler to assume no memory-based traps occur. It grants
permission to use the speculative load instruction on V9 machines. It is only effective if
-O5
and -xarch=v8plus
are also specified.
Synonym for -sb.
SPARC:77 PPC:77 Intel:77 |
Synonym for -sbfast.
SPARC:77 PPC:77 Intel:77 |
Do not allow optimizations to increase code size.
SPARC:77 PPC: - Intel: - |
Do no optimizations that increase the code size.
Example: Do not unroll or parallelize loops if it increases code size.Specify system for optimization.
SPARC:77 PPC:77 Intel:77 |
Specify the target system for the instruction set and optimization.
t must be one of: native, generic, system-name. The -xtarget option permits a quick and easy specification of the -xarch, -xchip, and -xcache combinations that occur on real systems. The only meaning of -xtarget is in its expansion. The performance of some programs may benefit by providing the compiler with an accurate description of the target computer hardware. When program performance is critical, the proper specification of the target hardware could be very important. This is especially true when running on the newer SPARC processors. However, for most programs and older SPARC processors, the performance gain is negligible and a generic specification is sufficient. native: Optimize performance for the host system.generic
: Get the best performance for generic architecture, chip, and cache.system-name: Get the best performance for the specified system.
This option is a macro. Each specific value for -xtarget expands into a specific set of values for the -xarch, -xchip, and -xcache options, as shown in
Table 3-23. fpversion(1) can be run to determine the target definitions on any system.-xtarget=sun4/15 means -xarch=v8a -xchip=micro -xcache=2/16/1
For PowerPC: -xtarget=
accepts generic
or native
.
generic
or native
386
(equivalent to -386
option) or 486
(equivalent to -486
option) pentium
(equivalent to -pentium
option) or pentium_pro
Synonym for -time.
SPARC: 77/90 PPC:77 Intel:77 |
Specify default data mappings.
SPARC:77 PPC:77 Intel:77 |
This option provides a flexible way to specify the byte sizes for default data types.
Compare with -dbl
and -r8
.
:
size,
type:
size,
...
The allowable data types are real
, double
, integer
.
64
, 128
, and mixed
.
This option applies to all variables declared with default
specifications (without explicit byte sizes), as in REAL XYZ
.
The allowable combinations on each platform are:The mapping integer:mixed
indicates 8 byte integers but
only 4 byte arithmetic.
The -dbl
and -r8
options have their -xtypemap
equivalents:
There are two additional possibilities on SPARC and PowerPC:
-xtypemap=real:64,double:64,integer:mixed
-xtypemap=real:64,double:64,integer:64
which map both default REAL
and DOUBLE
to 8 bytes.
INTEGER
and LOGICAL
are treated
the same, and COMPLEX
is mapped as two REAL
s. Also, DOUBLE
COMPLEX
will be treated the way DOUBLE
is mapped.
Synonym for -unroll=n.
SPARC:77 PPC:77 Intel:77 |
Synonym for -vpara.
SPARC:77 PPC: - Intel: - |
Compile for loop performance profiling by looptool.
SPARC:77 PPC: - Intel: - |
Prepare object files for the loop profiler, looptool. The looptool(1) utility can then be run to generate loop statistics about the program.
If you compile and link in separate steps, and you compile with -Zlp, then be sure to link with -Zlp. If you compile one subprogram with -Zlp, you need not compile all the subprograms of that program with -Zlp. However, you receive the loop information only for the files compiled with -Zlp, and no indication that the program includes other files. Refer to WorkShop: Beyond the Basics for more information.Generate only pure libraries with no relocations.
SPARC:77 PPC: - Intel: - |
Do not make the library if relocations remain.
The general purpose of -ztext is verify that a generated library is pure text; instructions are all position-independent code. Therefore, it is generally used with both -G and -pic. With -ztext, if ld finds an incomplete relocation in the text segment, then it does not build the library. If it finds one in the data segment, then it generally builds the library anyway; the data segment is writable. Without -ztext, ld builds the library, relocations or not. A typical use is to make a library from both source files and object files, where you do not know if the object files were made with -pic. Example: Make library from both source and object files:demo% f77 -G -pic -ztext -o MyLib -hMyLib a.f b.f x.o y.o |
Example: Ask if it is pure text already--even without -pic:
demo% f77 -G -ztext -o MyLib -hMyLib a.f b.f x.o y.o |
Compile for performance profiling with Thread Analyzer.
SPARC:77 PPC: - Intel: - |
Prepare object files for Thread Analyzer. This option inserts calls to a profiling library at all procedure entries and exits. Code compiled with -Ztha links with the library libtha.so. The -Ztha option is usable only with a Sun WorkShop license.
If you compile and link in separate steps, and you compile with -Ztha, then link with -Ztha. All subprograms need not be compiled with -Ztha. However, thread statistics will appear only for the files compiled with the option. Refer to tha (1) or WorkShop: Beyond the Basics for details.