Chapter 16. Command-Line Options
Reference
A command-line option allows you to specify specific behavior when a program is compiled and linked.
Compiler options perform a variety of functions, such as setting compiler characteristics, describing the object code to be produced, controlling the diagnostic messages emitted, and performing some preprocessor functions. Most options that are not explicitly set take the default settings. This reference chapter describes the syntax and operation of each compiler option. For easy reference, the options are arranged in alphabetical order.
For an overview and tips on which options are best for which tasks, refer to Chapter 2, “
Using Command Line
Options
,” on page 17
, which also provides summary tables of the different options.
This chapter uses the following notation:
[item]
Square brackets indicate that the enclosed item is optional.
{item | item}
Braces indicate that you must select one and only one of the enclosed items. A vertical bar (|) separates the choices.
...
Horizontal ellipses indicate that zero or more instances of the preceding item are valid.
PGI Compiler Option Summary
The following tables include all the PGI compiler options that are not language-specific. The options are separated by category for easier reference.
For a complete description of each option, see the detailed information later in this chapter.
Build-Related PGI Options
The options included in the following table are the ones you use when you are initially building your program or application.
199
200
Option
–#
–###
–Bdynamic
–Bstatic_pgi
–c
–D <args>
–dryrun
–drystdinc
–dynamiclib
–E
–F
--flagcheck
–flags
–fpic
–fPIC
–G
–g77libs
–help
–I <dirname>
–i2, –i4 and –i8
–K<flag>
PGI Compiler Option Summary
Table 16.1. PGI Build-Related Compiler Options
Description
Display invocation information.
Shows but does not execute the driver commands (same as the option –dryrun).
Compiles for and links to the DLL version of the PGI runtime libraries.
Compiles for and links to the static version of the PGI runtime libraries.
Stops after the assembly phase and saves the object code in filename.o.
Defines a preprocessor macro.
Shows but does not execute driver commands.
Displays the standard include directories and then exists the compiler.
Invokes the libtool utility program provided by Mac OS X to create the dynamic library. See the libtool man page for more information.
Stops after the preprocessing phase and displays the preprocessed file on the standard output.
Stops after the preprocessing phase and saves the preprocessed file in filename.f (this option is only valid for the PGI Fortran compilers).
Simply return zero status if flags are correct.
Display valid driver options.
(Linux and Mac OS X only) Generate position-independent code.
(Linux and Mac OS X only) Equivalent to –fpic.
(Linux only) Passed to the linker. Instructs the linker to produce a shared object file.
(Linux only) Allow object files generated by g77 to be linked into
PGI main programs.
Display driver help message.
Adds a directory to the search path for #include files.
–i2: Treat INTEGER variables as 2 bytes.
–i4: Treat INTEGER variables as 4 bytes.
–i8: Treat INTEGER and LOGICAL variables as 8 bytes and use 64bits for INTEGER*8 operations.
Requests special compilation semantics with regard to conformance to IEEE 754.
- -pedantic
–pg
–pgf77libs
–pgf90libs
–R<directory>
–r
–r4 and –r8
–rc file
–s
–S
–shared
–show
Option
--keeplnk
–L <dirname>
–l<library>
–m
–M<pgflag>
–mcmodel=medium
–module <moduledir>
–mp[=all, align,bind,
[no]numa]
–noswitcherror
–o
–pc <val>
Chapter 16. Command-Line Options Reference
Description
If the compiler generates a temporary indirect file for a long linker command, preserves the temporary file instead of deleting it.
Specifies a library directory.
Loads a library.
Displays a link map on the standard output.
Selects variations for code generation and optimization.
(–tp k8-64 and –tp p7-64 targets only) Generate code which supports the medium memory model in the linux86-64 environment.
(F90/F95/HPF only) Save/search for module files in directory
<moduledir>.
Interpret and process user-inserted shared-memory parallel programming directives (see Chapters 5 and 6).
Ignore unknown command line switches after printing an warning message.
Names the object file.
(–tp px/p5/p6/piii targets only) Set precision globally for x87 floating-point calculations; must be used when compiling the main program. <val> may be one of 32, 64 or 80.
Prints warnings from included <system header files>
Instrument the generated executable to produce a gprof-style gmon.out sample-based profiling trace file (–qp is also supported, and is equivalent).
Append PGF77 runtime libraries to the link line.
Append PGF90/PGF95 runtime libraries to the link line.
(Linux only) Passed to the Linker. Hard code <directory> into the search path for shared object files.
Creates a relocatable object file.
–r4: Interpret DOUBLE PRECISION variables as REAL.
–r8: Interpret REAL variables as DOUBLE PRECISION.
Specifies the name of the driver's startup file.
Strips the symbol-table information from the object file.
Stops after the compiling phase and saves the assembly–language code in filename.s.
(Linux only) Passed to the linker. Instructs the linker to generate a shared object file. Implies –fpic.
Display driver's configuration parameters after startup.
201