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

3.4 Options Reference

You must always specify -xjobs with a value. Otherwise, an error diagnostic is issued and compilation aborts.

If -xjobs is not specified, the default behavior is -xjobs=auto. This can be overridden by adding -xjobs=n to the command line. Multiple instances of -xjobs on the command line override each other until the right-most instance is reached.

3.4.140.1 -xjobs Examples

The following example links with up to three parallel processes for -xipo:

% cc -xipo -xO4 -xjobs=3 t1.o t2.o t3.o

The following example links serially with a single process for -xipo:

% cc -xipo -xO4 -xjobs=1 t1.o t2.o t3.o

The following example links in parallel, with the compiler choosing the number of jobs for - xipo:

% cc -xipo -xO4 t1.o t2.o t3.o

Note that this is exactly the same behavior as when explicitly specifying -xjobs=auto:

% cc -xipo -xO4 -xjobs=auto t1.o t2.o t3.o

3.4.141 -xkeep_unref[={[no%]funcs,[no%]vars}]

Keep definitions of unreferenced functions and variables. The no% prefix allows the compiler to potentially remove the definitions.

The default is no%funcs,no%vars. Specifying -xkeep_unref is equivalent to specifying - xkeep_unref=funcs,vars, meaning that -keep_unref keeps everything.

3.4.142 –xkeepframe[=[%all,%none,name,no%name]]

Prohibit stack related optimizations for the named functions (name).

%all

Prohibit stack related optimizations for all the code.

Chapter 3 • Fortran Compiler Options

135

3.4 Options Reference

%none

Allow stack related optimizations for all the code.

This option is accumulative and can appear multiple times on the command line. For example, —xkeepframe=%all —xkeepframe=no%func1 indicates that the stack frame should be kept for all functions except func1. Also, —xkeepframe overrides —xregs=frameptr. For example, — xkeepframe=%all —xregs=frameptr indicates that the stack should be kept for all functions, but the optimizations for —xregs=frameptr would be ignored.

If not specified on the command line, the compiler assumes -xkeepframe=%none as the default. If specified but without a value, the compiler assumes -xkeepframe=%all

3.4.143 –xknown_lib=library_list

Recognize calls to a known library.

When specified, the compiler treats references to certain known libraries as intrinsics, ignoring any user-supplied versions. This enables the compiler to perform optimizations over calls to library routines based on its special knowledge of that library.

The library_list is a comma-delimited list of keywords currently to blas, blas1, blas2, blas3, and intrinsics. The compiler recognizes calls to the following BLAS1, BLAS2, and BLAS3 library routines and is free to optimize appropriately for the Oracle Developer Studio Performance Library implementation. The compiler will ignore user-supplied versions of these

library routines and use the BLAS routines in the Oracle Developer Studio Performance Library or inline the routines.

The —library=sunperf option is needed to link with the Oracle Developer Studio Performance Library.

-xknown_lib=

Feature

 

 

blas1

The compiler recognizes calls to the following BLAS1 library routines:

caxpy ccopy cdotc cdotu crotg cscal csrot csscal cswap dasum daxpy dcopy ddot drot drotg drotm drotmg dscal dsdot dswap dnrm2 dzasum dznrm2 icamax idamax isamax izamax sasum saxpy scasum scnrm2 scopy sdot sdsdot snrm2 srot srotg srotm srotmg sscal sswap zaxpy zcopy zdotc zdotu zdrot zdscal zrotg zscal zswap

blas2

The compiler recognizes calls to the following BLAS2 library routines:

 

cgemv

cgerc cgeru ctrmv ctrsv dgemv dger dsymv dsyr

dsyr2

dtrmv dtrsv

 

sgemv

sger ssymv ssyr ssyr2 strmv strsv zgemv zgerc

zgeru

ztrmv ztrsv

 

 

blas3

The compiler recognizes calls to the following BLAS2 library routines:

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

 

 

3.4 Options Reference

 

 

 

 

 

 

 

-xknown_lib=

Feature

 

 

 

 

 

cgemm csymm csyr2k csyrk ctrmm ctrsm dgemm dsymm dsyr2k dsyrk dtrmm dtrsm

 

 

sgemm ssymm ssyr2k ssyrk strmm strsm zgemm zsymm zsyr2k zsyrk ztrmm ztrsm

 

 

 

 

blas

Selects all the BLAS routines. Equivalent to -xknown_lib=blas1,blas2,blas3

 

 

 

 

intrinsics

The compiler ignores any explicit EXTERNAL declarations for Fortran intrinsics, thereby

 

 

ignoring any user-supplied intrinsic routines. (See the Fortran Library Reference for

 

 

lists of intrinsic function names.)

 

 

 

