Compaq Fortran
User Manual for
Tru64 UNIX and Linux Alpha Systems


Previous Contents Index

3.88 -Wl,-xxx --- Pass Specified Option to ld

(TU*X ONLY) The -Wl,-xxx option allows you to pass an option directly to the ld linker, where -xxx is the option to be passed to ld .

For example, to set the linker -taso option (TU*X ONLY) to help port 32-bit programs that assume addresses can be stored into 32-bit variables, specify:


-W1,-taso

If the ld option -xxx takes an argument yyy, include yyy after the option separated by a comma. For example:


-W1,-xxx,yyy

results in the passing of


-xxx yyy

to ld . (-W1 is also passed to ld .)

For More Information:

On linker options, see ld(1).

3.89 -warn keyword, -u, -nowarn, -w, -w1 --- Warning Messages and Compiler Checking

You can prevent the display of some or all warning messages and request that additional compile-time checking be performed (can issue additional warning messages):

If you specify -syntax_only , some warning options are ignored (see Section 3.77).

The following options apply:

-warn noalignments

Specifying -warn noalignments suppresses warning messages for data that is not naturally aligned during compilation. To control alignment of common blocks, derived-type structures, and record structures, specify the -align keyword options.

-warn argument_checking

Specifying -warn argument_checking requests that the compiler issue a warning message about argument mismatches between the calling procedure and the called procedure when both program units are compiled together. Specifying -warn argument_checking applies to calls with an implicit interface (such as routines declared as EXTERNAL). The default is -warn noargument_checking .

When an explicit interface is present between calling and called procedures, warning messages about argument mismatches are reported whether or not you specify -warn argument_checking .

-warn declarations or -u

Specifying -warn declarations or -u requests that the compiler issue a warning message for any undeclared symbols. This makes the default type of a variable undefined (IMPLICIT NONE) rather than using the default Fortran rules. The default is -warn nodeclarations .

-warn nogranularity

Specifying -warn nogranularity suppresses the NONGRNACC warning message, Unable to generate code for requested granularity . The default is -warn granularity .

-warn hpf

(TU*X ONLY) Specifying -warn hpf tells the compiler to do both syntactic and semantics checking on HPF directives. The default value is -warn nohpf which tells the compiler to do no syntactic or semantics checking on HPF directives. However, if the command line includes -wsf , then the compiler assumes that -warn hpf is in effect.

-warn truncated_source

Specifying -warn truncated_source requests that the compiler issue a warning diagnostic message. The compiler issues the warning when it reads a source line with a statement field that exceeds the maximum column width in fixed-format source files. The maximum column width for fixed-format files is column 72 or 132, depending whether the -extend_source option was specified.

This option has no effect on truncation; lines that exceed the maximum column width are always truncated.

This option does not apply to free-format source files. The default is -warn notruncated_source .

-warn nouninitialized

Specifying -warn nouninitialized suppresses warning messages for a variable used before a value could be assigned to it. The default is -warn uninitialized .

-nowarn, -w, or -warn nogeneral

Specifying -nowarn , -w , or -warn nogeneral suppresses all warning messages.

-warn nouncalled

Specifying -warn nouncalled suppresses warning messages when a statement function is never called.

The default is -warn uncalled .

-warn unused

Specifying -warn unused requests warning messages for a variable that is declared but never used.

The default is -warn nounused .

-warn nousage

Specifying -warn nousage suppresses warning messages about questionable programming practices, and the use of intrinsic functions that use only two digits to represent the year 2000. The compiler allows such practices, although they are often an artifact of programming errors.

For example, consider a continued character constant or a Hollerith literal whose first part ends before the statement field ends and that appears to end with trailing spaces. Such situations are detected and reported by the compiler when you do not disable the warning.

The default is -warn usage .

3.90 -warning_severity keyword --- Elevate Severity of Warning Messages

Use this option to elevate warning-level messages to error-level status.

-warning_severity error

Makes all compiler warning messages error-level instead of warning-level messages.

-warning_severity stderror

Makes standards checking compiler warning messages ( -std option) error-level instead of warning-level messages. The default is -warning_severity warning . It leaves all compiler warning messages at warning-level status.

3.91 -what --- Print Version Strings

The -what option prints the version string of the Fortran command and compiler. If only this option appears on the Fortran command line, the program will not compile.

3.92 -wsf, -wsf num, and Related Options --- Compile HPF Programs for Parallel Execution

These options apply only to TU*X systems.

