Previous | Contents | Index |
Compaq Fortran provides certain include library modules in the text library FORSYSDEF.TLB. Users can create a text library and populate it with include library modules (see Section 2.4). Within a library, text library modules are identified by a library module name (no file type).
To include a text library module, the INCLUDE statement specifies the name of the library module within parentheses, as follows:
INCLUDE '(name)' |
You can specify the library name before the library module name in the INCLUDE statement. For example:
INCLUDE 'MYLIB(PROJINC)' |
Use one of the following methods to access a source library module in a text library:
When the library is named in the INCLUDE statement, the FORTRAN command searches various directories for the named library, similar to the search for an include file.
Compaq Fortran allows you to use multiple methods to specify which directories are searched for named text libraries:
The Compaq Fortran compiler searches directories in the following order:
You can specify /LIST or /NOLIST after the library module name. For example:
INCLUDE 'PROJLIB(MYINC)/LIST' |
You can also specify the /SHOW=INCLUDE or /SHOW=NOINCLUDE qualifier to control whether source lines from included files or library modules appear in the listing file (see Section 2.3.40).
For More Information:
When the INCLUDE statement does not specify the library, you can specify additional text libraries to be searched on the FORTRAN command line or by defining a logical name. The order in which the compiler searches for a library file follows:
$ FORTRAN APPLIC+DATAB/LIBRARY |
$ FORTRAN APPLIC+DATAB/LIBRARY+NAMES/LIBRARY+GLOBALSYMS/LIBRARY |
$ FORTRAN METRIC+DATAB/LIBRARY, APPLIC+DATAB/LIBRARY |
$ FORTRAN PROJ_MAIN+$DISK2:[PROJ.LIBS]COMMON_LIB/LIBRARY |
$ DEFINE FORT$LIBRARY $DISK2:[LIB]DATAB $ FORTRAN PROJ_MAIN |
$ DEFINE /GROUP FORT$LIBRARY $DISK2:[PROJ.LIBS]APPLIB.TLB $ FORTRAN PROJ_MAIN |
You can specify /LIST or /NOLIST after the library module name. For example:
INCLUDE '(MYINC)/NOLIST' |
You can also specify the /SHOW=INCLUDE or /SHOW=NOINCLUDE qualifier to control whether source lines from included files or library modules appear in the listing file (see Section 2.3.40).
For More Information:
The output produced by the compiler includes the object and listing files. You can control the production of these files by using the appropriate qualifiers on the FORTRAN command line.
The production of listing files depends on whether you are operating in interactive mode or batch mode:
For command procedures that compile the application in either batch or interactive mode, consider explicitly specifying /NOLIST (or /LIST).
The compiler generates an object file by default. During the early stages of program development, you may find it helpful to use the /SYNTAX_ONLY or /NOOBJECT qualifiers to prevent the creation of object files until your source program compiles without errors. If you omit /NOOBJECT, the compiler generates object files as follows:
You can use both commas and plus signs in the same command line to produce different combinations of concatenated and separate object files (see the examples of the FORTRAN command at the end of this section).
To name an object file, use the /OBJECT qualifier in the form /OBJECT=file-spec. Otherwise, the object file has the file name of its corresponding source file and a file type of OBJ. By default, the object file produced from concatenated source files has the name of the first source file. All other file specification fields (node, device, directory, and version) assume the default values.
When creating object files that will be placed in an object library, consider using the /SEPARATE_COMPILATION qualifier, which places individual compilation units in a source file as separate components in the object file. This minimizes the size of the routines included by the linker as it creates the executable image. However, to allow more interprocedure optimizations, use the default /NOSEPARATE_COMPILATION.
For More Information:
The following examples show the use of the FORTRAN command.
2.2.6.1 Naming the Object File
The following FORTRAN command compiles the Compaq Fortran free-form source file (CIRCLE.F90) into an object file:
$ FORTRAN /OBJECT=[BUILD]SQUARE /NOLIST [Return] _File: CIRCLE |
The source file CIRCLE.F90 is compiled, producing an object file named
SQUARE.OBJ in the [BUILD] directory, but no listing file.
2.2.6.2 Compiler Source Checking Only (No Object File)
The following FORTRAN command examines Compaq Fortran fixed-form source file (ABC.FOR) without creating an object file:
$ FORTRAN /NOOBJECT ABC.FOR |
The source file ABC.FOR is compiled, syntax checking occurs, but no
object file is produced. The /NOOBJECT qualifier performs full
compilation checking without creating an object file.
2.2.6.3 Requesting a Listing File and Contents
The following FORTRAN command compiles Compaq Fortran free-form source file (XYZ.F90) and requests a listing file:
$ FORTRAN /LIST /SHOW=INCLUDE /MACHINE_CODE XYZ.F90 |
The source file XYZ.F90 is compiled, and the listing file XYZ.LIS and object file XYZ.OBJ are created. The listing file contains the optional included source files (/SHOW=INCLUDE) and machine code representation (/MACHINE_CODE).
The default is /NOLIST for interactive use and /LIST for batch use, so
consider explicitly specifying either /LIST or /NOLIST.
2.2.6.4 Compiling Multiple Files
The following FORTRAN command compiles the Compaq Fortran free-form source files (AAA.F90, BBB.F90, and CCC.F90) into separate object files:
$ FORTRAN/LIST AAA.F90, BBB.F90, CCC.F90 |
Source files AAA.F90, BBB.F90, and CCC.F90 are compiled as separate files, producing:
The default level of optimization is used (/OPTIMIZE=LEVEL=4), but interprocedure optimizations are less effective because the source files are compiled separately.
The following FORTRAN command compiles the Compaq Fortran fixed-form source files XXX.FOR, YYY.FOR, and ZZZ.FOR into a single object file named XXX.OBJ:
$ FORTRAN XXX.FOR+YYY.FOR+ZZZ.FOR |
Source files XXX.FOR, YYY.FOR, and ZZZ.FOR are concatenated and compiled as one file, producing an object file named XXX.OBJ. The default level of optimization is used, allowing interprocedure optimizations since the files are compiled together (see Section 5.1.2). In interactive mode, no listing file is created; in batch mode, a listing file named XXX.LIS would be created.
The following FORTRAN command compiles the Compaq Fortran free-form source files AAA.F90, BBB.F90, and CCC.F90 into two object files:
$ FORTRAN AAA+BBB,CCC/LIST |
Two object files are produced: AAA.OBJ (comprising AAA.F90 and BBB.F90) and CCC.OBJ (comprising CCC.F90). One listing file is produced: CCC.LIS (comprising CCC.F90), since the positional /LIST qualifier follows a specific file name (and not the FORTRAN command). Because the default level of optimization is used, interprocedure optimizations for both AAA.F90 and BBB.F90 occur. Only interprocedure optimizations within CCC.F90 occur.
The following FORTRAN command compiles the Compaq Fortran free-form source files ABC.F90, CIRC.F90, and XYZ.F90, but no object file is produced:
$ FORTRAN ABC+CIRC/NOOBJECT+XYZ |
The /NOOBJECT qualifier applies to all files in the
concatenated file list and suppresses object file creation. Source
files ABC.F90, CIRC.F90, and XYZ.F90 are concatenated and compiled, but
no object file is produced.
2.2.6.5 Requesting Additional Compile-Time and Run-Time Checking
The following FORTRAN command compiles the Compaq Fortran free-form source file TEST.F90, requesting all possible compile-time diagnostic messages (/WARN=ALL) and run-time checking (/CHECK=ALL):
$ FORTRAN /WARNINGS=ALL /CHECK=ALL TEST.F90 |
This command creates the object file TEST.OBJ and can result in more
informational or warning compilation messages than the default level of
warning messages. Additional run-time messages can also occur.
2.2.6.6 Checking Fortran 90 or 95 Standard Conformance
The following FORTRAN command compiles the Compaq Fortran free-form source file PROJ_STAND.F90, requesting compile-time diagnostic messages when extensions to the Fortran 90 language are detected without creating an object file:
$ FORTRAN /STANDARD=F90 /NOOBJECT PROJ_STAND.F90 |
This command does not create an object file but issues additional compilation messages about the use of any nonstandard extensions to the Fortran 90 standard it detects.
To check for Fortran 95 standard conformance, specify /STANDARD=F95
instead of /STANDARD=F90.
2.2.6.7 Requesting Additional Optimizations
The following FORTRAN command compiles the Compaq Fortran free-form source files (M_APP.F90 and SUB.F90) as a single concatenated file into one object file:
$ FORTRAN /OPTIMIZE=(LEVEL=5,UNROLL=3) M_APP.F90+SUB.F90/NOLIST |
The source files are compiled together, producing an object file named M_APP.OBJ. The software pipelining optimization (/OPTIMIZE=LEVEL=5) is requested. Loops within the program are unrolled three times (UNROLL=3). Loop unrolling occurs at optimization level three (LEVEL=3) or above.
For More Information:
FORTRAN command qualifiers influence the way in which the compiler processes a file. In some cases, the simplest form of the FORTRAN command is sufficient. Use optional qualifiers when needed.
You can override some qualifiers specified on the command line by using
the OPTIONS statement.
The qualifiers specified by the OPTIONS statement affect only the
program unit where the statement occurs. For more information about the
OPTIONS statement, see the Compaq Fortran Language Reference Manual.
2.3.1 FORTRAN Command Qualifier Syntax
Normal DCL parsing rules apply to the FORTRAN command, allowing you to abbreviate qualifier names and keywords as long as they are unique. For example, the following use of the FORTRAN command to specify the /ALIGNMENT qualifier as NATURAL and the /LIST qualifier is valid:
$ FORTRAN /ALIG=NAT /LIS EXTRAPOLATE.FOR |
When creating command procedures, avoid using abbreviations for qualifiers and their keywords. Compaq Fortran might add new qualifiers and keywords for a subsequent release that makes an abbreviated qualifier and keyword nonunique in a subsequent release.
If you specify multiple keywords for a qualifier, enclose the keywords in parentheses:
$ FORTRAN /WARN=(ALIGN, DECLARATION) EXTRAPOLATE.FOR |
To concatenate source files, separate file names with a plus sign (+)
instead of a comma (,) (see Section 2.2.2).
2.3.2 Summary of FORTRAN Command Qualifiers
Table 2-1 lists the FORTRAN Command qualifiers, including their default values.
Section 2.3.3 through Section 2.3.48 describe each qualifier in detail.
Qualifier | Default |
---|---|
/ALIGNMENT or /NOALIGNMENT or
/ALIGNMENT=
|
/ALIGNMENT=(COMMONS=(PACKED 1, NOMULTILANGUAGE), RECORDS=NATURAL) |
/ANALYSIS_DATA[=filename] or /NOANALYSIS_DATA | /NOANALYSIS_DATA |
/ARCHITECTURE=
|
/ARCHITECTURE=GENERIC |
/NOASSUME or
/ASSUME=
|
/ASSUME=(ACCURACY_SENSITIVE 1, ALTPARAM, NOBUFFERED_IO, NOBYTERECL, NODUMMY_ALIASES, NOFP_CONSTANT, NOINT_CONSTANT, NOMINUS0, NOSOURCE_INCLUDE) |
/AUTOMATIC or /NOAUTOMATIC | /NOAUTOMATIC |
/BY_REF_CALL=( routine-list) | No default |
/NOCHECK or
/CHECK=
|
/CHECK=(NOBOUNDS, FORMAT 3, NOFP_EXCEPTIONS, OUTPUT_CONVERSION 3, NOOVERFLOW, POWER, NOUNDERFLOW) |
/CONVERT=
|
/CONVERT=NATIVE |
/D_LINES or /NOD_LINES | /NOD_LINES |
/DEBUG or /NODEBUG or
/DEBUG=
|
/DEBUG=(NOSYMBOLS, TRACEBACK) |
/DIAGNOSTICS[=filename] or /NODIAGNOSTICS | /NODIAGNOSTICS |
/DOUBLE_SIZE=
|
/DOUBLE_SIZE=64 |
/ERROR_LIMIT= n or /NOERROR_LIMIT | /ERROR_LIMIT=30 |
/EXTEND_SOURCE or /NOEXTEND_SOURCE | /NOEXTEND_SOURCE |
/F77 or /NOF77 | /F77 |
/FAST | No default |
/FLOAT=
|
/FLOAT=G_FLOAT 4 |
/GRANULARITY=
|
/GRANULARITY=QUADWORD |
/IEEE_MODE=
|
/IEEE_MODE=FAST |
/INCLUDE= directory [, ...] or /NOINCLUDE | /NOINCLUDE |
/INTEGER_SIZE=
|
/INTEGER_SIZE=32 4 |
/LIBRARY | No default |
/LIST[=file-spec] or /NOLIST |
/NOLIST (interactive)
/LIST (batch) |
/MACHINE_CODE or /NOMACHINE_CODE | /NOMACHINE_CODE |
/MATH_LIBRARY=
|
/MATH_LIBRARY=ACCURATE 1 |
/MODULE=directory or /NOMODULE | /NOMODULE |
/NAMES=
|
/NAMES=UPPERCASE |
/OBJECT[=file-spec] or /NOOBJECT | /OBJECT |
/OLD_F77 | Omitted |
/OPTIMIZE or /NOOPTIMIZE or
/OPTIMIZE=
|
/OPTIMIZE (same as /OPTIMIZE= (LEVEL=4, INLINE=SPEED, NOLOOPS, NOPIPELINE, TUNE=GENERIC, UNROLL=0)) |
/PAD_SOURCE or /NOPAD_SOURCE | /NOPAD_SOURCE |
/REAL_SIZE=
|
/REAL_SIZE=32 |
/RECURSIVE or /NORECURSIVE | /NORECURSIVE |
/NOREENTRANCY or /REENTRANCY=
|
/REENTRANCY=NONE |
/ROUNDING_MODE=
|
/ROUNDING_MODE=NEAREST |
/SEPARATE_COMPILATION or /NOSEPARATE_COMPILATION | /NOSEPARATE_COMPILATION |
/SEVERITY=WARNINGS=
|
/SEVERITY=WARNINGS=(WARNING) |
/SHOW or /NOSHOW or
/SHOW=
|
/SHOW=(NOINCLUDE, MAP ) |
/SOURCE_FORM=
|
Depends on file type (F90 for free form and FOR or F for fixed form) |
/STANDARD=
|
/NOSTANDARD |
/SYNCHRONOUS_EXCEPTIONS or
/NOSYNCHRONOUS_EXCEPTIONS |
/NOSYNCHRONOUS_EXCEPTIONS |
/SYNTAX_ONLY or /NOSYNTAX_ONLY | /NOSYNTAX_ONLY |
/TIE or /NOTIE | /NOTIE |
/VERSION | Omitted |
/VMS or /NOVMS | /VMS |
/WARNINGS or /NOWARNINGS or
/WARNINGS=
|
/WARNINGS=(ALIGNMENT, NOARGUMENT_CHECKING, NODECLARATIONS, GENERAL, GRANULARITY, NOTRUNCATED_SOURCE, UNCALLED, UNINITIALIZED, NOUNUSED, USAGE ) |
Table 2-2 shows the functional groupings of the FORTRAN command qualifiers and the section in which they are described in more detail.
Category | Flag Name and Section in this Manual |
---|---|
Code generation for specific Alpha chip | /ARCHITECTURE (see Section 2.3.5) |
Convert Nonnative Data Files |
/CONVERT (see Section 2.3.10)
/ASSUME=BYTERECL (see Section 2.3.6) Also see Chapter 9. |
Data Size |
/DOUBLE_SIZE (see Section 2.3.14)
/INTEGER_SIZE (see Section 2.3.23) /REAL_SIZE (see Section 2.3.34) Also see Chapter 8. |
Data Storage and Recursion |
/AUTOMATIC (see Section 2.3.7)
/RECURSIVE (see Section 2.3.35) |
Debugging and Symbol Table |
/D_LINES (see Section 2.3.11)
/DEBUG (see Section 2.3.12) Also see Chapter 4. |
Floating-Point Exceptions and Accuracy |
/ASSUME=([NO]ACCURACY_SENSITIVE, [NO]FP_CONSTANT, [NO]MINUS0)
(Section 2.3.6)
/CHECK=([NO]FP_EXCEPTIONS, [NO]POWER, [NO]UNDERFLOW) (see Section 2.3.9) /DOUBLE_SIZE (see Section 2.3.14) /FAST (see Section 2.3.18) /FLOAT (see Section 2.3.19) /IEEE_MODE (see Section 2.3.21) /MATH_LIBRARY (see Section 2.3.27) /REAL_SIZE (see Section 2.3.34) /ROUNDING_MODE (see Section 2.3.37) /SYNCHRONOUS_EXCEPTIONS (see Section 2.3.43) |
Floating-Point Format in Memory | /FLOAT (see Section 2.3.19) |
Language Compatibility |
/F77 (see Section 2.3.17)
/ALIGNMENT=COMMONS=STANDARD (see Section 2.3.3) /ASSUME=( [NO]ALTPARAM, [NO]DUMMY_ALIASES, [NO]INT_CONSTANT) (see Section 2.3.6) /BY_REF_CALL (see Section 2.3.8) /OLD_F77 (see Section 2.3.31) /PAD_SOURCE (see Section 2.3.41) /SEVERITY (see Section 2.3.39) /STANDARD (see Section 2.3.42) /VMS (see Section 2.3.47) |
Language-Sensitive Editor Use | /DIAGNOSTICS (see Section 2.3.13) |
Listing File and Contents |
/LIST (see Section 2.3.25)
/MACHINE_CODE (see Section 2.3.26) /SHOW (see Section 2.3.40) Also see Section 2.6. |
Module File Searching and Placement; Include File Searching |
/INCLUDE (see Section 2.3.22)
/ASSUME=[NO]SOURCE_INCLUDE (see Section 2.3.6) /LIBRARY (see Section 2.3.24) /MODULE (see Section 2.3.28) Also see Section 2.2.3 (modules), Section 2.2.4 (include files), and Section 2.4 (text libraries). |
Multithreaded Applications | /REENTRANCY (see Section 2.3.36) |
Object File Creation, Contents, Naming, and External Names |
/OBJECT (see Section 2.3.30)
/NAMES (see Section 2.3.29) /SEPARATE_COMPILATION (see Section 2.3.38) /SYNTAX_ONLY (see Section 2.3.44) /TIE (see Section 2.3.46) |
Performance Optimizations and Alignment |
/ALIGNMENT (see Section 2.3.3)
/ASSUME=(NOACCURACY_SENSITIVE, NODUMMY_ALIASES) (see Section 2.3.6) /ARCHITECTURE (see Section 2.3.5) /FAST (see Section 2.3.18) /MATH_LIBRARY (see Section 2.3.27) /OPTIMIZE (see Section 2.3.32) Also see Chapter 5. |
Recursion and Shared Access to Data |
/GRANULARITY (see Section 2.3.20)
/RECURSIVE (see Section 2.3.35) /REENTRANCY (see Section 2.3.36) /WARNINGS=GRANULARITY (see Section 2.3.48) |
Source Code Analyzer Use | /ANALYSIS_DATA (see Section 2.3.4) |
Source Form and Column Use |
/D_LINES (see Section 2.3.11)
/EXTEND_SOURCE (see Section 2.3.16) /PAD_SOURCE (see Section 2.3.33) /SOURCE_FORM (see Section 2.3.41) /WARNINGS=TRUNCATED_SOURCE (see Section 2.3.48) |
Warning Messages and Run-Time Checking |
/CHECK (see Section 2.3.9)
/IEEE_MODE (see Section 2.3.21) /ERROR_LIMIT (see Section 2.3.15) /SEVERITY (see Section 2.3.39) /WARNINGS (see Section 2.3.48) Also see the qualifiers related to "Floating-Point Exceptions and Accuracy" in this table. |
Previous | Next | Contents | Index |