Content-type: text/html
pgCC
Section: User Commands (1)
Updated: August 2003
Index
NAME
pgCC - The Portland Group Compiler Technology C++ compiler
SYNOPSIS
pgCC [ -# ] [ -### ] [ -A ] [ --alternative_tokens
]
[ --auto_instantiation ] [ -b ] [ -b3 ] [ --brief_diagnostics
]
[ -Bdynamic ] [ -Bstatic ] [ --bool ] [ --builtin
]
[ -C ] [ -c ] [ --cfront_2.1 ] [ --cfront_3.0
]
[ --create_pch ]
[ -Dname[=def] ] [ -define_macro <macro>
]
[ --dependencies ] [ --dependencies_to_file <filename>
]
[ --diag_error ] [ --diag_remark ] [ --diag_supress
]
[ --diag_warning ] [ --display_error_number ] [ --dollar
]
[ -dryrun ] [ -e ] [ --early_tiebreaker ] [
--enum_overloading ]
[ --error_limit <num> ] [ --exceptions ] [ --explicit
]
[ -fast ] [ -fastsse ] [ -flags ]
[ --for_init_diff_warning ] [ -fpic ] [ --force_vtbl
]
[ -G ] [ -g ] [ -g77libs ] [ --gnu_extensions
]
[ -help ] [ -Idirectory ]
[ --implicit_include ] [ --implicit_typename ]
[ --instantiate=<opt> ] [ --instantiation_dir
directory ]
[ -Kflag ] [ -Ldirectory ] [ -llibrary
]
[ --late_tiebreaker ] [ --llalign ] [ --list
]
[ --long_lifetime_temps ] [ --long_preserving_rules ]
[ -M ] [ -MD ] [ -Mpgflag ] [ -m
] [ -mp ]
[ --namespaces ] [ --new_for_init ] [ --no_alternative_tokens
]
[ --no_auto_instantiation ] [ --no_brief_diagnostics ]
[ --no_bool ] [ --no_enum_overloading ]
[ --no_exceptions ] [ --no_explicit ]
[ --no_for_init_diff_warning ] [ --no_implicit_include
]
[ --no_implicit_typename ] [ --no_line_commands ]
[ --no_long_preserving_rules ] [ --no_namespaces ]
[ --no_special_subscript_cost ] [ --no_using_std ] [
--nobuiltin ]
[ --nollalign ] [ --norestrict ] [ --nortti ]
[ -O[level] ] [ -o file ] [ --old_for_init
]
[ --one_instantiation_per_object ] [ -P ] [ -p
] [ +p ] [ --pch ]
[ --pch_dirdirectory ] [ --preinclude=filename
]
[ --prelink_objects ] [ --preprocess ]
[ --remarks ] [ --restrict ] [ --rtti ]
[ -Q ] [ -ql ] [ -qp ] [ -Rdirectory
] [ -r ] [ -rc ]
[ -S ] [ -s ] [ -shared ] [ -show
] [ -silent ]
[ --short_lifetime_temps ] [ --special_subscript_cost
]
[ --strict ] [ --strict_warnings ] [ --suppress_vtbl
]
[ -t ] [ -time ] [ -tp {px | p5 | p6 | piii
| piv | p7 | athlon | athlonxp | k7 | k8-32 | k8-64 } ]
[ -Uname ] [ -undefine_macroname ] [ --unsigned_chars
]
[ --using_std ] [ -uname ] [ -V ] [ -v
]
[ -Wpass,option[,option...] ] [ -w
]
[ -X ] [ -Xm ] [ -xh ] [ -Ypass,directory
]
sourcefile...
DESCRIPTION
pgCC is the interface to The Portland Group C++ compiler for
the X86 or AMD64 processors. It invokes the C++ compiler, assembler, and
linker with options derived from its command-line arguments.
pgCC bases its processing on the suffixes of the files it is
passed. Files whose names end with .cpp, .cc, .c,
or .C, are considered to be C++ source files. They are preprocessed,
compiled and assembled. The resulting object file is placed in the current
directory. Files whose names end with .s are considered to be X86
or AMD64 assembly language files. They are assembled and the resulting object
file is placed in the current directory. Files whose names end with .o
are taken as object files, and are passed directly to the linker if linking
is requested. Files whose names end with .a are taken as ar
libraries. No action is performed on .a files unless linking is
requested.
Files not ending in .cpp, .cc, .C, .c,
.o, .s, .ipo, or .a are taken as object
files and passed to the linker (if linking is requested) with a warning message.
If a single C++ program is compiled and linked with one pgCC
command, then the intermediate object and assembly files are deleted.
A NOTE ON C++ OPTIMIZATION
pgCC provides a number of options to enable different optimization
levels. PGI recommends the following switch combination as a starting point
for setting the optimization level: -fast -Minline=levels:10. The
best performance will be achieved if exception handling is also disabled
via --no_exceptions. To avoid excessive code expansion due to inlining,
move Standard Template Library I/O out of inlined objects. For additional
optimizations, refer to the -Msafeptr and -Mvect options.
OPTIONS
When source files are compiled using any of the -g, -mp,
-Mconcur, -Mipa, -Mpf, or -Mprof options,
the same option(s) should be used when using pgCC to link the objects.
- -#
- Display the invocations of the compiler, assembler, and linker. These
invocations are the command lines created by pgCC.
- -###
- Display invocations of the compiler, assembler and linker, but do not
execute them.
- -A
- With this option, pgCC accepts code conforming to the ANSI
standard for C++.
- --[no_]alternative_tokens
- (Disable) Enable recognition of alternative tokens. This controls
recognition of the digraph tokens in C and C++, and controls recognition
of the operator keywords (e.g., and) in C++.
- --[no_]auto_instantiation
- (Disable) Enable automatic instantiation of templates.
- -b
- Same as "--cfront_2.1"
- -b3
- Same as "--cfront_3.0"
- -Bdynamic
- Passed to the linker to specify dynamic binding
- -Bstatic
- Passed to the linker to specify static binding
- --[no_]bool
- (Disable) Enable recognition of the bool type.
- --[no_]brief_diagnostics
- (Disable) Enable a mode in which a shorter form of the diagnostic
output is used. When enabled, the original source line is not displayed
and the error message text is not wrapped when too long to fit on a single
line.
- --[no]builtin
- (Don't) compile with math subroutine builtin support, inlining selected
math library routines. --builtin is the default.
- -C
- Preserve comments in preprocessed C source files.
- -c
- Skip the link step; compile and assemble only.
- --cfront_2.1
- 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.
- --cfront_3.0
- Enable compilation of C++ with cfront 2.1/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 releases 2.1 and 3.0). This option also enables acceptance of anachronisms.
- --create_pch file-name
- 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.
- -Dname[=def]
- Define name to be def in the preprocessor. If def
is missing, it is assumed to be empty. If the = sign is missing, then name
is defined to be the string 1.
- -define_macro<macro>
- Define a preprocessor macro.
- --dependencies
- Writes makefile dependencies to stdout.
- --dependencies_to_file file-name
- Writes makefile dependencies to file-name.
- --diag_error iag,iag,...
- 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.
- --diag_remark iag,iag,...
- 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.
- --diag_suppress iag,iag,...
- 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.
- --diag_warning iag,iag,...
- 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.
- --display_error_number
- 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.
- --dollar
- Accept dollar signs in identifiers.
- -dryrun
- Use this option to display the invocations of the compiler, assembler,
and linker but do not execute them.
- -E
- Preprocess each input source file, .cc file, and send the
result to standard output. No compilation, assembly, or linking is performed.
- -e [ number ]
- Set the C++ front end error limit to the specified number. The C++
compiler will abandon compilation after the specified number of errors.
- --early_tiebreaker --late_tiebreaker
- Select the way that tie-breakers (e.g., cv-qualifier differences)
apply in overload resolution. In "early" tie-breaker processing, the tie-breakers
are considered at the same time as other measures of the goodness of the
match of an argument value and the corresponding parameter type (this is
the standard approach). In "late" tiebreaker processing, tie-breakers are
ignored during the initial comparison, and considered only if two functions
are otherwise equally good on all arguments; the tie-breakers can then be
used to choose one function over another.
- --[no_]enum_overloading
- (Disable) Enable support for using operator functions to overload
builtin operations on enum-typed operands.
- --error_limit<num>
- Set the error limit to num. The front end will abandon compilation
after this number of errors (remarks and warnings are not counted towards
the limit). By default, the limit is 100.
- --[no_]exceptions
- (Disable) Enable exception handling support. --exceptions is
the default.
- --[no_]explicit
- (Disable) Enable support for the explicit specifier on constructor
declarations.
- -fast
- Chooses generally optimal flags for the target platform. Equivalent
to "-O2 -Munroll -Mnoframe" on X86 or AMD64 platforms.
- -fastsse
- Chooses generally optimal flags for an X86 or AMD64 machine that supports
the SSE (Pentium 3/4, AthlonXP/MP) and SSE2 (Pentium 4) type instructions.
Equivalent to "-fast -Mscalarsse -Mvect=sse -Mcache_align -Mflushz" on X86
or AMD64 platforms.
- -flags
- Displays driver options on the standard output.
- --[no_]for_init_diff_warning
- (Disable) Enable a warning that is issued when programs compiled under
the new for-init scoping rules would have different behavior under the old
rules.
- --force_vtbl
- Force definition of virtual function tables in cases where the heuristic
used by the front end to decide on definition of virtual function tables
provides no guidance. See --suppress_vtbl.
- -fpic
- (Linux only) Instructs the compiler to generate position-independent
code which can be used to create shared object files (dynamically linked
libraries).
- -fPIC
- Equivalent to -fpic. Provided for compatibility with other compilers.
- -g
- Generate symbolic debug information. This also sets the optimization
level to zero, unless a
- -g77libs
- A link-time option which allows object files generated by GNU g77
(or gcc ) to be linked in to pgCC main programs. -O
switch is present on the command line. Symbolic debugging may give confusing
results if an optimization level other than zero is selected. -O0
code will be significantly slower than code generated at other optimization
levels.
- --gnu_extensions
- Allow gnu extensions like "include_next", which are required to compile
Linux system header files. This is the default on Linux systems.
- -help
- Displays options recognized by the driver on the standard output.
- -Idirectory
- Add directory to the compiler's search path for include files.
For include files surrounded by < >, each -I directory
is searched followed by the standard area. For include files surrounded
by " ", the directory containing the file containing the #include
directive is searched, followed by the -I directories, followed by
the standard area.
- --implicit_include
- Enable implicit inclusion of source files as a method of finding definitions
of tempalate entities to be instantiated.
- --[no_]implicit_typename
- (Disable) Enable implicit determination, from context, whether a template
parameter dependent name is type of nontype.
- --instantiate=none|all|used|local
- Control instantiation of external template entities. External template
entities are external (i.e. noninline and nonstatic) template functions
and tempate static data members. The instantiation mode determines the
template entities for which code should be generated base on the template
definition.
-
- none
- Instantiate no template entities. This is the default.
- used
- Instantiate only the tempate entities that are used in this compilation.
- all
- Instantiate all template entities whether or not they are used.
- local
- Instantiate only the template entities that are used in this compilation,
and force those entities to be local to this compilation.
- --instantiation_dir directory
- When --one_instatiation_per_object is used, this defines directory
as the instantiation directory. The default directory name is
template.dir.
- -Kflag
- Requests that the compiler provide special compilation semantics. The
permitted flags are:
-
- ieee
- Perform float and double divides in conformance
with the IEEE 754 standard. This is done by replacing the usual in-line
divide algorithm with a subroutine call, at the expense of performance.
The default algorithm produces results that differ from the correctly rounded
result by no more than 3 units in the last place. Also, on some systems,
a more accurate math library may be linked if -Kieee is used during
the link step.
- noieee
- Use the in-line divide algorithm, link in the non-IEEE libraries
if available, and disable underflow traps.
- PIC
- Equivalent to -fpic. Provided for compatibility with other compilers.
- pic
- Equivalent to -fpic. Provided for compatibility with other compilers.
- trap=option[,option]...
- Controls the behavior of the X86 or AMD64 processor when floating-point
exceptions occur. Possible options include fp, align
(ignored), inv, denorm, divz, ovf, unf,
and inexact. -Ktrap is only processed when compiling a main
function/program. The options inv, denorm, divz, ovf,
unf, and inexzct correspond to the X86 or AMD64 processor's
exception mask bits invalid operation, denormalized operand, divide-by-zero,
overflow, underflow, and precision, respectively. Normally, the X86 or
AMD64 processor's exception mask bits are on (floating-point exceptions are
masked - the processor recovers from exceptions and continues). If a floating-point
exception occurs and its corresponding mask bit is off (or "unmasked"), execution
terminates with an arithmetic exception (C's FPE signal). -Ktrap=fp
is equivalent to -Ktrap=inv,divz,ovf.
- -Ldirectory
- Change the default directory in which the linker searches for libraries
to directory . If the linker supports this option, then the option
is passed to the linker; otherwise, the driver replaces the default library
area with directory and uses it when constructing library path names.
Note that a library search path can be established using this option only
if the linker supports such functionality.
- -llibrary
- Load the library liblibrary.a from the standard
library directory. If the linker supports this option; then the option is
passed to the linker; otherwise the library name is constructed and the full
library path is passed to the linker. See the -L option below.
- --late_tiebreaker
- See --early_tiebreaker
- --list<file>
- Generate raw listing information in the file <file>.
This information is likely to be used to generate a formatted listing.
The raw listing file contains raw source lines, information on transitions
into and out of include files, and diagnostics generated by the front end.
- --[no]llalign
- (Don't) Do align long long integers on 64-bit boundaries.
- --long_lifetime_temps --short_lifetime_temps
- Select the lifetime for temporaries: "short" means to end of full
expression; "long" means to the earliest of end of scope, end of switch clause,
or the next label. "short" is standard C++, and "long is used by cfront.
- --[no_]long_preserving_rules
- (Disable) Enable the K&R usual arithmetic conversion rules with
respect to long.
- --[no_]namespaces
- (Disable) Enable support for namespaces.
- --new_for_init --old_for_init
- Control the scope of a declaration in a for-init-statement.
The old (cfront-compatible) scoping rules mean the declaration is in the
scope to which the for statement itself belongs; the new (standard-conforming)
rules in effect wrap the entire for statement in its own impicitly
generated scope.
- -M
- Generate a list of make dependences and print them to stdout.
- -MD
- Generate a list of make dependences and print them to the
file file.d, where file is the root name of the file under
compilation.
- -Mpgflag
- See the description for the -M pgflag options on the following
pages.
- -m
- Generate a link map on standard output.
- -mp
- Interpret OpenMP pragmas to explicitly parallelize regions of code
for execution by multiple threads on a multi-processor system. Most OpenMP
pragmas as well as the SGI parallelization pragmas are supported. See Chapter
11 of the PGI User's Guide for more information on these pragmas.
- --no_implicit_include
- By default, if the compiler needs a definition of a template declared
in a .h file, it will look to the corresponding .c file for the template
definition. This flag turns that feature off.
- --no_line_commands
- Do preprocessing only. Write preprocessed text to the preprocessing
output file, with comments removed and without line control information.
- -O[level]
- Set the optimization level. If -O is not specified, then the
default level is 1 if -g is not specified, and 0 if
-g is specified. If a number is not supplied with -O then
the optimization level is set to 2 . The optimization levels and
their meanings are as follows:
-
- 0
- A basic block is generated for each C statement. No scheduling
is done between statements. No global optimizations are performed.
- 1
- Scheduling within extended basic blocks is performed. Some register
allocation is performed. No global optimizations are performed.
- 2 3 4
- All level 1 optimizations are performed. In addition, traditional
scalar optimizations such as induction recognition and loop invariant motion
are performed by the global optimizer.
- -o file
- If -c is specified, names the object file, otherwise, use file
as the name of the executable program, rather then the default a.out.
- --old_for_init
- See --new_for_init
- --one_instantiation_per_object
- 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. Having each instantiation in a separate object file
is very useful when creating libraries, because it allows the user of the
library to pull only the instantiations that are needed. This flag is necessary
for template libraries that rely on other template libraries.
- -P
- Preprocess each file and leave the output in a file named file.i
for each file named file.cc.
- +p
- Disallow all anachronistic constructs. Ordinarily the C++ front end
warns about anachronistic constructs; using the +p option the compiler will
not compile code containing anachronistic constructs.
- --pch
- 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.
- --pch_dir directory-name
- 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).
- --[no_]pch_messages
- (Disable) Enable the display of a message indicating that a
precompiled header file was created or used in the current compilation.
- --preinclude=filename
- Specify a file to be included at the beginning of compilation; to
set system-dependent macros, types, etc.
- --prelink_objects
- When used with the --one_instantiation_per_object switch,
this creates template instantiations for a set of objects that are about
to become a template library. This is required for template libraries that
reference other template libraries.
- --preprocess
- Do preprocessing only. Write preprocessed text to the preprocessing
output file, with comments removed and with line control information.
- -Q
- Selects variations for compilation. There are four uses for the -Q
option.
-Qdir,directory specifies the directory where the C++ compiler
is located.
-Qoption,prog,opt supplies the option opt to the program
prog which is one of the phases of the compilation process (pgcpp1, pgcpp2,
as, or ld).
-Qpath,pathname this option lets you supply an additional
pathname to the search path for the .o files.
- -ql
- Enables line-level profiling. See -Mprof=lines
- -qp
- Enables profiling. See -Mprof=func
- -Rdirectory
- (Linux only) Passed to the linker; always search directory
for shared object files when running the generated executable.
- -r
- Passed to the linker; generate a re-linkable object file.
- -rc rcfile
- Specifies the name of a driver startup configuration file. If rcfile
is a full pathname, then use the specified file. If rcfile
is a relative pathname, use the file name as found in in the $DRIVER
directory.
- --remarks
- Issue remarks, which are diagnostic messages even milder than warnings.
- --[no]restrict
- (Disable) Enable the use of the restrict keyword.
- --[no]rtti
- (Disable) Enable support for RTTI (runtime type information) features:
dynamic_cast, typeid.
- -S
- Skip the assembly and link steps. Leave the output from the compile
step in a file named file.s for each source file.
- -s
- Passed to the linker; strip symbol table information.
- -shared
- (Linux only) Passed to the linker. Instructs the linker to generate
a shared object file (dynamically linked library).
- --short_lifetime_temps
- See --long_lifetime_temps
- -show
- Produce driver help information describing the current driver configuration.
- -silent
- Do not print warning messages. Same as -Minform=severe
- --[no_]special_subscript_cost
- (Disable) Enable a special nonstandard weighting of the conversion
to the integral operand of the [] operator in overload resolution. This
is a compatibilty feature that may be useful with some existing code.
- --strict --strict_warnings
- Enable strict ANSI/ISO mode, which provides diagnostic messages when
non-standard features are used, and disables features that conflict with
ANSI/ISO C or C++. The --strict switch causes errors while --strict_warnings
produces warnings.
- --suppress_vtbl
- Suppress definition of virtual function tables in cases where the
heuristic used by the front end to decide on definition of virtual function
tables provides no guidance. The virtual function table for a class is
defined in a compilation if the compilation contains a definition of the
first non-inline non-pure virtual function of the class.
- -targ
- Control instantiation of template functions. The argument arg
can be one of all, none, local, or used.
-
- all
- specifies that all template functions are instantiated whether
or not they are used.
- none
- specifies that no template functions are instantiated.
- local
- specifies that only the functions that are used in the compilation
are instantiated, and they are forced to be local. Note: this may cause
multiple copies of local static variables. If this occurs, the program
may not execute correctly.
- used
- specifies that only the functions that are used in the compilation
are instantiated.
- -time
- Print execution times for the various compilation steps.
- -tp
- Specify the type of the target processor; possibilities are -tp
px for blended code generation that will work on any X86 type processor,
-tp p5 for Pentium processors, -tp p6 for Pentium Pro/II
processors, -tp piii for Pentium III processors, -tp p7 | -tp
piv for Pentium 4 processors, -tp athlon for AMD Athlon processors,
-tp athlonxp | -tp k7 for AMD AthlonXP and AthlonMP processors.
-tp k8-32 for AMD64 Opteron processors running 32-bit applications,
and -tp k8-64 for AMD64 Opteron processors running 64-bit applications.
The default in the absence of the -tp flag is to compile for the
type of CPU on which the compiler is running.
- -Uname
- Remove any initial definition of name in the preprocessor.
The only names predefined by the preprocessor itself are the standard ANSI
C predefined macros. The driver may predefine other names (see the -Mnostddef
option above). Since all -D options are processed before all -U
options, the -U option can be used to override the -D option.
NOTE: ANSI C predefined macros can be defined and undefined on the command
line, but not with #define and #undefine directives in the
source.
- -uname
- Passed to the linker; generate undefined reference.
- -undefine_macroname
- Undefine a macro. See -U
- --unsigned_chars
- Make plain char unsigned.
- --use_pch file-name
- 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.
- --[no_]using_std
- (Disable) Enable implicit use of the std namespace when standard header
files are included. --using_std is the default.
- -V
- Display version messages and other information.
- -v
- Verbose mode. Print out the command line for each tool before it
is executed.
- -Wpass,option[,option...]
- Pass the options to the specified pass. Each comma-delimited
option is passed as a separate argument. The passes are: c
for the C++ front end, 0 for the C++ back end, a for the
assembler, i for the IPA linker, and l for the linker.
- -w
- Do not print warning messages.
- -Xxfile
- Generate cross reference information and place output in the specified
file.
- -Xm
- Allow $ in names.
- -Ypass,directory
- Look in directory for pass pass, rather then in the
standard area. The passes are:
-
- c
- Search for the C++ front end executable in directory.
- 0
- Search for the C++ back end executable in directory.
- a
- Search for the assembler executable in directory.
- C
- Search for the compiler library in directory.
- i
- Search for the IPA linker in directory.
- l
- Search for the linker executable in directory.
- p
- C++ prelink pass.
- m
- C++ munch pass.
- n
- C++ name pass.
- P
- Add standard library directory.
- S
- Search for the startup object files in directory.
- L
- If the linker supports the -YL option, then pass the option
-YL,directory to the linker. Otherwise, use directory
as the standard library location.
- U
- If the linker supports the -YU option, then pass the option
-YU,directory to the linker. Otherwise this option
is ignored.
- I
- Set the compiler's standard include directory to directory.
The standard include directory is set to a default value by the driver and
can be overridden by this option.
- -Mpgflag
- Request PGI-specific actions from the compiler. Many of pgflags
optionally begin with no (e.g. [no]list). If the default
of such an option is the no variant, this is indicated by no
appearing in bold italics as in [no]list. The permitted pgflags
are:
-
- anno
- Produce annotated assembly files, where source code is intermixed
with assembly language. -Mkeepasm or -S must be used as well.
- [no]asmkeyword
- (Don't) allow the asm keyword in C source code. The format
is: asm("<text>")
- [no]builtin
- (Don't) Do compile with math subroutine builtin support, which
causes selected math library routines to be inlined.
-
- [no]bounds
-
- Enable (disable) array bounds checking. Bounds checking is not
applied to a subscripting pointer.
- cache_align
- Align unconstrained data objects of size greater than or
equal to 16 bytes on cache-line boundaries. An unconstrained object
is a variable or array that is not a member of an aggregate structure or
common block, is not allocatable, and is not an automatic array.
- chkfpstk
- Check for internal consistency of the X86 or AMD64 FP stack in
the prologue of a function and after returning from a function or subroutine
call. If the PGI_CONTINUE environment variable is set, the stack will be
automatically cleaned up and execution will continue. There is a performance
penalty associated with the stack cleanup. If PGI_CONTINUE is set to verbose,
the stack will be automatically cleaned up and execution will continue after
a warning message is printed.
- 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.
- concur[=option[,option,...]]
- Instructs the compiler to enable auto-concurrentization of loops.
If -Mconcur is specified, multiple processors will be used to execute
loops which the compiler determines to be parallelizable. When linking, the
-Mconcur switch must be specified or unresolved references will
occur. The NCPUS environment variable controls how many processors
will be used to execute parallelized loops. The options can be one or more
of the following:
-
- altcode[:n]
- Instructs the parallelizer to generate alternate scalar code
for parallelized loops. If altcode is specified without arguments,
the parallelizer determines an appropriate cutoff length and generates scalar
code to be executed whenever the loop count is less than or equal to that
length. If altcode:n is specified, the scalar altcode is executed
whenever the loop count is less than or equal to n.
- noaltcode
- If noaltcode is specified, the parallelized version
of the loop is always executed regardless of the loop count.
- dist:block
- Parallelize with block distribution. Contiguous blocks of
iterations of a parallelizable loop are assigned to the available processors.
- dist:cyclic
- Parallelize with cyclic distribution. The outermost parallelizable
loop in any loop nest is parallelized. If a parallelized loop is innermost,
its iterations are allocated to processors cyclically. For example, if there
are 3 processors executing a loop, processor 0 performs iterations 0, 3,
6, etc; processor 1 performs iterations 1, 4, 7, etc; and processor 2 performs
iterations 2, 5, 8, etc.
- cncall
- Loops containing calls are safe to parallelize. Also, no
minimum loop count threshold must be satisfied before parallelization will
occur, and last values of scalars are assumed to be safe.
- noassoc
- Disables parallelization of loops with reductions.
- coff
- Generate a COFF formatted object
- [no]dalign
- (Don't) align doubles in structures on 8-byte boundaries. -Mnodalign
may lead to data alignment exceptions.
- [no]llalign
- (Don't) align long longs or INTEGER*8 in structures or common blocks
on 8-byte boundaries. -Mnollalign s the default, and this is a change
with release 4.0. Releases prior to 4.0 aligned long longs on 8-byte boundaries.
- [no]depchk
- (Don't) assume that potential data dependencies exists. -Mnodepchk
may result in incorrect code; the -Msafeptr switch provides a less
dangerous way to accomplish the same thing.
- dwarf1
- Generate DWARF1 debug information with -g
- dwarf2
- Generate DWARF2 debug information with -g. This is default.
- dollar,char
- Set the character used to replace dollar signs in names to be char.
Default is an underscore (_).
- elf
- Generate ELF formatted object
- extract=[option[,option,...]]
- Run the subprogram extraction phase to prepare for inlining. The
-o filename option or =lib:filename
option must be used with this switch to name an extract library. See -Minline
for more details on inlining.
-
- subprogram[,subprogram]
- A non-numeric option not containing a period is assumed to
be the name of a subprogram to be extracted.
- name:subprogram[,subprogram]
- Specifies the name of a subprogram or subprograms to be extracted.
- lib:directory
- Specifies the name of a directory to contain the extracted
subprograms; this directory will be created if it does not exist. The directory
may also be specified with the -o directory option.
- [size:]number
- A numeric option is assumed to be a size. Functions containing
number or less statements are extracted. If both number
and function are specified, then functions matching the given name(s)
or meeting the size requirements, are extracted.
- levels:<n>
- Extracts n times to gain multiple levels of inlining
- [no]flushz
- Set SSE MXCSR register to flush-to-zero mode
- [no]fptrap
- -Mnofptrap performs the semantics of -Knoieee (use
in-line divide, link in non-IEEE libraries if available, and disable underflow
traps) and disables floating point traps.
- [no]frame
- (Don't) generate frame setup code. Disabling frame pointers may
make programs run faster but prevents function traceback from working properly
when using a debugger.
- [no]func32
- Align functions on 32 byte boundaries
- info[=option[,option,...]]
- Emit useful information to stderr. The options are:
-
- time | stat
- Emit compilation statistics.
- loop
- Emit information about loops. This includes information about
loop unrolling, vectorization and software pipelining.
- inline
- Emit information about functions extracted and inlined.
- ipa
- Emit information about the InterProcedural Analyzer (IPA).
- sym
- Emit symbol names as comments in assembly file.
- all
- All of the above.
- inform=level
- instructs the compiler to display error messages at the specified
and higher levels, where level is one of the following:
-
- fatal
- instructs the compiler to display fatal error messages.
- severe
- instructs the compiler to display severe and fatal error messages.
- warn
- instructs the compiler to display warning, severe and fatal
error messages.
- inform
- instructs the compiler to display all error messages (inform,
warn, severe and fatal).
- inline[=option[,option,...]]
- Pass options to the function inliner. Inlining will occurr on
all member functions defined inside a class, and all functions marked with
the keyword inline. Refer to the pgCC User's Guide for further
restrictions on inlined functions. The options are:
-
- [lib:]filename.ext
- An option containing a period is assumed to be an inline library
created by a previous -Mextract option. If lib: is specified,
no period is necessary. Functions from the specified library are inlined.
If no library is specified, functions are extracted from a temporary library
created during an extract prepass.
- except:<func>
- Specifies which functions should not be inlined.
- [name:]function
- A non-numeric option not containing a period is assumed to
be a function name. If name: is specified, what follows is always
the name of a function.
- [size:]number
- A numeric option is assumed to be a size. Functions containing
number or less statements are inlined. If both number
and function are specified, then functions matching the given name(s)
or meeting the size requirements, are inlined.
- levels:number
- number of levels of inlining are performed. The default
is 1.
- ipa[=option[,option,...]]
- Pass options to the InterProcedural Analyzer (IPA). If no option
list is specified, then it is equivalent to -Mipa=const. The options
are:
-
- const
- noconst Enable or disable propagation of constants
across procedure calls.
- ptr
- Instructs the IPA to perform pointer disambiguation across
procedure calls.
- align
- Instructs the IPA to recognize when pointer targets are all
cache-line aligned, allowing better SSE code generation.
- arg
- Instructs the IPA to remove arguments replaced by -Mipa=ptr,const.
- localarg
- Externalizes local variables for use with -Mipa=arg
- vestigial
- Instructs the IPA to eliminate functions that are not called.
- globals
- Instructs the IPA to optimize references to globals when not
used in procedure calls.
- fast
- Equivalent to -Mipa=const,globals,ptr,vestigial.
- safe
- When the whole call tree is not available to the IPA, declares
that unknown procedures do not call back into the known procedures and do
not change global variables.
- pure
- Pure function detection.
- inline
- Instructs the IPA to inline functions.
- levels:<n>
- n is the maximum number of levels ipa should attempt
to inline, if appropriate. the IPA created executable over the non-IPA executable.
- collect
- Used to run the first phase of IPA, the data collection, without
generating code.
- ipofile
- Save the IPA information in a ".ipo" file instead of the default
of appending the information to the object file.
- noerror
- Disables the default behavior of producing an error if recompilation
is needed.
- rm
- The default. Removes stale object files at IPA link time.
- norm
- Overrides the -Mipa=rm process.
- keepasm
- Keep the assembly file for each C source file, but continue to
assemble and link the program. This is mainly for use in compiler performance
analysis and debugging.
- lfs
- Link in the Large File Support routines available on Linux versions
later than Red hat 7.0 or SuSE 7.1. This will support files from fortran
I/O that are larger than 2GB. Equivalent to -L$PGI/linux86/5.0/liblf .
- [no]list
- (Don't) create a listing file.
- lre[=assoc | noassoc]
- Perform Loop-carried redundancy elimination. assoc | noassoc
Allow or not allow expression reassociation.
- mpi
- (CDK only) -Mmpi inserts a -L$MPILIB -lfmpich -lmpich into the
link line, where $MPILIB is set in localrc (if it's not set, the -L$MPILIB
is left out). The user can set the environment variables MPILIB and MPILIBNAME
to rename the directory and library name.
- neginfo=option[,option]...
- Instructs the compiler to produce information on why certain optimizations
are not performed. Possible value for option include concur
and loop.
- noframe
- Eliminate operations that set up a true stack frame pointer for
functions.
- nontemporal
- Allow nontemporal move prefetching. Under -fastsse, -Mnontemporal
can sometimes be faster than -fastsse alone.
- noopenmp
- When -mp is present, ignore the OpenMP pragmas.
- nosgimp
- When -mp is present, ignore the SGI parallelization pragmas.
- nostartup
- Do not link in the usual startup routine. This routine contains
the entry point for the program.
- pf[=filename]
- Invoke the Profile Feedback Analyzer (PFA). This should be
used in conjunction with the IPA. Use file as the name of the PFA file
rather than the default
- nostddef
- Do not predefine any macros to the preprocessor when compiling
a C program. The normal predefined macros are: -Dx86 and -Dunix.
- nostdinc
- Do not search in the standard location for include files when
those files are not found elsewhere.
- nostdlib
- Do not link in the standard libraries when linking a program.
- novintr
- Do not generate vector intrinsic calls.
- nozerotrip
- Removes the zero-trip test. Only use when all loops are known
to execute at least once.
- prof[=option[,option,...]]
- Set profile options. Normally, the -q or -p switches
are used for this; however, on some systems, it is desirable to override
the default method of profiling. See the PGI profiler manual, or the system
profiler manual, for further information.
-
- func
- Perform PGI-style function level profiling.
- lines
- Perform PGI-style line level profiling.
- mpi
- Use and link MPICH-style profiling (CDK Only).
- quad
- Align large objects on quad-word boundaries.
- [no]reentrant
- (Don't) enable optimizations that may result in code that is not
reentrant. Even with -reentrant , the code may still not be reentrant
if it is improperly written (e.g., SAVEd variables).
- 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.
- safeptr[=option[,option,...]]
- Override data dependence between C pointers and arrays. This option
must be used with care since the potential exists for code to be generated
that will result in unexpected or incorrect results as is defined by ANSI
C. However, when used properly, this option has the potential to greatly
enhance the performance of code, especially floating point oriented loops.
Combinations of the options may be used and interact appropriately.
-
- dummy | arg
- C dummy arguments (pointers and arrays) are treated with the
same copyin/copyout semantics as Fortran dummy arguments.
- auto
- C local or auto variables (pointers and arrays) are assumed
not to overlap or conflict with other data objects and are independent.
- static
- C static variables (pointers and arrays) are assumed not to
overlap or conflict with other data objects and are independent.
- global
- C global or extern variables (pointers and arrays) are assumed
not to overlap or conflict with other data objects and are independent.
- scalapack
- Add the Scalapack libraries. (CDK only)
- scalarsse
- Utilize the SSE (Pentium 3, 4, AthlonXP/MP/64, Opteron) and SSE2
(Pentium 4/Athlon64/Opteron) instructions to perform the operations coded.
This assumes the user has an assembler capable of interpreting SSE/SSE2 instructions,
as in later versions of Linux. This implies -Mflushz.
- [no]signextend
- (Don't) sign extend when a narrowing conversion overflows. For
example, if -Msignextend is in effect and an integer containing the
value 65535 is converted to a short, the value of the short will be -1. This
option is provided for compatibility with other compilers, even though ANSI
C specifies that the result of such conversions are undefined. -Msignextend
will decrease performance.
- schar
- Specify signed char characters. Also see the -Muchar
option.
- [no]signextend
- (Don't) sign extend when a narrowing conversion overflows. For
example, if -Msignextend is in effect and an integer containing the
value 65535 is converted to a short, the value of the short will be -1. This
option is provided for compatibility with other compilers, even though ANSI
C specifies that the result of such conversions are undefined. -Msignextend
will decrease performance.
- [no]single
- (Don't) suppress the ANSI-specified conversion of float
to double when passing arguments to a function with no prototype
in scope. -Msingle may result in faster code when single precision
is used a lot, but is non-ANSI compliant.
- stabs
- Generates limited stabs info. (Windows only)
- uchar
- Treat plain char declarations as unsigned char
declarations. Also see the -Mschar option..
- unroll [=option [,option...]]
- invokes the loop unroller. This also sets the optimization level
to 2 if the level is set to less than 2. The option is one of the following:
-
- c:m
- instructs the compiler to completely unroll loops with a
constant loop count less than or equal to m, a supplied constant.
If this value is not supplied, the m count is set to 4.
- n:u
- instructs the compiler to unroll
u times, a loop which is not completely unrolled, or has a non-constant
loop count. If u is not supplied, the unroller computes the number
of times a candidate loop is unrolled.
- vect[=option[,option,...]]
- Pass options to the internal vectorizer. If no option list is
specified, then the following vector optimizations are used: assoc,cachesize:262144,nosse.
The vect options are:
-
- altcode:n
- Instructs the vectorizer to generate alternate scalar code
for vectorized loops. If altcode is specified without arguments, the
vectorizer determines an appropriate cutoff length and generates scalar code
to be executed whenever the loop count is less than or equal to that length.
If altcode:n is specified, the scalar altcode is executed whenever
the loop count is less than or equal to n.
- noaltcode
- If noaltcode is specified, the vectorized version of
the loop is always executed regardless of the loop count.
- assoc
- Instructs the vectorizer to enable certain associativity conversions
that can change the results of a computation due to roundoff error. A typical
optimization is to change an arithmetic operation to an arithmetic operation
that is mathematically correct, but can be computationally different, due
to round-off error.
- noassoc
- Instructs the vectorizer to disable associativity conversions.
- cachesize[:number]
- Instructs the vectorizer, when performing cache tiling optimizations,
to assume a cache size of number.
- prefetch
- Instructs the vectorizer to search for loops, and where possible,
use the Pentium III or Athlon prefetch instructions.
- sse
- Instructs the vectorizer to search for loops, and where possible,
use the Pentium III SSE and prefetch or the AthlonXP 3Dnow and prefetch instructions.
- nosse
- Instructs the vectorizer not to use Pentium III SSE or prefetch
or AthlonXP 3Dnow or prefetch instructions.
- idiom
- Instructs the vectorizer to look for idioms that can be directly
substitured with internal routines before performing vectorizing optimizations.
- noidiom
- Instructs the vectorizer to not look for idioms, before performing
vectorizing optimizations. This is the default behavior.
ENVIRONMENT
pgCC runs in two distinct environments. The first is a cross
environment, where the compiler runs on one host and generates code for a
different host. The second is a native environment, where the compiler and
the generated code both run on the same machine.
Each of these environments use different directories for the executables,
different libraries, and different default options. In addition, there may
be custom installations that define their own default parameters to the compilers.
The remainder of this section describes the standard PGI implementation.
FILES
- a.out
- executable output file, UNIX
- a.exe
- executable output file, Windows NT
- pgprof.out
- PGPROF output file,
- file.a
- library of object files
- file.C
- C++ source file
- file.cc
- C++ source file
- file.cpp
- C++ source file
- file.i
- C++ source file after preprocessing.
- file.ipa
- InterProcedural Analyzer (IPA) file
- file.ipo
- InterProcedural Analyzer (IPA) file
- file.o
- object file
- file.s
- assembler source file.
- file.ti
- C++ template instantiation file
Executables reside in $PGI/<target>/5.0/bin; libraries
and objects reside in $PGI/<target>/5.0/lib. PGI is
an environment variable that is set to the root of the compiler installation
directory. If PGI is not set, the default is /usr/pgi on
UNIX systems and C:/pgi on Windows NT systems.
- $PGI/<target>/5.0/bin/.pgCCrc
- Driver C++ configuration file
- $PGI/<target>/5.0/bin/.pgirc
- Default driver startup configuration file
- $PGI/linux86/5.0/bin/linux86rc
- Compiler driver configuration file (Linux only)
- $PGI/nt86/5.0/bin/nt86rc
- Compiler driver configuration file (Windows NT only)
- $PGI/<target>/5.0/bin/pgCC
- C++ compilation driver
- $PGI/<target>/5.0/bin/pgCCrc
- C++ compiler driver configuration file
- $PGI/<target>/5.0/bin/pgc
- C compiler
- $PGI/<target>/5.0/bin/pgc_ex
- C compiler function extractor
- $PGI/<target>/5.0/bin/pgcc
- C compiler driver
- $PGI/<target>/5.0/bin/pgcomprc
- C compiler driver configuration file.
- $PGI/<target>/5.0/bin/pgdecode
- C++ name demangler
- $PGI/<target>/5.0/bin/pgcpp1
- C++ Pre-pass 1
- $PGI/<target>/5.0/bin/pgcpp2
- C++ Pre-pass 2
- $PGI/<target>/5.0/bin/pgcpp2ex
- C++ Pre-pass extractor
- $PGI/<target>/5.0/bin/pgmunch
- C++ constructor generator
- $PGI/<target>/5.0/bin/pgprelnk
- C++ template generator
- $PGI/<target>/5.0/bin/sharedrc
- Driver configuration file
- $PGI/<target>/5.0/lib/initmp.o
- Initialization routine.
- $PGI/<target>/5.0/lib/libC.a
- C++ Library.
- $PGI/<target>/5.0/lib/libpgc.a
- C startup routines
- $PGI/<target>/5.0/lib/libstd.a
- Standard template library.
- $PGI/<target>/5.0/lib/libpgmp.a
- C++ MP library
- $PGI/<target>/5.0/include
- Include files for C library
- $PGI/<target>/5.0/include/CC
- Include files for C++ libraries
SEE ALSO
pgcc, pgf77, pgf90, pghpf, pgprof, pgdbg,
and the PGI User's Guide.
DIAGNOSTICS
The compiler produces information and error messages as it translates the
input program. The linker and assembler may issue their own error messages.
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- A NOTE ON C++ OPTIMIZATION
-
- OPTIONS
-
- ENVIRONMENT
-
- FILES
-
- SEE ALSO
-
- DIAGNOSTICS
-
This document was created by man2html, using the manual
pages.
Time: 19:23:23 GMT, December 19, 2003