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

3.4 Options Reference

See “4.9 Module Files” on page 192 for more information about modules in Fortran.

3.4.64-mt[={yes|no}]

Use this option to compile and link multithreaded code.

This option passes -D_REENTRANT to the preprocessor.

-mt=yes is the default behavior of the compiler. -mt is equivalent to -mt=yes. If this behavior is not desired use the option -mt=no.

The -xopenmp option (for using the OpenMP shared-memory parallelization API) includes - mt=yes automatically.

Use this option consistently. If you compile and link one translation unit with -mt, you must compile and link all units of the program with -mt.

To determine which system support libraries will be linked by default, compile with the -dryrun option.

3.4.65–native

(Obsolete) Optimize performance for the host system.

This option is a synonym for -xtarget=native, which is preferred. The -fast option sets - xtarget=native.

3.4.66–noautopar

Disables automatic parallelization invoked by -autopar earlier on the command line.

3.4.67–nodepend

Cancel any -depend appearing earlier on the command line. -depend=no is the preferred usage over -nodepend.

Chapter 3 • Fortran Compiler Options

85

3.4 Options Reference

3.4.68-nofstore

(x86) Cancel -fstore on command line.

The compiler default is -fstore. -fast includes -nofstore.

3.4.69–nolib

Disable linking with system libraries.

Do not automatically link with any system or language library; that is do not pass any default -lx options on to ld. The normal behavior is to link system libraries into the executables automatically, without the user specifying them on the command line.

The -nolib option makes it easier to link one of these libraries statically. The system and language libraries are required for final execution. It is your responsibility to link them in manually. This option provides you with complete control.

Link libm statically and libc dynamically with f95:

demo% f95 -nolib any.f95 -Bstatic -lm -Bdynamic -lc

The order for the -lx options is important. Follow the order shown in the examples.

3.4.70–nolibmil

Cancel -libmil on command line.

Use this option after the -fast option to disable inlining of libm math routines:

demo% f95 -fast -nolibmil …

3.4.71–noreduction

Disable -reduction on command line.

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

3.4 Options Reference

This option disables -reduction.

3.4.72–norunpath

Do not build a runtime shared library search path into the executable.

The compiler normally builds into an executable a path that tells the runtime linker where to find the shared libraries it will need. The path is installation dependent. The -norunpath option prevents that path from being built in to the executable.

This option is helpful when libraries have been installed in some nonstandard location, and you do not wish to make the loader search down those paths when the executable is run at another site. Compare with -Rpaths.

3.4.73–O[n]

Specify optimization level.

n can be 1, 2, 3, 4, or 5. No space is allowed between -O and n.

If -O[n] is not specified, only a very basic level of optimization limited to local common subexpression elimination and dead code analysis is performed. A program’s performance may be significantly improved when compiled with an optimization level than without optimization. Use of -O (which sets -O3) or -fast (which sets -O5) is recommended for most programs.

Each -On level includes the optimizations performed at the levels below it. Generally, the higher the level of optimization a program is compiled with, the better runtime performance obtained. However, higher optimization levels may result in increased compilation time and larger executable files.

Debugging with -g does not suppress -On, but -On limits -g in certain ways; see the dbx documentation.

The -O3 and -O4 options reduce the utility of debugging such that you cannot display variables from dbx, but you can still use the dbx where command to get a symbolic traceback.

If the optimizer runs out of memory, it attempts to proceed over again at a lower level of optimization, resuming compilation of subsequent routines at the original level.

–O

This is equivalent to -O3.

Chapter 3 • Fortran Compiler Options

87

3.4 Options Reference

–O1

Provides a minimum of statement–level optimizations.

 

Use if higher levels result in excessive compilation time, or exceed

 

available swap space.

–O2

Enables basic block level optimizations.

 

This level usually gives the smallest code size. (See also -xspace.)

 

–O3 is preferred over -O2 unless -O3 results in unreasonably long

 

compilation time, exceeds swap space, or generates excessively large

 

executable files.

–O3

Performs automatic inlining of functions whose body is smaller than the

 

overhead of calling the function. To control which functions are inlined,

 

see -xinline=list.

 

Adds loop unrolling and global optimizations at the function level. Adds

 

-depend automatically.

 

Usually -O3 generates larger executable files.

–O4

Adds automatic inlining of routines contained in the same file.

 

Usually -O4 generates larger executable files due to inlining.

 

The -g option suppresses the -O4 automatic inlining described above.–

 

xcrossfile increases the scope of inlining with -O4.

–O5

Attempt aggressive optimizations.

 

Suitable only for that small fraction of a program that uses the largest

 

fraction of compute time. -O5’s optimization algorithms take more

 

compilation time, and may also degrade performance when applied to too

 

large a fraction of the source program.

 

Optimization at this level is more likely to improve performance if done

 

with profile feedback. See -xprofile=p.

3.4.74–o filename

Specify the name of the executable file to be written.

There must be a blank between -o and filename. Without this option, the default is to write the executable file to a.out. When used with -c, -o specifies the target .o object file; with -G or - shared, it specifies the target .so library file.

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

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