Lahey/Fujitsu Fortran

Recommended Option Settings

If an LF95.FIG file exists in the current directory, examine its contents to insure that it contains the desired options.

Debugging and diagnostics

For debugging, the following option settings will provide an increased level of diagnostic ability, both at compile time, and during execution:

-chk -g -stchk -trace -w -info

The -pca option may be additionally be used to check for corruption of constant arguments; if the results are correct with -pca but bad with -npca a constant argument has been corrupted.

For further analysis during development, consider specifying any of the following options:

-ap -chkglobal -co -cover -f95 -lst -wo -xref

(Note: Specifying -chkglobal or -chk (x) must be used for compilation of all files of the program, or incorrect results may occur.)

Optimizations

For production code, we recommend the following option settings:

-nap -nchk -nchkglobal -ncover -ndal -ng -o1 -npca -nsav -nstchk -ntrace

Use -tp, -tpp, or -tp4 depending on your preferred target processor.

Note

If the program performs many I/O operations, consider tuning the blocksize with the -block option.

Programs may be tuned with the -o2, -unroll, and -inline options to increase optimization and to inline code and data.

If the target processor is a Pentium III or Athlon, consider experimenting with the -nprefetch, -prefetch 1 or -prefetch 2 options to select the one which provides the best performance.

If the target processor is a Pentium 4, consider tuning with the -sse2 and -zfm options.

If optimization produces radically different results or causes runtime errors, try compiling with -info to see exactly which steps are being taken to optimize. The -info option also generates warnings on sections of code that are unstable and therefore may cause problems when optimized. A common example of such code is an IF statement that compares floating-point variables for equality. When optimization seems to alter the results, try using the -ap option to preserve arithmetic precision while still retaining some optimization.