24.05.2014 Views

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The invocation commands have the following implications <strong>for</strong> directive triggers:<br />

v<br />

v<br />

For f77, <strong>for</strong>t77, f90, f95, xlf, xlf90, and xlf95, the directive trigger is <strong>IBM</strong>* by<br />

default.<br />

For all other commands, the directive triggers are <strong>IBM</strong>* and <strong>IBM</strong>T by default. If<br />

you specify -qsmp, the compiler also recognizes the <strong>IBM</strong>P, SMP$, and $OMP<br />

trigger constants. If you specify the -qsmp=omp option, the compiler only<br />

recognizes the $OMP trigger constant.<br />

If you specify the -qsmp compiler option, the following occurs:<br />

v The compiler turns on automatic parallelization.<br />

v The compiler recognizes the <strong>IBM</strong>P, <strong>IBM</strong>T, <strong>IBM</strong>*, SMP$, and $OMP directive<br />

triggers.<br />

<strong>XL</strong> <strong>Fortran</strong> provides the library libxlf90_r.a, in addition to libxlf90_t.a. The library<br />

libxlf90_r.a is a superset of libxlf90_t.a. The file xlf.cfg is set up to link to<br />

libxlf90_r.a automatically when you use the xlf90_r, xlf90_r7, xlf95_r, xlf95_r7,<br />

xlf_r, and xlf_r7 commands.<br />

libxlf90_t.a is a partial thread-support run-time library. It will be installed as<br />

/usr/lib/libxlf90_t.a with one restriction on its use: because routines in the library<br />

are not thread-reentrant, only one <strong>Fortran</strong> thread at a time can per<strong>for</strong>m I/O<br />

operations or invoke <strong>Fortran</strong> intrinsics in a multi-threaded application that uses the<br />

library. To avoid the thread synchronization overhead in libxlf90_r.a, you can use<br />

libxlf90_t.a in multi-threaded applications where there is only one <strong>Fortran</strong> thread.<br />

When you bind a multi-threaded executable with multiple <strong>Fortran</strong> threads, to link<br />

in routines in libxlf90_r.a, -lxlf90_r should appear instead of either -lxlf90_t or<br />

-lxlf90 in the command line. Note that using the xlf_r, xlf_r7, xlf90_r, xlf90_r7,<br />

xlf95_r, or xlf95_r7 invocation command ensures the proper linking.<br />

Compiling <strong>XL</strong> <strong>Fortran</strong> Version 2 Programs<br />

xlf maintains, wherever possible, compatibility with existing programs by using<br />

the same I/O <strong>for</strong>mats as earlier versions of <strong>XL</strong> <strong>Fortran</strong> and some implementation<br />

behavior compatible with FORTRAN 77.<br />

f77 is identical to xlf (assuming that the configuration file has not been<br />

customized).<br />

You may find that you need to continue using these commands <strong>for</strong> compatibility<br />

with existing makefiles and build environments. However, be aware that programs<br />

that you compile with these commands may not con<strong>for</strong>m to the <strong>Fortran</strong> 90 or<br />

<strong>Fortran</strong> 95 standard in subtle ways.<br />

Compiling <strong>Fortran</strong> 90 or <strong>Fortran</strong> 95 Programs<br />

The f90, xlf90, xlf90_r, and xlf90_r7 commands make your programs con<strong>for</strong>m more<br />

closely to the <strong>Fortran</strong> 90 standard than do the xlf, xlf_r, xlf_r7, and f77/<strong>for</strong>t77<br />

commands. The f95, xlf95, xlf95_r, and xlf95_r7 commands make your programs<br />

con<strong>for</strong>m more closely to the <strong>Fortran</strong> 95 standard than do the xlf, xlf_r, xlf_r7, and<br />

f77/<strong>for</strong>t77 commands. f90, xlf90, xlf90_r, xlf90_r7, f95, xlf95, xlf95_r, and xlf95_r7<br />

are the preferred commands <strong>for</strong> compiling any new programs. They all accept<br />

<strong>Fortran</strong> 90 free source <strong>for</strong>m by default; to use them <strong>for</strong> fixed source <strong>for</strong>m, you<br />

must use the -qfixed option. I/O <strong>for</strong>mats are slightly different between these<br />

commands and the other commands. I/O <strong>for</strong>mats also differ between the set of<br />

Editing, Compiling, Linking, and Running <strong>XL</strong> <strong>Fortran</strong> Programs 31

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!