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.

xlf90, xlf90_r, and xlf90_r7 commands and the set of xlf95, xlf95_r, and xlf95_r7<br />

commands. We recommend that you switch to the <strong>Fortran</strong> 95 <strong>for</strong>mats <strong>for</strong> data files<br />

whenever possible.<br />

By default, the xlf90, xlf90_r, and xlf90_r7 commands do not con<strong>for</strong>m completely<br />

to the <strong>Fortran</strong> 90 standard. Also, by default, the xlf95, xlf95_r, and xlf95_r7<br />

commands do not con<strong>for</strong>m completely to the <strong>Fortran</strong> 95 standard. If you need full<br />

compliance, compile with any of the following additional compiler options (and<br />

suboptions):<br />

-qnodirective -qnoescape -qextname -qfloat=nomaf:rndsngl:nofold -qnoswapomp<br />

-qlanglvl=90std -qlanglvl=95std<br />

Also, specify the following run-time options be<strong>for</strong>e running the program, with a<br />

command similar to the following:<br />

export <strong>XL</strong>FRTEOPTS="err_recovery=no:langlvl=90std"<br />

The default settings are intended to provide the best combination of per<strong>for</strong>mance<br />

and usability. There<strong>for</strong>e, it is usually a good idea to change them only when<br />

required. Some of the options above are only required <strong>for</strong> compliance in very<br />

specific situations. For example, you only need to specify -qextname when an<br />

external symbol, such as a common block or subprogram, is named main.<br />

Compiling <strong>XL</strong> <strong>Fortran</strong> SMP Programs<br />

You can use the xlf_r, xlf_r7, xlf90_r, xlf90_r7, xlf95_r, or xlf95_r7 command to<br />

compile <strong>XL</strong> <strong>Fortran</strong> SMP programs. The xlf_r and xlf_r7 commands are similar to<br />

the xlf command, the xlf90_r and xlf90_r7 commands are similar to the xlf90<br />

command, and the xlf95_r and xlf95_r7 commands are similar to the xlf95<br />

command. The main difference is that the thread-safe components (libraries,<br />

crt0_r.o, and so on) are used to link and bind the object files if you specify the<br />

xlf_r, xlf_r7, xlf90_r, xlf90_r7, xlf95_r, or xlf95_r7 command.<br />

Note that using any of these commands alone does not imply parallelization. For<br />

the compiler to recognize the SMP directives and activate parallelization, you must<br />

also specify -qsmp. In turn, you can only specify the -qsmp option in conjunction<br />

with one of these six invocation commands. When you specify -qsmp, the driver<br />

links in the libraries specified on the smplibraries line in the active stanza of the<br />

configuration file.<br />

Levels of POSIX pthreads API Support<br />

On <strong>AIX</strong> Version 5.1 and higher, <strong>XL</strong> <strong>Fortran</strong> supports 64-bit thread programming<br />

with the 1003.1-1996 (POSIX) standard pthreads API. It also supports 32-bit<br />

programming with both the Draft 7 and the 1003.1-1996 standard APIs.<br />

You can use invocation commands (which use corresponding stanzas in the xlf.cfg<br />

configuration file) to compile and then link your programs with either the<br />

1003.1-1996 standard or the Draft 7 interface libraries.<br />

v<br />

v<br />

To compile and then link your program with the 1003.1-1996 standard interface<br />

libraries, use the xlf_r, xlf90_r, or xlf95_r command. For example, you could<br />

specify:<br />

xlf95_r test.f<br />

To compile and then link your program with the Draft 7 interface libraries, use<br />

the xlf_r7, xlf90_r7, or xlf95_r7 command. For example, you could specify:<br />

xlf95_r7 test.f<br />

32 <strong>XL</strong> <strong>Fortran</strong> <strong>Enterprise</strong> <strong>Edition</strong> <strong>for</strong> <strong>AIX</strong> : User’s <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!