# Compaq Fortran
User Manual for
Tru64 UNIX and
Linux Alpha Systems

Previous | Contents | Index

# Appendix B
Compaq Fortran Environment Variables

This appendix contains the following topics:

- Section B.1, Commands for Setting and Unsetting Environment Variables
- Section B.2, Compile-Time Environment Variables
- Section B.3, Run-Time Environment Variables

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 profile data file name different from `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.

# 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/` , enter:

    $ 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

## B.1.2 C Shell (csh) Commands

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` , enter:

    % 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

# B.2 Compile-Time Environment Variables

Table B-1 describes environment variables that Compaq Fortran recognizes at compile time.

For more information, see Section 7.5.7, Using Environment Variables.

Table B-1 Compile-Time Environment Variables
Environment Variable | Description
--- | ---
`DECF90` | Location of the f90 compiler to invoke.
`DECF90_CC` | Location of the cc command.
`DECF90_DIR` | Path for the f90 command to use to find the f90 compiler and `for_main.o` file. `DECF90_DIR` supersedes `DECF90` and is superseded by `DECF90_LIB_DIR` .
`DECF90_FPP` | Contains the full file name of the preprocessor to be run. If `-cpp` is specified on the command line, this preprocessor is run instead of `cpp` . See Section 3.31. If `-fpp` is specified on the command line, this preprocessor is run instead of `fpp` . See Section 3.45.
`DECF90_GMPILIB` (TU*X ONLY) | Variable for the `f90` (or `f95` ) command. When the `-hpf_target gmpi` option is specified, this variable is used to specify a path to the desired generic Message Passing Interface (MPI) library to link with. If this variable is not used, then you must specify the desired MPI library to link against on the command line. See Section 3.50, -hpf, -hpf num, and Related Options --- Compile HPF Programs for Parallel Execution.
`DECF90_HPF_TARGET` (TU*X ONLY) | Variable for the f90 (or f95) command. If this variable is set, it must have one of the values of the `-hpf_target` option. See Section 3.50, -hpf, -hpf num, and Related Options --- Compile HPF Programs for Parallel Execution. `DECF90_WSF_TARGET` is a nonpreferred synonym for `DECF90_HPF_TARGET` .
`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: `pre` is added to the front of the command line, before any characters the user enters. `post` is added to the end of the command line.
`DECF90_LIB_DIR` | Path for the f90 compiler to use to find the Fortran run-time libraries.
`DECFORT` (TU*X ONLY) | Location of the Fortran 77 compiler to invoke.
`DECFORT_CC` (TU*X ONLY) | Location of the cc command for the Fortran 77 compiler.
`DECFORT_DIR` (TU*X ONLY) | Path for the f77 command to use to find the f77 compiler and `for_main.o` file. `DECFORT_DIR` supersedes `DECFORT` and is superseded by `DECFORT_LIB_DIR` .
`DECFORT_FPP` (TU*X ONLY) | Requests that the Fortran preprocessor `fpp` be run before compiling Fortran 77 source files when `-cpp` has been specified. For more information about the Fortran preprocessor and the related `-fpp` and `-nofpp` options, see Section 3.45.
`DECFORT_INIT` (TU*X ONLY) | Initial options for the f77 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: `pre` is added to the front of the command line, before any characters the user enters. `post` is added to the end of the command line.
`DECFORT_LIB_DIR` (TU*X ONLY) | Path for the f77 compiler to use to find the Fortran run-time libraries.
`LD_LIBRARY_PATH` (TU*X ONLY) | Path on which to find shared libraries for an executable program.
`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.

# B.3 Run-Time Environment Variables

Table B-2 describes the environment variables Compaq Fortran recognizes at run time.

Environment variables used with OpenMP Fortran API (multithreaded parallel processing) are described in Section 6.4, Environment Variables for Adjusting the Run-Time Environment.)

For more information, see Section 7.5.7, Using Environment Variables.

Table B-2 Run-Time Environment Variables
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.
`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_DISABLE_STACK_TRACE` (TU*X ONLY) | Disables outputting of stack trace information as part of the run-time error message for a severe error. The normal run-time error message is produced instead. See Section 8.1.1, Run-Time Message Format.
`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_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_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` .
`FORT n` | 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.
`FORT_BUFFERED` | Specifies that buffered I/O will be used for sequential output to all I/O units, except those whose output is to the terminal. This provides a run-time mechanism to support the behavior enabled by the `-assume buffered_io` option. For more information, see Section 3.6 and Section 5.6.7, Efficient Use of Record Buffers and Disk I/O.
`FORT_CONVERT n` | 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.5.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.5.2.
`MP_*` (TU*X ONLY) | Compaq Fortran parallel compiler environment variables, used with directed parallel processing. For more information, see Section 6.4, Environment Variables for Adjusting the Run-Time Environment.
`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 Section 6.4, Environment Variables for Adjusting the Run-Time Environment.
`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 an 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).

Previous | Next | Contents | Index