3.4.144 –xl

(Obsolete) This legacy f77 option is no longer supported. For the equivalent options in the current Fortran compiler, use: -f77=%all,no%backslash -vax=$all,no%debug

3.4.145 –xlang=f77

(Obsolete) This option is obsolete and does not do anything since the Fortran 77 object files are no longer supported. It might be removed in a future release.

3.4.146 –xld

(Obsolete) This (f77) option is no longer supported. For the equivalent options in the current Fortran compiler, use: -f77=%all,no%backslash -vax=$all,no%debug

3.4.147 –xlibmil

Synonym for -libmil.

3.4.148 –xlibmopt[={%none,archive,shared}]

Controls whether the compiler uses a library of optimized math routines or the standard system math routines. The possible argument values are:

Chapter 3 • Fortran Compiler Options

137

3.4 Options Reference

%none

Do not link with the optimized math library. (This is the default when no

 

-xlibmopt option is specified.)

archive

Link with the optimized math library in static archive form. (This is the

 

default when -xlibmopt is specified with no argument.)

shared

(Oracle Solaris) Link with the optimized math library in shared object

 

form.

The rightmost instance of this option on the command line overrides all the previous instances. The order of this option relative to other libraries specified on the command line is not significant.

The optimized math library includes selected math routines normally found in libm. The optimized routines typically run faster than their libm counterparts. The results may be slightly different from those produced by the libm routines, although in most cases they differ only

in the least significant bit. When the static archive form of the optimized library is used, the compiler selects routines that are optimized for the instruction set indicated by the -xarch value specified when linking. When the shared object form is used, the most appropriate routines are selected at runtime based on the instruction set supported by the system being used.

Note - The shared object form is available only on Oracle Solaris.

The routines in the optimized math library depend on the default round-to-nearest floating point rounding mode. If you use the optimized math library, you must ensure that round-to-nearest mode is in effect when any of these routines is called.

3.4.149 –xlinkopt[={1|2|0}]

(Oracle Solaris) Perform link-time optimizations on relocatable object files.

The post-optimizer performs a number of advanced performance optimizations on the binary object code at link-time. The optional value sets the level of optimizations performed, and must be 0, 1, or 2.

0

The post-optimizer is disabled. (This is the default.)

 

 

1

Perform optimizations based on control flow analysis, including instruction cache coloring and branch

 

optimizations, at link time.

 

 

2

Perform additional data flow analysis, including dead-code elimination and address computation

 

simplification, at link time.

 

 

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

3.4 Options Reference

Specifying the -xlinkopt flag without a value implies -xlinkopt=1.

These optimizations are performed at link time by analyzing the object binary code. The object files are not rewritten but the resulting executable code may differ from the original object codes.

This option is most effective when used to compile the whole program, and with profile feedback.

When compiling in separate steps, -xlinkopt must appear on both compile and link steps.

demo% f95 -c -xlinkopt a.f95 b.f95 demo% f95 -o myprog -xlinkopt=2 a.o b.o

Note that the level parameter is only used when the compiler is linking. In the example above, the post-optimization level used is 2 even though the object binaries were compiled with an implied level of 1.

The link-time post-optimizer cannot be used with the incremental linker, ild. The -xlinkopt flag will set the default linker to be ld. Enabling the incremental linker explicitly with the - xildon flag will disable the -xlinkopt option if both are specified together.

For the -xlinkopt option to be useful, at least some, but not necessarily all, of the routines in the program must be compiled with this option. The optimizer can still perform some limited optimizations on object binaries not compiled with -xlinkopt.

The -xlinkopt option optimizes code coming from static libraries that appear on the compiler command line, but does not optimize code coming from shared (dynamic) libraries that appear on the command line. You can also use -xlinkopt when building shared libraries (compiling with -G ).

The -xlinkopt option requires profile feedback (-xprofile) in order to optimize the program. Profiling reveals the mostand least-used parts of the code, which enables the optimizer

to focus its effort accordingly. Link-time optimization is particularly important with large applications where optimal placement of code can substantially reduce instruction cache misses. Additionally, -xlinkopt is most effective when used to compile the whole program. Use this option as follows:

demo% f95 -o progt -xO5 -xprofile=collect:prog file.f95 demo% progt

demo% f95 -o prog -xO5 -xprofile=use:prog -xlinkopt file.95

For details on using profile feedback, see the -xprofile option

Note that compiling with this option will increase link time slightly. Object file sizes also increase, but the size of the executable remains the same. Compiling with the -xlinkopt and -g flags increases the size of the executable by including debugging information.

Chapter 3 • Fortran Compiler Options

139

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