Previous | Contents | Index |
Compaq Fortran recognizes certain environment variables at compile-time
and run-time.
B.1 Commands for Setting and Unsetting Environment Variables
The commands used to set and unset environment variables vary with the shell in use.
To view the previously set environment variables, use the
printenv
command (see printenv(1)).
B.1.1 Bourne Shell (sh) and Bourne Again Shell (bash) and Korn Shell (ksh) Commands
With the Bourne shell (sh), Bourne Again Shell (bash) (L*X ONLY), and Korn shell (ksh), use an export and an assignment statement to set an environment variable:
$ export environment-variable-name $ environment-variable-name=value |
For example, to associate the environment variable TMPDIR with the directory /usr/users/smith/ , type:
$ export TMPDIR $ TMPDIR=/usr/users/smith/ |
To remove the association of an environment variable and its value with the Bourne or Korn shell or bash shell (L*X ONLY), use the unset command:
$ unset environment-variable-name |
With the C shell (csh), use the setenv command to set an environment variable value:
% setenv environment-variable-name value |
For example, to associate the environment variable FORT8 with the file located at /usr/users/smith/test.dat , type:
% setenv FORT8 /usr/users/smith/test.dat |
To remove the association of an environment variable and its value with the C shell, use the unsetenv command:
% unsetenv environment-variable-name |
Table B-1 describes environment variables that Compaq Fortran recognizes at compile-time.
Environment Variable | Description |
---|---|
TMPDIR |
Specifies an alternate working directory where temporary files are
created during preprocessing or compilation.
To specify an alternate working directory for temporary files, set the TMPDIR environment variable to the desired directory name. If TMPDIR is not set, temporary files created during preprocessing or compilation reside in the /tmp directory. For large applications, you might set this variable to balance disk I/O during compilation. For performance reasons, use a local disk (rather than using a NFS mounted disk) to contain the temporary files. |
DECF90 | The location of the f90 compiler to invoke. |
DECF90_CC | The location of the cc command. |
DECF90_INIT |
Initial options for the f90 (or f95 ) command. If
this variable is defined, its value must have the form:
[[
pre] [:: [
post]]
The items enclosed in square brackets ([]) are optional and can be empty. The pre and post variables are strings to be added to the command line:
|
DECFORT_FPP | The name of the preprocessor for FORTRAN 77 files. |
Table B-2 describes the environment variables Compaq Fortran recognizes at run-time. Environment variables used with OpenMP Fortran API (multi-threaded parallel processing) are described in Table 6-4.
Environment Variable | Description |
---|---|
decfort_dump_flag |
Requests that a core dump (
core
file) be created when any severe Compaq Fortran run-time error occurs.
Most severe Compaq Fortran run-time errors do not result in a core
dump, unless accompanied by certain operating system messages.
To request that a core file be created for all severe Compaq Fortran run-time errors, set the environment variable decfort_dump_flag to the character Y or y and then run the erroneous program for which you need a core file created. For more information, see Section 8.1.4. |
FORTn | Allows the user to specify the directory and file name at run-time for a logical unit ( n) for which the OPEN statement does not specify a file name. If the appropriate environment variable is not set and the OPEN statement does not specify a file name for that logical unit, a default file name of fort. n is used. For more information, see Section 7.5.1.7. |
FOR_READ | For programs compiled with the f90 command -vms option, specifies the name of a file to receive input from a READ statement instead of stdin . For more information, see Section 7.5.1.7. |
FOR_ACCEPT | For programs compiled with the f90 command -vms option, specifies the name of a file to receive input from an ACCEPT statement instead of stdin . For more information, see Section 7.5.1.7. |
FOR_PRINT | For programs compiled with the f90 command -vms option, specifies the name of a file to receive output from a PRINT statement instead of stdout . For more information, see Section 7.5.1.7. |
FOR_TYPE | For programs compiled with the f90 command -vms option, specifies the name of a file to receive output from a TYPE statement instead of stdout . For more information, see Section 7.5.1.7. |
FORT_CONVERTn | For an unformatted file, specifies the nonnative numeric format of the data at run-time for a logical unit ( n). Otherwise, the nonnative numeric format of the unformatted data must be specified at compile-time by using the f90 command -convert type option. For more information, see Section 10.4.1. |
FORT_CONVERT.ext | For an unformatted file, specifies the nonnative numeric format of the data at run-time for a file whose suffix is ext. Otherwise, the nonnative numeric format of the unformatted data must be specified at compile-time by using the f90 command -convert type option. For more information, see Section 10.4.2. |
MP_* (TU*X ONLY) | Compaq Fortran Environment Variables, used with directed parallel processing. For more information, see Table 6-5. |
NLSPATH | If the run-time message catalog file cannot be located, the Compaq Fortran run-time system attempts to open the message catalog file at the location indicated by the NLSPATH environment variable. For more information, see Section 8.1.2. |
OMP_* (TU*X ONLY) | OpenMP Fortran API environment variables, used with directed parallel processing. For more information, see Table 6-4. |
TMPDIR |
Specifies an alternate working directory where scratch
files are created. To specify an alternate working directory for
scratch files, set the TMPDIR environment variable to the desired
directory name. For performance reasons, use a local disk (rather than
using a NFS mounted disk) to contain the scratch files.
If TMPDIR is not set, scratch files are created in the directory specified in the OPEN statement DEFAULTFILE (if specified). |
In addition to the environment variables recognized by Compaq Fortran, the Compaq Tru64 UNIX operating system recognizes other environment variables. For example, you can use the PROFDIR environment variable to request a different profile data file name (than mon.out ) during pixie command execution on a Compaq Tru64 UNIX system and you can set the LD_LIBRARY_PATH environment variable to install a private shared library.
To request a listing file, use the -V option. You can then print the listing (or source) files using the lpr command. For example:
% f90 -V peak.f90 % lpr peak.l |
An output listing produced by the Compaq Fortran compiler consists of the following sections:
The source-code section of a compiler output listing displays the source program as it appears in the input file, with the addition of sequential line numbers generated by the compiler. Example C-1 shows a sample of a source-code section of a compiler output listing.
Example C-1 Sample Source Code Listing |
---|
RELAX2 Source Listing 29-Nov-1999 11:01:55 Compaq Fortran V5.x-xxx Page 1 29-Nov-1999 11:01:31 listing.f90 1 SUBROUTINE RELAX2(EPS) 2 INTEGER, PARAMETER :: M=40 3 INTEGER, PARAMETER :: N=60 4 COMMON X (M,N) 5 LOGICAL DONE 6 1 DONE = .TRUE. 7 DO J=1,N-1 8 DO I=1,M-1 9 XNEW = (X(I-1,J)+X(I+1,J)+X(I,J-1)+X(I,J+1))/4 10 IF (ABS(XNEW-X(I,J)) > EPS) DONE = .FALSE. 11 X(I,J) = XNEW 12 END DO 13 END DO 14 IF (.NOT. DONE) GO TO 1 15 RETURN 16 END SUBROUTINE |
The first heading line contains "Source Listing", the date and time the listing file was created, and the version of Compaq Fortran.
The second line contains the creation date of the source file and its file name.
Compiler-generated line numbers appear in the left margin.
Compile-time error messages that contain line numbers refer to these
compiler-generated line numbers. See Section 2.3 for a explanation
of error messages.
C.2 Machine-Code Section
The machine-code section of a compiler output listing provides a symbolic representation of the compiler-generated object code. The representation of the generated code and data is similar to that of assembler language.
The machine-code section is optional. To create a listing file with a machine-code section, specify both the -V and -show code options.
The machine code listing resembles Alpha machine language code and is for reference purposes only. Such code is not intended to be assembled and run. |
Example C-2 shows a sample of a machine-code section of a compiler output listing for an Alpha system.
Example C-2 Sample Machine-Code Listing |
---|
RELAX2 Machine Code Listing 29-Nov-1999 11:22:31 Compaq Fortran V5.x-xxx Page 2 15-Feb-1996 15:01:31 listing.f90 .text .globl relax2_ .ent relax2_ .eflag 16 0000 relax2_: # 000001 27BB0001 0000 ldah gp, relax2_ # gp, (r27) 2FFE0000 0004 unop 23BD81D0 0008 lda gp, relax2_ # gp, (gp) 2FFE0000 000C unop .frame $sp, 0, $26 .prologue 1 0010 L$1: A79D8010 0010 ldq r28, (gp) # 000009 88100000 0014 lds f0, (r16) # 000010 883C0000 0018 lds f1, (r28) # 000009 A43D8018 001C ldq r1, var$0004 # r1, 8(gp) 0020 .1: # 000006 205FFFFF 0020 mov -1, DONE # -1, r2 47E77403 0024 mov 59, var$0002 # 59, r3 # 000007 47F41404 0028 mov 160, r4 # 000011 2FFE0000 002C uno 0030 lab$0004: # 000007 40240405 0030 addq r1, r4, r5 # 000009 47E4F406 0034 mov 39, var$0003 # 39, r6 # 000008 20A5FF5C 0038 lda r5, -164(r5) # 000009 2FFE0000 003C unop 0040 lab$0008: # 000008 89650000 0040 lds f11, (r5) # 000009 89450008 0044 lds f10, 8(r5) 8985FF64 0048 lds f12, -156(r5) 89A500A4 004C lds f13, 164(r5) . . . Routine Size: 448 bytes, Routine Base: $CODE$ + 0000 .rdata $$1: 00000000 0000 .quad .lit4 00000000 0008 .quad _BLNK__ .rconst $$2: 3E800000 0000 .long 0x3E800000 # .float 0.2500000 .data $$3: .data $$4: 0000 ; Code range descriptor for relax2_ beginaddress : 0000 rpd_offset : ---- flags : Standard .comm _BLNK__ 9600 |
How Generated Code and Data are Represented in Machine-Code Listings
The following notes give a detailed explanation of how generated code and data are represented in machine-code listings.
Like a source listing, the first heading line contains the name of the program, subroutine, or function; the date and time the listing file was created; and the version of Compaq Fortran.
The second heading line contains "Machine Code Listing," the creation date of the source file, and the name of the source file.
The third heading line contains a .section Assembler directive, indicating the attributes of the machine-code program unit. The $CODE$ shown in Example C-2 indicates a code section.
The lines following each data program section provide information such as the contents of storage initialized for FORMAT statements, DATA statements, constants, and subprogram argument call lists.
The lines following $CODE$ show the machine instructions represented in the form of Alpha Assembler mnemonics and syntax. Each line contains compiler-generated object code starting at the left margin, followed by the hexadecimal byte offset (four hexadecimal digits), followed by the actual assembler code.
Assembler Code Represented in Machine-Code Listings
General registers (0 through 31) are represented by r0 through r31 and floating-point registers are similarly represented by fn.
Variables and arrays defined in the source program are shown as they were defined in the program. Offsets from variables and arrays are shown in decimal. Optimization frequently places variables in registers, so variable names may be missing.
Fortran source labels referenced in the source program are shown with a period (.) prefix. For example, if the source program refers to label 300, the label appears in the machine-code listing as .300. Labels that appear in the source program, but are not referenced or are deleted during compiler optimization, are ignored. They do not appear in the machine-code listing unless you specified -O0 .
The compiler may generate labels for its own use. These labels appear as L$n or lab$000n, where the value of n is unique for each such label in a program unit.
Integer constants are shown as signed integer values.
Addresses are represented by the program section name plus the
hexadecimal offset within that program section. Changes from one
program section to another are indicated by lines.
C.3 Compilation Summary Section
The final entries on the compiler listing are the compiler options and compiler statistics.
The options shown include the ones specified on the f90 command line and the ones in effect as defaults during the compilation. The compiler statistics are the machine resources used by the compiler.
Example C-3 shows how compiler options and command-line options and compilation statistics appear on the listing.
Example C-3 Sample Compilation Summary |
---|
COMPILER OPTIONS BEING USED no -align commons no -align dcommons -align records no -align sequence no -align rec1byte no -align rec2byte no -align rec4byte no -align rec8byte -altparam -arch generic -assume accuracy_sensitive no -assume bigarrays no -assume buffered_io no -assume byterecl no -assume dummy_aliases no -assume gfullpath no -assume minus0 no -assume pthreads_lock -assume underscore no -assume 2underscores -assume source_include -assume zsize no -automatic -call_shared no -check bounds no -check format no -check omp_bindings no -check output_conversion no -check overflow -check power no -check underflow -convert native no -D -double_size 64 no -d_lines -error_limit 30 no -extend_source no -f66 no -fast no -fpscomp logicals no -fpscomp general no -fpscomp ioformat no -fpscomp filesfromcmd no -fpconstant -fpe0 -fprm nearest -free -g1 -granularity quadword no -hpf_matmul no -intconstant -integer_size 32 no -ladebug -machine_code -math_library accurate -mixed_str_len_arg no -module -names lowercase -nearest_neighbor no -nowsf_main no -non_shared no -noinclude -numnodes 0 -O4 -inline speed no -transform_loops no -pipeline -speculate none -tune generic -unroll 0 no -pad_source -parallel manual no -pg -real_size 32 no -recursive -reentrancy none -shadow_width 0 no -shared no -show include -show map no -show wsfinfo no -show hpf_all no -show hpf_punt no -show hpf_nearest no -show hpf_comm no -show hpf_temps no -show hpf_indep no -show hpf_dev no -show hpf_default no -std no -synchronous_exceptions no -syntax_only no -vms -warn alignments no -warn argument_checking no -warn declarations -warn general -warn granularity no -warn hpf no -warn truncated_source -warn uncalled -warn uninitialized no -warn unused -warn usage -warning_severity warning no -wsf no -fuse_xref -I path : /usr/lib/cmplrs/hpfrtl/,/usr/include/ -V filename : listing.l -o filename : listing.o COMPILER: Compaq Fortran V5.x-xxx-xxxx |
A summary of compilation statistics appear at the end of the listing file. Note that certain options are not available on Linux Alpha systems, such as the -fuse_xref option, and appear only in a listing on a Compaq Tru64 UNIX (TU*X) system.
Previous | Next | Contents | Index |