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

3.4 Options Reference

This option is provided primarily for debugging the internals of the compiler by support staff. Use the LD_OPTIONS environment variable to pass options to the linker.

3.4.84–qp

Synonym for -p.

3.4.85–R ls

Build dynamic library search paths into the executable file.

With this option, the linker, ld(1), stores a list of dynamic library search paths into the executable file.

ls is a colon–separated list of directories for library search paths. The blank between -R and ls is optional.

Multiple instances of this option are concatenated together, with each list separated by a colon.

The list is used at runtime by the runtime linker, ld.so. At runtime, dynamic libraries in the listed paths are scanned to satisfy any unresolved references.

Use this option to let users run shippable executables without a special path option to find needed dynamic libraries.

Building an executable file using -Rpaths adds directory paths to a default path that is always searched last.

For more information, see the Oracle Solaris 11.3 Linkers and Libraries Guide.

3.4.86–r8const

Promote single-precision constants to REAL*8 constants.

All single-precision REAL constants are promoted to REAL*8. Double-precision (REAL*8) constants are not changed. This option only applies to constants. To promote both constants and variables, see “3.4.186 –xtypemap=spec on page 163.

Chapter 3 • Fortran Compiler Options

93

3.4 Options Reference

Use this option flag carefully. It could cause interface problems when a subroutine or function expecting a REAL*4 argument is called with a REAL*4 constant that gets promoted to REAL*8. It could also cause problems with programs reading unformatted data files written by an unformatted write with REAL*4 constants on the I/O list.

3.4.87–recl=a[,b]

Set default output record length.

Set the default record length (in characters) for either or both preconnected units output (standard output) and error (standard error). This option must be specified using one of the following forms:

–recl=out:N

–recl=error:N

–recl=out:N1,error:N2

–recl=error:N1,out:N2

–recl=all:N

where N, N1, N2 are all positive integers in the range from 72 to 2147483646. out refers to standard output, error to standard error, and all sets the default record length to both. The default is –recl=all:80. This option is only effective if the program being compiled has a Fortran main program.

3.4.88–reduction

Recognize reduction operations in loops.

Analyze loops for reduction operations during automatic parallelization. There is potential for roundoff error with the reduction.

A reduction operation accumulates the elements of an array into a single scalar value. For example, summing the elements of a vector is a typical reduction operation. Although these operations violate the criteria for parallelizability, the compiler can recognize them and parallelize them as special cases when -reduction is specified.

This option is usable only with the automatic parallelization option —autopar. It is ignored otherwise. Explicitly parallelized loops are not analyzed for reduction operations.

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

3.4 Options Reference

3.4.89–S

Compile and only generate assembly code.

Compile the named programs and leave the assembly–language output on corresponding files suffixed with .s. No .o file is created.

3.4.90–s

Strip the symbol table out of the executable file.

This option makes the executable file smaller and more difficult to reverse engineer. However, this option inhibits debugging with dbx or other tools, and overrides -g.

3.4.91–shared

Produces a shared object rather than a dynamically-linked executable. This option is passed to ld (as -G), and cannot be used with the -dn option.

When you use the -shared option, the compiler passes default -l options to ld, which are the same options that would be passed if you created an executable.

If you are creating a shared object by specifying the -shared option along with other compiler options that are specified at both compile time and link time, make sure that those options are also specified when you link with the resulting shared object.

When you create a shared object, all the object files that are compiled for 64-bit SPARC architectures must also be compiled with an explicit -xcode value as documented under the description of -xcode. For more information, see “3.4.42 –G” on page 76.

3.4.92–silent

(Obsolete) Suppress compiler messages.

Normally, the f95 compiler does not issue messages, other than error diagnostics, during compilation. This option flag is provided for compatibility with the legacy f77 compiler, and its use is redundant except with the -f77 compatibility flag.

Chapter 3 • Fortran Compiler Options

95

3.4 Options Reference

3.4.93–stackvar

Allocate local variables on the stack whenever possible.

This option makes writing recursive and re-entrant code easier and provides the optimizer more freedom when parallelizing loops.

Use of -stackvar is recommended with any of the parallelization options.

Local variables are variables that are not dummy arguments, COMMON variables, variables inherited from an outer scope, or module variables made accessible by a USE statement.

With -stackvar in effect, local variables are allocated on the stack unless they have the attributes SAVE or STATIC. Note that explicitly initialized variables are implicitly declared with the SAVE attribute. A structure variable that is not explicitly initialized but some of whose components are initialized is, by default, not implicitly declared SAVE. Also, variables equivalenced with variables that have the SAVE or STATIC attribute are implicitly SAVE or

STATIC.

A statically allocated variable is implicitly initialized to zero unless the program explicitly specifies an initial value for it. Variables allocated on the stack are not implicitly initialized except that components of structure variables can be initialized by default.

Putting large arrays onto the stack with -stackvar can overflow the stack causing segmentation faults. Increasing the stack size may be required.

The initial thread executing the program has a main stack, while each slave thread of a multithreaded program has its own thread stack.

For slave threads, the default thread stack size is 4 Megabytes on 32–bit systems and 8 Megabytes on 64–bit systems. The limit command (with no parameters) shows the current main stack size. If you get a segmentation fault using -stackvar, try increasing the main and thread stack sizes.

Example: Show the current main stack size:

demo% limit

 

 

cputime

unlimited

 

filesize

unlimited

 

datasize

523256 kbytes

 

stacksize

8192 kbytes

<–––

coredumpsize

unlimited

 

descriptors

64

 

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

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