Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
E77790.pdf
Скачиваний:
2
Добавлен:
16.05.2024
Размер:
1.29 Mб
Скачать

3.4 Options Reference

3.4.75–onetrip

Enable one trip DO loops.

Compile DO loops so that they are executed at least once. DO loops in standard Fortran are not performed at all if the upper limit is smaller than the lower limit, unlike some legacy implementations of Fortran.

3.4.76–openmp

Synonym for -xopenmp.

3.4.77–p

(Obsolete) Compile for profiling with the prof profiler.

Prepare object files for profiling, see prof (1). If you compile and link in separate steps, and also compile with the -p option, then be sure to link with the -p option. -p with prof is provided mostly for compatibility with older systems. -pg profiling with gprof is possibly a better alternative.

3.4.78–pad[=p]

Insert padding for efficient use of cache.

This option inserts padding between arrays or character variables, if they are static local and not initialized, or if they are in common blocks. The extra padding positions the data to make better use of cache. In either case, the arrays or character variables can not be equivalenced.

p, if present, must be either %none or either (or both) local or common:

local

Add padding between adjacent local variables.

 

 

common

Add padding between variables in common blocks.

 

 

%none

Do not add padding. (Compiler default.)

 

 

Chapter 3 • Fortran Compiler Options

89

3.4 Options Reference

If both local and common are specified, they can appear in any order.

Defaults for -pad:

The compiler does no padding by default.

Specifying -pad, but without a value is equivalent to -pad=local,common.

The -pad[=p] option applies to items that satisfy the following criteria:

The items are arrays or character variables

The items are static local or in common blocks

For a definition of local or static variables, see “3.4.93 –stackvar” on page 96.

The program must conform to the following restrictions:

Neither the arrays nor the character strings are equivalenced

If -pad=common is specified for compiling a file that references a common block, it must be specified when compiling all files that reference that common block. The option changes the spacing of variables within the common block. If one program unit is compiled with the option and another is not, references to what should be the same location within the common block might reference different locations.

If -pad=common is specified, the declarations of common block variables in different program units must be the same except for the names of the variables. The amount of padding inserted between variables in a common block depends on the declarations of those variables. If the variables differ in size or rank in different program units, even within the same file, the locations of the variables might not be the same.

If -pad=common is specified, EQUIVALENCE declarations involving common block variables are flagged with a warning message and the block is not padded.

Avoid overindexing arrays in common blocks with -pad=common specified. The altered positioning of adjacent data in a padded common block will cause overindexing to fail in unpredictable ways.

It is the programmer’s responsibility to make sure that common blocks are compiled consistently when -pad is used. Common blocks appearing in different program units that are compiled inconsistently with -pad=common will cause errors.

3.4.79–pg

Compile for profiling with the gprof profiler. (-xpg is a synonym for -pg)

90 Oracle Developer Studio 12.6: Fortran User's Guide • July 2017

3.4 Options Reference

Compile self–profiling code in the manner of -p, but invoke a runtime recording mechanism that keeps more extensive statistics and produces a gmon.out file when the program terminates normally. Generate an execution profile by running gprof. See the gprof(1) man page for details.

Library options must be after the source and .o files (–pg libraries are static).

Note - There is no advantage compiling with -xprofile if you specify -pg. These two features do not prepare or use data provided by the other.

Profiles generated by using prof(1) or gprof(1) on 64-bit Oracle Solaris platforms or just gprof on 32-bit Oracle Solaris platforms include approximate user CPU times. These times are derived from PC sample data (see pcsample(2)) for routines in the main executable and routines in shared libraries specified as linker arguments when the executable is linked. Other shared libraries (libraries opened after process startup using dlopen(3C)) are not profiled.

On 32-bit Oracle Solaris systems, profiles generated using prof(1) are limited to routines in the executable. 32 bit shared libraries can be profiled by linking the executable with -pg and using gprof(1).

The Oracle Solaris 10 software does not include system libraries compiled with -p. As a result, profiles collected on Oracle Solaris 10 platforms do not include call counts for system library routines.

The compiler options -p, -pg, or -xpg should not be used to compile multi-threaded programs, because the runtime support for these options is not thread-safe. If a program that uses multiple threads is compiled with these options invalid results or a segmentation fault could occur at runtime.

Binaries compiled with -xpg for gprof profiling should not be used with binopt(1) as they are incompatible and can result in internal errors.

If you compile and link in separate steps, and you compile with -pg, then be sure to link with - pg.

On x86 systems, -pg is incompatible with -xregs=frameptr, and these two options should not be used together. Note also that -xregs=frameptr is included in -fast.

3.4.80–pic

Compile position–independent code for shared library.

Chapter 3 • Fortran Compiler Options

91

3.4 Options Reference

On SPARC, –pic is equivalent to -xcode=pic13. See “3.4.119 -xcode[=v]” on page 116 for more information on position-independent code.

On x86, produces position-independent code. Use this option to compile source files when building a shared library. Each reference to a global datum is generated as a dereference of a pointer in the global offset table. Each function call is generated in pc-relative addressing mode through a procedure linkage table.

3.4.81–PIC

Compile position–independent code with 32-bit addresses.

On SPARC, –PIC is equivalent to -xcode=pic32. See “3.4.119 -xcode[=v]” on page 116 for more information about position-independent code.

On x86, —PIC is equivalent to —pic.

3.4.82–preserve_argvalues[=simple|none|complete]

(x86) Saves copies of register-based function arguments in the stack.

When none is specified or if the -preserve_argvalues option is not specified on the command line, the compiler behaves as usual.

When simple is specified, up to six integer arguments are saved.

When complete is specified, the values of all function arguments in the stack trace are visible to the user in the proper order.

The values are not updated during the function lifetime on assignments to formal parameters.

3.4.83–Qoption pr ls

Pass the sub-option list ls to the compilation phase pr.

There must be blanks separating Qoption, pr, and ls. The Q can be uppercase or lowercase. The list is a comma–delimited list of sub-options, with no blanks within the list. Each sub-option must be appropriate for that program phase, and can begin with a minus sign.

92 Oracle Developer Studio 12.6: Fortran User's Guide • July 2017

Соседние файлы в предмете Информационные и сетевые технологии