This chapter describes the syntax and operation of each compiler option. The options are arranged in alphabetical order. On a command-line, options need to be preceded by a hyphen (-). If the compiler does not recognize an option, it passes the option to the linker.
This chapter uses the following notation:
Option
|
Description
|
---|---|
-# |
Display invocation information. |
-### |
Show but do not execute the driver commands (same as -dryrun). |
-byteswapio |
Swap bytes from big-endian to little-endian or vice versa on input/output of unformatted data |
-C |
Perform array bounds checking. |
-c |
Stops after the assembly phase and saves the object code in filename.o. |
-cyglibs |
(NT only) link against the Cygnus libraries and use the Cygnus include files. You must have the full Cygwin32 environment installed in order to use this switch. |
-D<arg> |
Defines a preprocessor macro. |
-dryrun |
Show but do not execute driver commands. |
-E |
Stops after the preprocessing phase and displays the preprocessed file on the standard output. |
-F |
Stops after the preprocessing phase and saves the preprocessed file in filename.f (this option is only valid for the PGI Fortran compilers) |
-f |
Ignored |
-fast |
Generally optimal; equivalent to: -O -Munroll -Mnoframe |
-flags |
Display valid driver options. |
-fpic |
Generate position-independent code. |
-fPIC |
Equivalent to -fpic. |
-G |
(Solaris86 only) Passed to the linker. Instructs the linker to generate a shared object file. |
-g |
Includes debugging information in the object module. |
-g77libs |
Allow object files generated by g77 to be linked into PGI main programs. |
-help |
Display driver help message. |
-I<arg> |
Adds a directory to the search path for #include files. |
-i |
Passed to the linker |
-i2 |
Treat INTEGER variables as 2 bytes. |
-i4 |
Treat INTEGER variables as 4 bytes. |
-i8 |
Treat INTEGER variables as 8 bytes and use 64-bits for INTEGER*8 operations. |
-Kflag |
Requests special compilation semantics with regard to conformance to IEEE 754. |
-L |
Specifies a library directory. |
-l |
Loads a library. |
-Mpgflag |
Selects variations for code generation and optimization. |
-m |
Displays a link map on the standard output |
-module <moduledir> |
Save/search for module files in directory <moduledir>; (only valid for the PGF90 and PGHPF compilers) |
-mp |
Interpret and process user-inserted shared-memory parallel programming directives (see Chapters 10 and 11). |
-mslibs |
(NT only) use the Microsoft linker and include files, and link against the Microsoft Visual C++ libraries. Microsoft Visual C++ must be installed in order to use this switch. |
-msvcrt |
(NT only) use Microsoft's msvcrt.dll at runtime rather than the default crtdll.dll. |
-Olevel |
Specifies code optimization level where level is 0, 1, or 2. |
-o |
Names the object file. |
-P |
Stops after the preprocessing phase and saves the preprocessed file in filename.i (only valid for the PGI C/C++ compilers) |
-pc |
Set precision for certain calculations. |
-Q |
Selects variations for compiler steps. |
-R<directory> |
(Linux and Solaris86 only) Passed to the Linker. Hard code <directory> into the search path for shared object files. |
-r |
Creates a relocatable object file. |
-r4 |
Interpret DOUBLE PRECISION variables as REAL. |
-r8 |
Interpret REAL variables as DOUBLE PRECISION. |
-rc file |
Specifies the name of the driver's startup file. |
-S |
Stops after the compiling phase and saves the assembly-language code in filename.s. |
-s |
Strips the symbol-table information from the object file. |
-shared |
(Linux only) Passed to the linker. Instructs the linker to generate a shared object file. |
-show |
Display driver's configuration parameters after startup. |
-silent |
Do not print warning messages. |
-time |
Print execution times for the various compilation steps. |
-tp |
Specify the type of the target processor; -tp p5 for Pentium processors, -tp p6 for Pentium Pro/II/III processors, and -tp px for blended p5/p6 code generation. |
-U symbol |
Undefine a preprocessor macro. |
-u symbol |
Initializes the symbol table with symbol, which is undefined for the linker. An undefined symbol triggers loading of the first member of an archive library. |
-V |
Displays the version messages and other information. |
-v |
Displays the compiler, assembler, and linker phase invocations. |
-W |
Passes arguments to a specific phase. |
-w |
Do not print warning messages. |
Option
|
Description
|
---|---|
-A |
(pgCC only) Accept proposed ANSI C++. |
--[no_]alternative_tokens |
(pgCC
only) Enable/disable recognition of alternative tokens. These are tokens that
make it possible to write C++ without the use of the , , [, ], #, &,
and ^ and characters. The alternative tokens include the operator keywords
(e.g., and, bitand, etc.) and digraphs. The default is
|
-b |
(pgCC only) Compile with cfront 2.1 compatibility. This accepts constructs and a version of C++ that is not part of the language definition but is accepted by cfront. |
-b3 |
(pgCC only) Compile with cfront 3.0 compatibility. See -b above. |
--[no_]bool |
(pgCC only) Enable or disable recognition of bool. The default value is --bool. |
--[no]builtin |
Do/don't compile with math subroutine builtin support, which causes selected math library routines to be inlined. The default is --builtin. |
--cfront_2.1 |
(pgCC only) Enable compilation of C++ with compatibility with cfront version 2.1. |
--cfront_3.0 |
(pgCC only) Enable compilation of C++ with compatibility with cfront version 3.0. |
--create_pch filename |
(pgCC only) Create a precompiled header file with the name filename. |
--dependencies |
(pgCC only) Print makefile dependences to stdout. |
--dependencies_to_file filename |
(pgCC only) Print makefile dependences to file filename. |
--diag_error tag |
(pgCC only) Override the normal error severity of the specified diagnostic messages. |
--diag_remark tag |
(pgCC only) Override the normal error severity of the specified diagnostic messages. |
--diag_suppress tag |
(pgCC only) Override the normal error severity of the specified diagnostic messages. |
--diag_warning tag |
(pgCC only) Override the normal error severity of the specified diagnostic messages. |
--display_error_number |
(pgCC only) Display the error message number in any diagnostic messages that are generated. |
--enumber |
(pgCC only) Set the C++ front-end error limit to the specified number. |
--[no_]exceptions |
(pgCC only) Disable/enable exception handling support. The default is -exceptions |
--gnu_extensions |
(pgCC only) Allow GNU extensions like "include next" which are required to compile Linux system header files. |
--instantiation_dir directory |
(pgCC only) If --one_instantiation_per_object is used, define directory as the instantiation directory. |
--[no]llalign |
(pgCC only) Do/don't align long long integers on integer boundaries. The default is --llalign. |
-M |
Generate make dependence lists. |
-MD |
Generate make dependence lists. |
-MD,filename |
(pgCC only) Generate make dependence lists and print them to file filename. |
--one_instantiation_per_object |
(pgCC only) Put out each template instantiation (function or static data member) in a separate object file. The primary object file contains everything else in the compilation. Allows users of libraries to pull only the instantiations that are needed. Necessary for template libraries that rely on other template libraries. |
--optk_allow_dollar_in_id_chars |
(pgCC only) Accept dollar signs in identifiers. |
--pch |
(pgCC only) Automatically use and/or create a precompiled header file. |
--pch_dir directory |
(pgCC only) The directory in which to search for and/or create a precompiled header file. |
--[no_]pch_messages |
(pgCC only) Enable/ disable the display of a message indicating that a precompiled header file was created or used. |
+p |
(pgCC only) Disallow all anachronistic constructs. |
-P |
Stops after the preprocessing phase and saves the preprocessed file in filename.i. |
--preinclude=<filename> |
(pgCC only) Specify file to be included at the beginning of compilation; to set system-dependent macros, types, etc |
--prelink_objects |
(pgCC only) If --one_instantiation_per_object is used, create template instantiations for a set of objects that are about to become a template library. Required for template libraries that reference other template libraries. |
-t |
Control instantiation of template functions. |
--use_pch filename |
(pgCC only) Use a precompiled header file of the specified name as part of the current compilation. |
--[no_]using_std |
(pgCC only) Enable/disable implicit use of the std namespace when standard header files are included. |
-X |
(pgCC only) Generate cross reference information and place output in specified file. |
-Xm |
(pgCC only) Allow $ in names. |
-xh |
(pgCC only) Enable exception handling |
-.suffix |
(pgCC only) Use with -E, -F, or -P to save intermediate file in a file with the specified suffix. |
Use the -# option to display the invocations of the compiler,
assembler and linker. These invocations are command-lines created by the driver
from your command-line input and the default values.
Default: The compiler does not display individual phase invocations.
Usage: The following command-line requests verbose invocation information.
$ pgf90 -# prog.f
Cross-reference: -Minfo, -V, -v.
Use the -### option to display the invocations of the compiler,
assembler and linker but do not execute them. These invocations are
command-lines created by the compilation driver from the PGIRC files and the
command-line options.
Default: The compiler does not display individual phase invocations.
Usage: The following command-line requests verbose invocation information.
$ pgf90 -### myprog.f
Cross-reference: -Minfo, -V, -dryrun.
Use the -byteswapi ooption
to swap the byte-order of data in unformatted Fortran data files on
input/output. When this option is used, the order of bytes is swapped in both
the data and record control words (the latter occurs in unformatted sequential
files). Specifically, this option can be used to convert big-endian format
data files produced by most RISC workstations and high-end servers to the
little-endian format used on Intel Architecture systems on-the-fly during file
reads/writes. This option assumes that the record layouts of unformatted
sequential access and direct access files are the same on the systems. Also,
the assumption is that the IEEE representation is used for floating-point
numbers. In particular, the format of unformatted data files produced by PGI
Fortran compilers is known to be identical to the format used on Sun and SGI
workstations, which allows you to read and write unformatted Fortran data files
produced on those platforms from a program compiled for an IA-32 platform using
the -byteswapio option.
Default: The compiler does not byte-swap data on input/output.
Usage: The following command-line requests byte-swapping be performed on input/output.
$ pgf90 -byteswapio myprog.f
Perform array bounds checking. If an array bounds violation occurs when
a program is executed, an error message describing where the error occurred is
printed and the program terminates.
Usage:
$ pgf90 -C myprog.f
The text of the error message includes the name of the array, the location where the error occurred (the source file and the line number in the source), and information about the subscript which is out of bounds (its value, its upper bound, and its dimension).
Cross-reference: -Mbounds, -Mnobounds.
Stops after the assembling phase. Use the -c option to halt the
compilation process after the assembling phase and write the object code to the
file filename.o, where the input file is filename.f.
Default: The compiler produces an executable file (does not use the -c option).
Usage: In this example, the compiler produces the object file myprog.o in the current directory.
$ pgf90 -c myprog.f
Cross-reference: -E, -Mkeepasm, -o, and -S.
(NT only) link against the Cygnus libraries and use the Cygnus include
files. You must have the full Cygwin32 environment installed in order
to use this switch.
Default: The compiler does not link against the Cygnus libraries.
Defines a preprocessor macro. Use the -D option to create a macro
with a given value. The value must be either an integer or a character string.
You can use the -D option more than once on a compiler command line. The
number of active macro definitions is limited only by available memory.
You can use macros with conditional compilation to select source text during preprocessing. A macro defined in the compiler invocation remains in effect for each module on the command line, unless you remove the macro with an #undef preprocessor directive or with the -U option. The compiler processes all of the -U options in a command line after processing the -D options.
Syntax:
-Dname[=value]
Where name is the symbolic name, and value is either an integer value or a character string.
Default: If you define a macro name without specifying a value the preprocessor assigns the string 1 to the macro name.
Usage: In the following example, the macro PATHLENGTH has the value 256 until a subsequent compilation. If the -D option is not used, PATHLENGTH's value is set to 128.
$ pgf90 -DPATHLENGTH=256 myprog.F
Where the source text is:
#ifndef PATHLENGTH
#define PATHLENGTH 128
#endif
SUBROUTINE SUB
CHARACTER*PATHLENGTH path
...
END
Cross-reference: -U
Use the -dryrun option to display the invocations of the
compiler, assembler and linker but do not execute them. These invocations are
command lines created by the compilation driver from the PGIRC file and the
command-line supplied with -dryrun.
Default: The compiler does not display individual phase invocations.
Usage: The following command-line requests verbose invocation information.
$ pgf90 -dryrun myprog.f
Cross-reference: -Minfo, -V, -###
Stops after the preprocessing phase. Use the -E option to halt
the compilation process after the preprocessing phase and display the
preprocessed output on the standard output.
Default: The compiler produces an executable file.
Usage: In the following example the compiler displays the preprocessed myprog.f on the standard output.
$ pgf90 -E myprog.f
Cross-reference: See the options -C, -c, -Mkeepasm, -o, -F, -S.
Stops compilation after the preprocessing phase. Use the -F
option to halt the compilation process after preprocessing and write the
preprocessed output to the file filename.f where the input file is
filename.F.
Default: The compiler produces an executable file.
Usage: In the following example the compiler produces the preprocessed file myprog.f in the current directory.
$ pgf90 -F myprog.F
Cross-reference: -c,-E, -Mkeepasm, -o, -S
A generally optimal set of options is chosen depending on the target
system. Always includes the options -O, -Munroll, and
-Mnoframe on all IA-32 platforms. In addition, the -tp
p5 or -tp p6 option is automatically included on Pentium and Pentium
Pro/II/III platforms respectively. NOTE: auto-selection of the appropriate
-tp option means that IA-32 programs built using the -fast option
on a given system are not necessarily backward-compatible with older IA-32
systems.
Cross-reference: -O, -Munroll, -Mnoframe, -tp
Displays driver options on the standard output. Use this option with
-v to list options that are
recognized and ignored, as well as the
valid options.
Cross-reference: -#, -###, -v
(Linux and Solaris86 only) Generate position-independent code suitable
for inclusion in shared object (dynamically linked library) files.
Cross-reference: -shared, -G, -R
(Linux and Solaris86 only) Equivalent to -fpic. Provided for
compatibility with other compilers.
Cross-reference: -fpic, -shared, -G, -R
Valid only on Solaris86. Passed to the linker. Instructs the linker to
produce a shared object (dynamically linked library) file.
Cross-reference: -fpic, -shared, -R
The -g option instructs the compiler to include symbolic
debugging information in the object module. Debuggers, such as PGDBG,
require symbolic debugging information in the object module to display and
manipulate program variables and source code. Note that including symbolic
debugging information increases the size of the object module.
If you specify the -g option on the command-line, the compiler sets the optimization level to -O0 (zero), unless you specify the -O option. For more information on the interaction between the -g and -O options, see the -O entry. Symbolic debugging may give confusing results if an optimization level other than zero is selected.
Default: The compiler does not put debugging information into the object module.
Usage: In the following example the object file a.out will contain symbolic debugging information.
$ pgf90 -g myprog.f
Use the -g77lib soption
on the link line if you are linking g77-compiled program units into a
pgf90-compiled main program using the pgf90 driver. When
this option is present, the pgf90 driver will search the necessary
g77 support libraries to resolve references specific to
g77-compiled program units. The g77 compiler must be installed
on the system on which linking occurs in order for this option to function
correctly.
Default: The compiler does not search g77 support libraries
to resolve references at link time.
Usage: The following command-line requests that g77 support libraries be searched at link time:
$ pgf90 -g77libs myprog.f g77_object.o
Displays options recognized by the driver on the standard output.
Cross-reference: -#, -###, -show, -V, -flags
Adds a directory to the search path for files that are included using
the INCLUDE statement or the preprocessor directive #include.
Use the -I option to add a directory to the list of where to search for
the included files. The compiler searches the directory specified by the
-I option before the default directories.
Syntax:
-Idirectory
Where directory is the name of the directory added to the standard search path for include files.
Usage: The Fortran INCLUDE statement directs the compiler to begin reading from another file. The compiler uses two rules to locate the file:
For example, the compiler applies rule (1) to the following statements:
INCLUDE '/bob/include/file1' (absolute path name)
INCLUDE '../../file1' (relative path name)
and rule (2) to this statement:
INCLUDE 'file1'
Cross-reference: -Mnostdinc
Treat INTEGER variables as either two, four, or eight bytes.
INTEGER*8 values not only occupy 8 bytes of storage, but operations
use 64 bits, instead of 32 bits.
Requests that the compiler provide special compilation semantics.
Syntax:
-Kflag
Where flag is one of the following:
Default: The default is -Knoieee.
Specifies a directory to search for libraries. Use -L to add
directories to the search path for library files. Multiple -L options
are valid. However, the position of multiple -L options is important
relative to -l options supplied.
Syntax:
-Ldirectory
Where directory is the name of the library directory.
Default: Search the standard library directory.
Usage: In the following example the library directory is /lib and the linker links in the standard libraries required by PGF90 from /lib.
$ pgf90 -L/lib myprog.f
In the following example the library directory /lib is searched for the library file libx.a and both the directories /lib and /libz are searched for liby.a.
$ pgf90 -L/lib -lx -L/libz -ly myprog.f
Loads a library. The linker searches <library> in
addition to the standard libraries. Libraries specified with -l are
searched in order of appearance and before the standard libraries.
Syntax:
-llibrary
Where library is the name of the library to search. The compiler prepends the characters lib to the library name and adds the .a extension following the library name.
Usage: In the following example if the standard library directory is /lib the linker loads the library /lib/libmylib.a, in addition to the standard libraries.
$ pgf90 myprog.f -lmylib
Selects options for code generation. The options are divided into the
following categories:
Table 7-2 lists and briefly describes the options alphabetically and includes a field showing the category.
pgflag
|
Description
|
Category
|
---|---|---|
anno |
annotate the assembly code with source code. |
Miscellaneous |
[no]asmkeyword |
specifies whether the compiler allows the asm keyword in C/C++ source files (pgcc and pgCC only). |
C/C++ Language |
[no]backslash |
determines how the backslash character is treated in quoted strings (pgf77, pgf90, and pghpf only). |
Fortran Language |
[no]bounds |
specifies whether array bounds checking is enabled or disabled. |
Miscellaneous |
[no]builtin |
Do/don't compile with math subroutine builtin support, which causes selected math library routines to be inlined (pgcc and pgCC only). |
Optimization |
byteswapio |
Swap byte-order (big-endian to little-endian or vice versa) during I/O of Fortran unformatted data. |
Miscellaneous |
cache_align |
where possible, align data objects of size greater than or equal to 16 bytes on cache-line boundaries. |
Optimization |
chkfpstk |
check for internal consistency of the x86 FP stack in the prologue of a function and after returning from a function or subroutine call. |
Miscellaneous |
chkptr |
check for NULL pointers (pgf90 and pghpf only). |
Miscellaneous |
chkstk |
check the stack for available space upon entry to and before the start of a parallel region. Useful when many private variables are declared. |
Miscellaneous |
concur |
enable auto-concurrentization of loops. Multiple processors will be used to execute parallelizable loops (only valid on shared memory multi-CPU systems). |
Optimization |
cray |
Force Cray Fortran (CF77) compatibility (pgf77, pgf90, and pghpf only). |
Optimization |
[no]dclchk |
determines whether all program variables must be declared (pgf77, pgf90, and pghpf only). |
Fortran Language |
[no]defaultunit |
determines how the asterisk character ("*") is treated in relation to standard input and standard output (regardless of the status of I/O units 5 and 6, pgf77, pgf90, and pghpf only). |
Fortran Language |
[no]depchk |
checks for potential data dependences. |
Optimization |
[no]dlines |
determines whether the compiler treats lines containing the letter "D" in column one as executable statements (pgf77, pgf90, and pghpf only). |
Fortran Language |
dollar |
specifies the character to which the compiler maps the dollar sign code (pgf77, pgf90, and pghpf only). |
Fortran Language |
extend |
the compiler accepts 132-column source code; otherwise it accepts 72-column code (pgf77, pgf90, and pghpf only). |
Fortran Language |
extract |
invokes the function extractor. |
Inlining |
fcon |
instructs the compiler to treat floating-point constants as float data types (pgcc and pgCC only). |
C/C++ Language |
[no]i4 |
determines how the compiler treats INTEGER variables (pgf77, pgf90, and pghpf only). |
Optimization |
info |
print informational messages regarding optimization and code generation to standard output as compilation proceeds. |
Miscellaneous |
inform |
specifies the minimum level of error severity that the compiler displays. |
Miscellaneous |
inline |
invokes the function inliner. |
Inlining |
[no]iomutex |
determines whether critical sections are generated around Fortran I/O calls (pgf77, pgf90, and pghpf only). |
Fortran Language |
keepasm |
instructs the compiler to keep the assembly file. |
Miscellaneous |
[no]list |
specifies whether the compiler creates a listing file. |
Miscellaneous |
neginfo |
instructs the compiler to produce information on why certain optimizations are not performed. |
Miscellaneous |
noframe |
eliminate operations that set up a true stack frame pointer for functions. |
Optimization |
nomain |
when the link step is called, don't include the object file which calls the Fortran main program (pgf77, pgf90, and pghpf only). |
Code Generation |
noopenmp |
when used in combination with the -mp option, causes the compiler to ignore OpenMP parallelization directives or pragmas, but still process SGI-style parallelization directives or pragmas. |
Miscellaneous |
nosgimp |
when used in combination with the -mp option, causes the compiler to ignore SGI-style parallelization directives or pragmas, but still process OpenMP directives or pragmas. |
Miscellaneous |
nostartup |
do not link in the standard startup routine (pgf77, pgf90, and pghpf only). |
Environment |
nostddef |
instructs the compiler to not recognize the standard preprocessor macros. |
Environment |
nostdinc |
instructs the compiler to not search the standard location for include files. |
Environment |
nostdlib |
instructs the linker to not link in the standard libraries. |
Environment |
[no]onetrip |
determines whether each DO loop executes at least once (pgf77, pgf90, and pghpf only). |
Language |
prof |
set profile options; function-level and line-level profiling are supported. |
Code Generation |
[no]r8 |
determines whether the compiler promotes REAL variables and constants to DOUBLE PRECISION (pgf77, pgf90, and pghpf only). |
Optimization |
[no]r8intrinsics |
determines how the compiler treats the intrinsics CMPLX and REAL (pgf77, pgf90, and pghpf only). |
Optimization |
[no]recursive |
allocate (do not allocate) local variables on the stack, this allows recursion. SAVEd, data-initialized, or namelist members are always allocated statically, regardless of the setting of this switch (pgf77, pgf90, and pghpf only). |
Code Generation |
[no]reentrant |
specifies whether the compiler avoids optimizations that can prevent code from being reentrant. |
Code Generation |
[no]ref_externals |
do (don't) force references to names appearing in EXTERNAL statements (pgf77, pgf90, and pghpf only). |
Code Generation |
safeptr |
instructs the compiler to override data dependences between pointers and arrays (pgcc and pgCC only). |
Optimization |
safe_lastval |
In the case where a scalar is used after a loop, but is not defined on every iteration of the loop, the compiler does not by default parallelize the loop. However, this option tells the compiler it safe to parallelize the loop. For a given loop the last value computed for all scalars make it safe to parallelize the loop. |
Code Generation |
[no]save |
determines whether the compiler assumes that all local variables are subject to the SAVE statement (pgf77, pgf90, and pghpf only). |
Fortran Language |
schar |
specifies signed char for characters (pgcc and pgCC only - also see uchar). |
C/C++ Language |
[no]second_underscore |
do (don't) add the second underscore to the name of a Fortran global if its name already contains an underscore (pgf77, pgf90, and pghpf only). |
Code Generation |
[no]signextend |
specifies whether the compiler extends the sign bit, if it is set. |
Code Generation |
[no]single |
convert float parameters to double parameters characters (pgcc and pgCC only). |
C/C++ Language |
standard |
causes the compiler to flag source code that does not conform to the ANSI standard (pgf77, pgf90, and pghpf only). |
Fortran Language |
[no]stride0 |
the compiler generates (does not generate) alternate code for a loop that contains an induction variable whose increment may be zero (pgf77, pgf90, and pghpf only). |
Code Generation |
uchar |
specifies unsigned char for characters (pgcc and pgCC only - also see schar). |
C/C++ Language |
unix |
use UNIX calling and naming conventions for Fortran subprograms (pgf77, pgf90, and pghpf for NT only). |
Code Generation |
[no]unixlogical |
determines whether logical .TRUE. and .FALSE. are determined by non-zero (TRUE) and zero (FALSE) values for unixlogical. With nounixlogical, the default, -1 values are TRUE and 0 values are FALSE (pgf77, pgf90, and pghpf only). |
Fortran Language |
[no]unroll |
controls loop unrolling. |
Optimization |
[no]upcase |
determines whether the compiler allows uppercase letters in identifiers (pgf77, pgf90, and pghpf only). |
Fortran Language |
vect |
invokes the code vectorizer. |
Optimization |
Default: For arguments that you do not specify, the default code generation controls are as follows:
norecursive |
nostride0 |
noreentrant |
signextend |
nosecond_underscore |
noref_externals |
Default: For arguments that you do not specify, the default environment option depends on your configuration.
Cross-reference: -D, -I, -L, -l, -U
This section describes the -Mpgflag options that control function
inlining.
Usage: In the following example, the compiler extracts functions that have 500 or fewer statements from the source file myprog.f and saves them in the file extract.il.
$ pgf90 -Mextract=500 -oextract.il myprog.f
In the following example, the compiler inlines functions with fewer than approximately 100 statements in the source file myprog.f and writes the executable code in the default output file a.out.
$ pgf90 -Minline=size:100 myprog.f
Cross-reference: -o
This section describes the -Mpgflag options that affect Fortran
language interpretations by the PGI Fortran compilers. These options are only
valid to the pgf77, pgf90, and pghpf compilation
drivers.
Default: For arguments that you do not specify, the defaults are as follows:
nobackslash |
noiomutex |
nodclchk |
noonetrip |
nodefaultunit |
nosave |
nodlines |
nounixlogical |
dollar,_ |
noupcase |
This section describes the -Mpgflag options that affect
C/C++ language interpretations by the PGI C and C++
compilers. These options are only valid to the pgcc and
pgCC compilation drivers.
Default: For arguments that you do not specify, the defaults are as follows:
noasmkeyword |
nosingle |
dollar,_ |
schar |
Usage:
In this example, the compiler allows the asm keyword in the source file.
$ pgcc -Masmkeyword myprog.c
In the following example, the compiler maps the dollar sign to the dot character.
$ pgcc -Mdollar,. myprog.c
In the following example, the compiler treats floating-point constants as float values.
$ pgcc -Mfcon myprog.c
In the following example, the compiler does not convert float parameters to double parameters.
$ pgcc -Msingle myprog.c
Without -Muchar or with -Mschar, the variable ch is a signed character:
char ch;
signed char sch;
If -Muchar is specified on the command line:
$ pgcc -Muchar myprog.c
char ch above is equivalent to:
unsigned char ch;
Default: For arguments that you do not specify, the default optimization control options are as follows:
depchk |
nor8 |
i4 |
nor8intrinsics |
If you do not supply an option to -Mvect, the compiler uses defaults that are dependent upon the target system.
Usage: In this example, the compiler invokes the vectorizer with idiom recognition for Pentium III SSE instructions enabled.
$ pgf90 -Mvect=sse -Mcache_align myprog.f
Cross-reference: -g, -O
Default: For arguments that you do not specify, the default miscellaneous options are as follows:
inform |
warn |
nolist |
nobounds |
Usage: In the following example the compiler includes Fortran source code with the assembly code.
$ pgf90 -Manno -S myprog.f
In the following example the compiler displays information about inlined functions with fewer than approximately 20 source lines in the source file myprog.f.
$ pgf90 -Minfo=inline -Minline=20 myprog.f
In the following example the assembler does not delete the assembly file myprog.s after the assembly pass.
$ pgf90 -Mkeepasm myprog.f
In the following example the compiler creates the listing file myprog.lst.
$ pgf90 -Mlist myprog.f
In the following example array bounds checking is enabled.
$ pgf90 -Mbounds myprog.f
Cross-reference: -m, -S, -V, -v
Use the -module option to specify a particular directory in which
generated intermediate .mod files should be placed. If the -module
<moduledir> option is present, and USE statements are present in a
compiled program unit, <moduledir> will be searched for
.mod intermediate files prior to the search in the default (local)
directory.
Default: The compiler places .mod files in the current working directory, and searches only in the current working directory for pre-compiled intermediate .mod files.
Usage: The following command line requests that any intermediate module file produced during compilation of myprog.f be placed in the directory mymods (in particular, the file ./mymods/myprog.mod will be used):
$ pgf90 -module mymods myprog.f
Use the -mp option to instruct the compiler to interpret
user-inserted OpenMP shared-memory parallel programming directives and generate
an executable file which will utilize multiple processors in a shared-memory
parallel system. See Chapter 10, OpenMP Parallelization Directives for
Fortran, and Chapter 11, OpenMP Parallelization Pragmas for C and
C++, for a detailed description of this programming model and the
associated directives and pragmas.
Default: The compiler ignores user-inserted shared-memory parallel programming directives and pragmas.
Usage: The following command line requests processing of any shared-memory directives present in myprog.f:
$ pgf90 -mp myprog.f
Cross-reference: -Mconcur and -Mvect
(NT only)
Use the -mslibs option to instruct the compiler to use the Microsoft
linker and include files, and link against the Microsoft Visual C++
libraries. Microsoft Visual C++ must be installed in order to use this
switch. This switch can be used to link Visual C++-compiled program
units into PGI main programs on NT.
Default: The compiler uses the PGI-supplied linker and include files and links against PGI-supplied libraries.
Cross-reference: -msvcrt
(NT only)
Use the -msvcrt option to instruct the compiler to use Microsoft's
msvcrt.dll at runtime rather than the default crtdll.dll.
These files contain the Microsoft C runtime library and the default
mingw32 C runtime library respectively. It is recommended that you use
the -msvcrt option in combination with the -mslibs option.
Default: The compiler uses crtdll.dll at runtime.
Cross-reference: -mslibs
Invokes code optimization at the specified level.
Syntax:
-O [level]
Where level is one of the following:
Default: Table 7-3 shows the interaction between the -O option, -g option, and -Mvect options.
Optimize |
Debug |
-M |
Optimization Level
|
---|---|---|---|
none |
none |
none |
1 |
none |
none |
-Mvect |
2 |
none |
none |
-Mconcur |
2 |
none |
-g |
none |
0 |
-O |
none or -g |
none |
2 |
-Olevel |
none or -g |
none |
level |
-Olevel < 2 |
none or -g |
-Mvect |
2 |
-Olevel < 2 |
none or -g |
-Mconcur |
2 |
Unoptimized
code compiled using the option -O0 can be significantly slower than code
generated at other optimization levels. Like the -Mvect option, the
-Munroll option sets the optimization level to level-2 if no -O
or -g options are supplied. For more information on optimization, see
Chapters 2 and 3.
Usage: In the following example, since no optimization level is specified and a -O option is specified, the compiler sets the optimization to level-2.
$ pgf90 -O myprog.f
Cross-reference: -g, -Mpgflag
Names the executable file. Use the -o option to specify the
filename of the compiler object file. The final output is the result of
linking.
Syntax:
-o filename
Where filename is the name of the file for the compilation output. The filename must not have a .f extension.
Default: The compiler creates executable filenames as needed. If you do not specify the -o option, the default filename is the linker output file a.out.
Usage: In the following example, the executable file is myprog instead of the default a.out.
$ pgf90 myprog.f -o myprog
Cross-reference: -c ,-E, -F, -S
Syntax:
-pc { 32 | 64 | 80 }
The IA-32 architecture implements a floating-point stack using 8 80-bit registers. Each register uses bits 0-63 as the significand, bits 64-78 for the exponent, and bit 79 is the sign bit. This 80-bit real format is the default format (called the extended format). When values are loaded into the floating point stack they are automatically converted into extended real format. The precision of the floating point stack can be controlled, however, by setting the precision control bits (bits 8 and 9) of the floating control word appropriately. In this way, the programmer can explicitly set the precision to standard IEEE double-precision using 64 bits, or to single precision using 32 bits.[*] The default precision is system dependent. To alter the precision in a given program unit, the main program must be compiled with the same -pc option. The command line option -pc val lets the programmer set the compiler's precision preference. Valid values for val are:
Operations performed exclusively on the floating-point stack using extended precision, without storing into or loading from memory, can cause problems with accumulated values within the extra 16 bits of extended precision values. This can lead to answers, when rounded, that do not match expected results.
For example, if the argument to sin is the result of previous calculations performed on the floating-point stack, then an 80-bit value used instead of a 64-bit value can result in slight discrepancies. Results can even change sign due to the sin curve being too close to an x-intercept value when evaluated. To maintain consistency in this case, the programmer can assure that the compiler generates code that calls a function. According to the IA-32 ABI, a function call must push its arguments on the stack (in this way memory is guaranteed to be accessed, even if the argument is an actual constant.) Thus, even if the called function simply performs the inline expansion, using the function call as a wrapper to sin has the effect of trimming the argument precision down to the expected size. Using the -Mnobuiltin option on the command line for C accomplishes this task by resolving all math routines in the library libm, performing a function call of necessity. The other method of generating a function call for math routines, but one which may still produce the inline instructions, is by using the -Kieee switch.
A second example illustrates the precision control problem using a section of code to determine machine precision:
program find_precision
w = 1.0
100 w=w+w
y=w+1
z=y-w
if (z .gt. 0) goto 100
C now w is just big enough that |((w+1)-w)-1| >= 1 ...
print*,w
end
In this case, where the variables are implicitly real*4, operations are performed on the floating-point stack where optimization removed unnecessary loads and stores from memory. The general case of copy propagation being performed follows this pattern:
a = x
y = 2.0 + a
Instead of storing x into a, then loading a to perform the addition, the value of x can be left on the floating-point stack and added to 2.0. Thus, memory accesses in some cases can be avoided, leaving answers in the extended real format. If copy propagation is disabled, stores of all left-hand sides will be performed automatically and reloaded when needed. This will have the effect of rounding any results to their declared sizes.
For the above program, w has a value of 1.8446744E+19 when executed using default (extended) precision. If, however, -Kieee is set, the value becomes 1.6777216E+07 (single precision.) This difference is due to the fact that -Kieee disables copy propagation, so all intermediate results are stored into memory, then reloaded when needed. Copy propagation is only disabled for floating-point operations, not integer. With this particular example, setting the -pc switch will also adjust the result.
The switch -Kieee also has the effect of making function calls to perform all transcendental operations. Although the function still produces the IA-32 machine instruction for computation (unless in C the -Mnobuiltin switch is set), arguments are passed on the stack, which results in a memory store and load.
Finally, -Kieee also disables reciprocal division for constant divisors. That is, for a/b with unknown a and constant b, the expression is usually converted at compile time to a*(1/b), thus turning an expensive divide into a relatively fast scalar multiplication. However, numerical discrepancies can occur when this optimization is used.
Understanding and correctly using the -pc, -Mnobuiltin, and -Kieee switches should enable you to produce the desired and expected precision for calculations which utilize floating-point operations.
Usage:
$ pgf90 -pc 64 myprog.c
Selects variations for compilation. There are four uses for the
-Q option.
Syntax:
-Qdirdirectory
The first variety, using the dir keyword, lets you supply a directory parameter that indicates the directory where the compiler driver is located.
-Qoptionprog,opt
The second variety, using the option keyword, lets you supply the option opt to the program prog. The prog parameter can be one of pgftn, as, or ld.
-Qpathpathname
The third -Q variety, using the path keyword, lets you supply an additional pathname to the search path for the compiler's required .o files.
-Qproducesourcetype
The fourth -Q variety, using the produce keyword, lets you choose a stop-after location for the compilation based on the supplied sourcetype parameter. Valid sourcetypes are: .i, .c, .s and .o. These indicate respectively, stop-after preprocessing, compiling, assembling, or linking.
Usage: The following examples show the different -Q options.
$ pgf90 -Qproduce .s hello.f $ pgf90 -Qoption ld,-s hello.f $ pgf90 -Qpath /home/test hello.f $ pgf90 -Qdir /home/comp/new hello.f
Cross-reference: -p
Valid only on Linux and Solaris86. Passed to the linker. Instructs the
linker to hard-code the pathname <directory> into the search
path for generated shared object (dynamically linked library) files. Note that
there cannot be a space between R and <directory>.
Cross-reference: -fpic, -shared, -G
Interpret DOUBLE PRECISION variables as REAL
(-r4) or REAL variables as DOUBLE PRECISION
(-r8).
Usage:
$ pgf90 -r4 myprog.f
Cross-reference: -i2, -i4, -i8
Specifies the name of the driver startup configuration file. If the file
or pathname supplied is not a full pathname, the path for the configuration
file loaded is relative to the $DRIVER path (the path of the currently
executing driver). If a full pathname is supplied, that file is used for the
driver configuration file.
Syntax:
-rc [path] filename
Where path is either a relative pathname, relative to the value of $DRIVER, or a full pathname beginning with "/". Filename is the driver configuration file.
Default: The driver uses the configuration file .pgirc.
Usage: In the following example, the file .pgf90rctest, relative to /usr/pgi/linux86/bin, the value of $DRIVER, is the driver configuration file.
$ pgf90 -rc .pgf90rctest myprog.f
Cross-reference: -show
Stops compilation after the compiling phase and writes the
assembly-language output to the file filename.s, where the input file is
filename.f.
Default: The compiler produces an executable file.
Usage: In this example, pgf90 produces the file myprog.s in the current directory.
$ pgf90 -S myprog.f
Cross-reference: -c, -E, -F, -Mkeepasm, -o
Valid only on Linux.
Passed to the linker. Instructs the linker to produce a shared object
(dynamically linked library) file.
Cross-reference: -fpic, -G, -R
Produce driver help information describing the current driver
configuration.
Usage: In the following example, the driver displays configuration information to the standard output after processing the driver configuration file.
$ pgf90 -show myprog.f
Cross-reference: -V , -v, -###, -help, -rc
Do not print warning messages.
Usage: In the following example, the driver does not display warning messages.
$ pgf90 -silent myprog.f
Cross-reference: -v, -V, -w
Print execution times for various compilation steps.
Usage: In the following example pgf90 prints the execution times for the various compilation steps.
$ pgf90 -time myprog.f
Cross-reference: -#
Set the target architecture. By default, the PGI compilers produce code
specifically targeted to the type of processor on which the compilation is
performed. In particular, the default is to use so-called p6
instructions wherever possible when compiling on Pentium Pro/II/III
systems. These executables may not be useable on older generation systems
(Pentium, i486, etc) . Pentium-specific and Pentium Pro/II/III-specific
optimizations can be specified explicitly by using the -tp p5 and -tp
p6 options respectively. A blended p5/p6 style of code generation can be
specified using the -tp px option. Executables produced using -tp
px will run on any x86 system.
Syntax:
-tp {p5 | p6 | px}
Usage: In the following example pgf90 sets the target architecture to Pentium Pro/II/III:
$ pgf90 -tp p6 myprog.f
Default: The default style of code generation is auto-selected depending on the type of processor on which compilation is performed.
Undefines a preprocessor macro. Use the -U option or the
#undef preprocessor directive to undefine macros.
Syntax:
-Usymbol
Where symbol is a symbolic name.
Usage: The following examples undefine the macro test.
$ pgf90 -Utest myprog.F
$ pgf90 -Dtest -Utest myprog.F
Cross-reference: -D,-Mnostdde.
Displays additional information, including version messages.
Usage: The following command-line shows the output using the -V option.
$ pgf90 -V myprog.f
Cross-reference: -Minfo, -v
Use the -v option to display the invocations of the compiler,
assembler and linker. These invocations are command lines created by the
compilation driver from the files and the -W options you
specify on the compiler command-line.
Default: The compiler does not display individual phase invocations.
Cross-reference: -Minfo, -V
Passes arguments to a specific phase. Use the -W option to
specify options for the assembler, compiler or linker. Note: a given PGI
compiler command invokes the compiler driver, which parses the
command-line and generates the appropriate commands for the compiler, assembler
and linker.
Syntax:
-W {0 | a | l },option[,option...]
Where:
NOTE: You cannot have a space between the -W and the single-letter pass identifier, between the identifier and the comma, or between the comma and the option.
Usage: In the following example the linker loads the text segment at address 0xffc00000 and the data segment at address 0xffe00000.
$ pgf90 -Wl,-k,-t,0xffc00000,-d,0xffe00000 myprog.f
Do not print warning messages.
The following options are specific to PGCC C and/or C++.
(pgCC only)
Using this option the PGCC C++ compiler accepts code conforming to the
proposed ANSI C++ standard. Issue errors for non-conforming code.
Default: By default, the compiler accepts code conforming to the standard C++ Annotated Reference Manual.
Usage: The following command-line requests ANSI conforming C++.
$ pgCC -A hello.cc
Cross-references: -b and +p.
(pgCC only)
Enable or disable recognition of alternative tokens. These are tokens that make
it possible to write C++ without the use of the , , [, ], #, &, , ^,
and characters. The alternative tokens include the operator keywords (e.g.,
and, bitand, etc.) and digraphs. The default behavior is
--no_alternative_tokens.
(pgCC only)
Enable compilation of C++ with cfront 2.1 compatibility. This
causes the compiler to accept language constructs that, while not part of the
C++ language definition are accepted by the AT&T C++ Language
System (cfront release 2.1). This option also enables acceptance of
anachronisms.
Default: The compiler does not accept cfront language constructs that are not part of the C++ language definition.
Usage: In the following example the compiler accepts cfront constructs.
$ pgCC -b myprog.cc
Cross-references: --cfront2.1, -b3 , --cfront3.0, +p, -A
(pgCC only)
Enable compilation of C++ with cfront 3.0 compatibility. This
causes the compiler to accept language constructs that, while not part of the
C++ language definition are accepted by the AT&T C++ Language
System (cfront release 3.0). This option also enables acceptance of
anachronisms.
Default: The compiler does not accept cfront language constructs that are not part of the C++ language definition.
Usage: In the following example the compiler accepts cfront constructs.
$ pgCC -b3 myprog.cc
Cross-references: --cfront2.1, -b , --cfront3.0 , +p, -A
(pgCC only)
Enable or disable recognition of bool. The default value is --bool.
(pgCC only)
Enable compilation of C++ with cfront 2.1 compatibility. This
causes the compiler to accept language constructs that, while not part of the
C++ language definition are accepted by the AT&T C++ Language
System (cfront release 2.1). This option also enables acceptance of
anachronisms.
Default: The compiler does not accept cfront language constructs that are not part of the C++ language definition.
Usage: In the following example the compiler accepts cfront constructs.
$ pgCC --cfront_2.1 myprog.cc
Cross-references: -b, -b3 , --cfront3.0, +p, -A
(pgCC only)
Enable compilation of C++ with cfront 3.0 compatibility. This
causes the compiler to accept language constructs that, while not part of the
C++ language definition are accepted by the AT&T C++ Language
System (cfront release 3.0). This option also enables acceptance of
anachronisms.
Default: The compiler does not accept cfront language constructs that are not part of the C++ language definition.
Usage: In the following example the compiler accepts cfront constructs.
$ pgCC --cfront_3.0 myprog.cc
Cross-references: --cfront2.1, -b , -b3 , +p, -A
(pgCC only)
If other conditions are satisfied, create a precompiled header file with the
specified name. If --pch (automatic PCH mode) appears on the
command line following this option, its effect is erased.
(pgCC only)
Override the normal error severity of the specified diagnostic messages. The
message(s) may be specified using a mnemonic error tag or using an error
number.
(pgCC only)
Override the normal error severity of the specified diagnostic messages. The
message(s) may be specified using a mnemonic error tag or using an error
number.
(pgCC only)
Override the normal error severity of the specified diagnostic messages. The
message(s) may be specified using a mnemonic error tag or using an error
number.
(pgCC only)
Override the normal error severity of the specified diagnostic messages. The
message(s) may be specified using a mnemonic error tag or using an error
number.
(pgCC only)
Display the error message number in any diagnostic messages that are generated.
The option may be used to determine the error number to be used when overriding
the severity of a diagnostic message.
(pgCC only)
Enable/disable exception handling support. The default is --exceptions.
(pgCC only)
Defines <dirname> as the instantiation directory. The directory
must exist. This switch must appear on both the compile line and the link
line. The compiler will not delete objects from this directory.
(pgCC only)
Do/don't align long long integers on long long boundaries.
The default is --llalign.
Generate a list of make dependences and print them to stdout.
Compilation stops after the pre-processing phase.
Generate a list of make dependences and print them to the file
<file>.d, where <file> is the name of the file
under compilation.
(pgCC only)
By default, templates are instantiated in objects that reference them, and
multiple instantiations are avoided by calling pgprelnk to modify the
template instantiation file (an intermediate file with a .ii
extension). This does not work well for template libraries, where the
.ii files are not available to the archived .o files. As a
result, each file in a template library has to have its own local copy of each
template it instantiates.
With the --one_instantiation_per_object implementation, each template instantiation becomes an object in the instantiation directory, (default name: Template.dir). As a result, each template can be linked in independently. At link time, pgprelnk removes all the unnecessary instantiations in the local Template.dir objects, and passes the remaining objects to the linker. This is particularly useful in template libraries, where it results in only one instantiation of any template in the library.
The --one_instantiation_per_object flag must appear on both the compile line and the link line. It will create an additional .o in the instantiation directory for each instantiation. If --instantiation_dir is not used (see below), a temporary directory Template.dir is created and used as the instantiation directory, then deleted after linking of the executable.
If you use --one_instantiation_per_object to create your own template libraries, you must add the objects in the Template directory to the archive list. See the example below.
NOTE: Before using this switch for the first time, all .ii files should be removed. Old .ii files will cause unpredictable results. Note that the compiler also creates .ti files for use during instantiation.
(pgCC only)
Accept dollar signs ($) in identifiers.
Stops compilation after the preprocessing phase. Use the -P
option to halt the compilation process after preprocessing and write the
preprocessed output to the file filename.i, where the input file is
filename.c or filename.cc.
Use the -.suffix option with this option to save the intermediate file in a file with the specified suffix (see the -.suffix description for details).
Default: The compiler produces an executable file.
Usage: In the following example, the compiler produces the preprocessed file myprog.i in the current directory.
$ pgCC -P myprog.cc
Cross-references: -C,-c,-E, -Mkeepasm, -o, -S
(pgCC only)
Automatically use and/or create a precompiled header file. If
--use_pch or
--create_pch (manual PCH mode)
appears on the command line following this option, its effect is erased.
(pgCC only)
The directory in which to search for and/or create a precompiled header file.
This option may be used with automatic PCH mode (--pch) or manual
PCH mode (--create_pch or --use_pch).
(pgCC only)
Enable or disable the display of a message indicating that a precompiled header
file was created or used in the current compilation.
(pgCC only)
Specifies the name of a file to be included at the beginning of the
compilation. This option can be used to set system-dependent macros and types,
for example.
(pgCC only)
Creates the necessary template instantiations for template libraries that
reference other template libraries. In previous releases, for example,
libraries that reference templates in the Rogue Wave STL, would generate
undefined template references. Now, when the user builds the library object
files with the --one_instantiation_per_object flag, and pre-links the
object files with the command:
% pgCC --one_instantiation_per_object --prelink_objects *.o
the pre-linker will instantiate the templates required by the library.
(pgCC only)
Use a precompiled header file of the specified name as part of the current
compilation. If --pch (automatic PCH mode) appears on the
command line following this option, its effect is erased.
(pgCC only)
Enable or disable implicit use of the std namespace when standard header
files are included.
Default: The default is --using_std.
Usage: The following command-line disables implicit use of the std namespace:
$ pgCC --no_using_std hello.cc
(pgCC only)
Control instantiation of template functions.
Syntax:
-t [arg]
where arg is one of the following:
Usage: In the following example all templates are instantiated.
$ pgCC -tall myprog.cc
According to Intel documentation, this only affects the operations of add, subtract, multiply, divide, and square root.