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

2.5 Compiler Usage Tips

print *, mypid

Including system.inc in program units calling routines in the Fortran library will automatically define the interfaces for you, and help the compiler diagnose type mismatches. (See the Fortran Library Reference for more information.)

2.5Compiler Usage Tips

The next sections suggest a number of ways to use the Fortran compiler efficiently. A complete compiler options reference follows in the next chapter.

2.5.1Determining Hardware Platform

Some compiler flags allow the user to tune code generation to a specific set of hardware platform options. The compiler’s -dryrun option can be used to determine the native processor:

<sparc>% f95 -dryrun -xtarget=native

###command line files and options (expanded):

###-dryrun -xchip=T5 -xcache=16/32/4/8:128/32/8/8:8192/64/16/128 -xarch=sparc4

<x64>% f95 -dryrun -xtarget=native

###command line files and options (expanded):

###-dryrun -xarch=sse2a -xcache=64/64/2:1024/64/16 -xchip=opteron

2.5.2Using Environment Variables

You can specify options by setting the FFLAGS or OPTIONS variables.

Either FFLAGS or OPTIONS can be used explicitly in the command line. When you are using the implicit compilation rules of make, FFLAGS is used automatically by the make program.

Example: Use FFLAGS explicitly:

demo% f95 $FFLAGS any.f

When using make, if the FFLAGS variable is set as above and the makefile’s compilation rules are implicit, that is, there is no explicit compiler command line, then invoking make will result in a compilation equivalent to:

Chapter 2 • Using Oracle Developer Studio Fortran

39

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