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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

Programs<br />

Most <strong>Fortran</strong> program development consists of a repeating cycle of editing,<br />

compiling and linking (which is by default a single step), and running. If you<br />

encounter problems at some part of this cycle, you may need to refer to the<br />

sections that follow this one <strong>for</strong> help with optimizing, debugging, and so on.<br />

Prerequisite In<strong>for</strong>mation:<br />

1. Be<strong>for</strong>e you can use the compiler, all the required <strong>AIX</strong> settings (<strong>for</strong> example,<br />

certain environment variables and storage limits) must be correct <strong>for</strong> your user<br />

ID; <strong>for</strong> details, see “Correct Settings <strong>for</strong> Environment Variables” on page 12.<br />

2. Be<strong>for</strong>e using the compiler <strong>for</strong> a specialized purpose, such as porting or<br />

per<strong>for</strong>mance tuning, look at the categories of options in “Summary of the <strong>XL</strong><br />

<strong>Fortran</strong> Compiler Options” on page 67 to see if <strong>XL</strong> <strong>Fortran</strong> already provides a<br />

solution.<br />

3. To learn more about writing <strong>Fortran</strong> programs, refer to the <strong>XL</strong> <strong>Fortran</strong> <strong>Enterprise</strong><br />

<strong>Edition</strong> <strong>for</strong> <strong>AIX</strong> Language Reference.<br />

Note that you can substitute references to libxlf90_r.a in this section with<br />

references to libxlf90.a. This is because a link is provided from the libxlf90.a<br />

library to the libxlf90_r.a library. You do not need to manually link with separate<br />

libraries depending on whether you are creating a threaded or a non-threaded<br />

application. <strong>XL</strong> <strong>Fortran</strong> determines at run time whether your application is<br />

threaded.<br />

Editing <strong>XL</strong> <strong>Fortran</strong> Source Files<br />

To create <strong>Fortran</strong> source programs, you can use any of the available text editors,<br />

such as vi or emacs. Source programs must have a suffix of .f unless the fsuffix<br />

attribute in the configuration file specifies a different suffix or the -qsuffix<br />

compiler option is used. You can also use a suffix of .F if the program contains C<br />

preprocessor (cpp) directives that must be processed be<strong>for</strong>e compilation begins.<br />

For the <strong>Fortran</strong> source program to be a valid program, it must con<strong>for</strong>m to the<br />

language definition that is specified in the <strong>XL</strong> <strong>Fortran</strong> <strong>Enterprise</strong> <strong>Edition</strong> <strong>for</strong> <strong>AIX</strong><br />

Language Reference.<br />

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

To compile a source program, use one of the xlf90, xlf90_r, xlf90_r7, xlf95, xlf95_r,<br />

xlf95_r7, xlf, xlf_r, xlf_r7, f77, <strong>for</strong>t77, f90, or f95 commands, which have the <strong>for</strong>m:<br />

© Copyright <strong>IBM</strong> Corp. 1990, 2004 29

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

Saved successfully!

Ooh no, something went wrong!