Specifying the -wsf option indicates that the executable HPF program will be compiled to execute in parallel on multiple processors. Parallel execution of HPF programs requires MPI (see

If you omit the -wsf option, the executable program will execute in a nonparallel (serial) run-time environment (HPF directives are only checked for correct syntax).

To specify the number of processors on which the program is intended to run, specify the optional num field, such as -wsf 3 . If you omit num and specify -wsf , the compiler generates code that can run on any number of processors. However, better performance occurs if num is used.

When the HPF parallel programs are compiled with the -c option and linked separately, specify -wsf both when compiling and linking the program.

If you specify -wsf or -wsf num , you can specify additional parallel execution options using the -assume nozsize , -nearest_neighbor or -nearest_neighbor num options, -pprof option, -show wsfinfo option, and High Performance Fortran ( !HPF$ ) directives.

For information about using the -wsf (or -wsf num ) option and on parallel HPF programs, see the Compaq Parallel Software Environment documentation.

For information about any limitations when you use the -wsf or -wsf num option, see the online Compaq Fortran release notes.

3.92.1 -assume bigarrays --- Run-time Checking for Distributed Small Array Dimensions

Specifying the -assume bigarrays option (TU*X ONLY) suppresses run-time checking for distributed small array dimensions. This allows for increased run-time performance and reduced compile time when using the -wsf option.

In programs compiled with both the -wsf and -assume bigarrays options, nearest-neighbor computations that reference small arrays will fail. An array is big enough if, for every dimension with BLOCK distribution, the shadow edge width is no bigger than the block size. The default is -assume nobigarrays .

3.92.2 -assume nozsize --- Omit Zero-Sized Array Checking

Specify the -assume nozsize option (TU*X ONLY) with the -wsf option to let the compiler know there are no zero-sized arrays or array sections.

An array (or array section) is zero sized when the extent of any of its dimensions takes the value zero or less than zero. When the -wsf option is specified, the compiler ordinarily inserts a series of checks to guard against irregularities (such as division by zero) in its internal computations that zero-sized arrays can cause. Depending upon the particular application, these checks can cause noticeable (or even major) degradation of performance.

The -assume nozsize option causes the compiler to omit these checks for zero-sized arrays and array sections. Specifying the -fast option sets the -assume nozsize option.

Avoid using the -assume nozsize option with -wsf when a program references any zero-sized arrays or array sections. If you compile a program containing zero-sized arrays or array sections with the -assume nozsize option, the resulting executable may fail to execute, or produce incorrect program results.

You can insert a run-time check into your program to ensure that a given line is not executed if an array or array section referenced there is zero sized (see the Compaq Parallel Software Environment documentation).

3.92.3 -nearest_neighbor, -nearest_neighbor num, or -nonearest_neighbor --- Nearest Neighbor Optimization

Use the -nearest_neighbor option (TU*X ONLY) with the -wsf option control nearest neighbor optimizations. The compiler automatically determines the correct shadow-edge widths on an array-by-array, dimension-by-dimension basis.

When programs are compiled with the -wsf option, the -nearest_neighbor option is active by default.

Use the optional num field to specify a maximum shadow-edge width, which limits how much extra storage the compiler can allocate for nearest-neighbor arrays.

When num is specified, the compiler will only recognize nearest neighbor constructs that need shadow-edge widths less than or equal to the value of num. Constructs needing shadow-edge widths greater than the value of num will not be recognized as nearest-neighbor.

If num is not specified, the compiler uses a num value of ten (10).

You can also set shadow-edge widths manually, using the !HPF$ SHADOW directive (see the Compaq Parallel Software Environment documentation).

The -nonearest_neighbor option turns off the nearest-neighbor optimization. It is equivalent to specifying -nearest_neighbor with nn set to 0.

For more information on the -nearest_neighbor option, see the Compaq Parallel Software Environment documentation.

3.92.4 -pprof method --- Prepare for Parallel Profiling

Use the -pprof option (TU*X ONLY) to prepare a parallel HPF program for subsequent profiling with the pprof profiler. To use the -pprof option, you must:

For more information on -pprof and related options, see the Compaq Parallel Software Environment documentation.

3.92.5 -show hpf --- Show HPF Parallelization Information

The -show hpf options (TU*X ONLY) show information about HPF parallelization by displaying the information to standard error and to the listing (if one is generated using the -V option). These options are valid only if the -wsf option is specified.

Specifying -show hpf selects a subset of the messages generated by all of the following -show hpf_ options. Try using -show hpf first, with the following variations only when a more detailed listing is needed.

-show hpf_all

This is the same as specifying all the other -show hpf_ options. The obsolete -show wsfinfo option is equivalent to -show hpf_all .

-show hpf_comm

This instructs the compiler to display information about statements that cause interprocessor communication to be generated.

-show hpf_indep

This instructs the compiler to display information about the optimization of loops marked with the INDEPENDENT directive.

-show hpf_nearest

This instructs the compiler to display information about arrays and statements involved in optimized nearest-neighbor computations.

-show hpf_punt

This instructs the compiler to display information about distribution directives that were ignored and statements that were not handled in parallel.

-show hpf_temps

This instructs the compiler to display information about temporaries that were created at procedure interfaces.

The -show option can take only one argument at a time. To mix -show options, use multiple specification. For example:


% f90 -wsf -show hpf_near -show hpf_comm -show hpf_punt foo.f90

For more information on the -show hpf option, see the Compaq Parallel Software Environment documentation.

For More Information:


Chapter 4
Using the Ladebug Debugger

This chapter describes the following topics related to the Compaq Tru64 UNIX Ladebug Debugger:

The Ladebug debugger supports Compaq Fortran data types, syntax, and use. Ladebug is a source-level, symbolic debugger that lets you:

4.1 About the Ladebug and dbx Debuggers

The Compaq Tru64 UNIX operating system provides the Ladebug and the dbx debuggers, both of which can be used to debug Compaq Fortran programs.

The Linux operating system, which provides the Ladebug debugger for debugging Compaq Fortran programs, does not provide the dbx debugger.

The command names and command syntax used by Ladebug and dbx are almost identical. However, Ladebug provides significantly more Compaq Fortran language support than dbx, especially Fortran 95/90 features not found in the FORTRAN-77 standard. For this reason, this chapter primarily describes the Ladebug debugger.

If you will be using the Parallel Software Environment (TU*X ONLY), before you create a parallel HPF program (specify the -wsf option), you should fully debug the program in scalar (non-parallel) form (omit -wsf ).

For information:

4.2 Compaq Fortran Options for Debugging

The -gn options control the amount of information placed in the object file for debugging. To use Ladebug, you should specify the -ladebug option along with the -g , -g2 , or -g3 options.

Table 4-1 summarizes the information provided by the -g n options and their relationship to the -On options.

Table 4-1 Summary of Symbol Table Command Options
Option Traceback
Information
Debugging Symbol
Table Information
Effect on -On Options
-g0 No No Default is -O4 .
-g1 (default) Yes No Default is -O4 .
-g or -g2 1 Yes Yes, but for unoptimized code. Changes default to -O0 .
-g3 Yes Yes, but for unoptimized code. Default is -O4 .
-ladebug Yes Allows access to Fortran 95/90 dynamic arrays using standard Fortran 95/90 syntax, including array sections. No effect.


1The -g and -g2 options are equivalent.

Traceback information and symbol table information are both necessary for debugging. As shown in Table 4-1, if you specify -g , -g2 , or -g3 , the compiler provides the symbol table and traceback information needed for symbolic debugging. Unless you specify -g0 , the compiler supplies traceback information in the object file.

To use the Ladebug debugger, you should specify the f90 (on Tru64 UNIX systems) or the fort (on Linux systems) command and the command option -ladebug along with -g , -g2 , or -g3 .

Likely uses of these options at the various stages of program development are as follows:

Traceback and symbol table information result in a larger object file. When you have finished debugging your program, you can recompile and relink to create an optimized executable program or remove traceback and symbol table information with the strip command (see strip(1)).

If your program generates an exception, see Section 4.9.

4.3 Running the Debugger

The Ladebug debugger provides the following user interfaces in the Compaq Tru64 UNIX operating system Programmer's Development Toolkit:

The examples in this chapter show the character-cell interface to the Ladebug debugger.

4.3.1 Creating the Executable Program and Running the Debugger

Use the f90 command with certain options to create an executable program for debugging. To invoke the debugger, type the debugger shell command and the name of the executable program.

4.3.1.1 Using Ladebug

The following commands create (compile and link) the executable program and invoke the character-cell interface to the Ladebug debugger:


% f90 -g -ladebug -o squares squares.f90
% ladebug squares
Welcome to the Ladebug Debugger Version x.x-xx
--------------- 
object file name: squares 
reading symbolic information ... done 
(ladebug) 

In this example, the f90 command:

4.3.1.2 Using dbx

The following commands create the executable program and invoke the dbx debugger(TU*X ONLY):


% f90 -g -o squares squares.f90
% dbx squares
dbx version x.x.x 
Type 'help' for help. 
squares:   1  PROGRAM SQUARES 
(dbx) 

In this example, the f90 command:

The dbx shell command runs the debugger, specifying the executable program squares . The dbx command accepts various options (see dbx(1)).

At the debugger prompt ( (dbx) ), you can enter a debugger command.

The command names and command syntax used by Ladebug and dbx are almost identical.


Previous Next Contents Index