crayftn

Date:

10-31-2023

NAME

ftn - Invokes the Cray Fortran Compiler

SYNOPSIS

ftn
   [-A module_name[, module_name] ...]
   [-b bin_obj_file]
   [-c]
   [-d disable]
   [-D identifier[=value]]
   [-e enable]
   [-E]
   [-f source_form]
   [-f backslash]
   [-f cray-program-library-path=program_library]
   [-f denormal-fp-math=ieee]
   [-f denormal-fp-math=preserve-sign]
   [-f [no]openmp]
   [-f pic]
   [-f PIC]
   [-f sanitize=<check>]
   [-F]
   [-g]
   [-G debug_lvl]
   [-h arg]
   [-I incldir]
   [-J dir_name]
   [-K trap=opt[, opt] ...]
   [-l libname]
   [-L ldir]
   [-m msg_lvl]
   [-M msgs]
   [-N col]
   [-o out_file]
   [-O opt[, opt] ...]
   [-p module_site [,module_site ...]]
   [-Q path]
   [-r list_opt]
   [-R runchk]
   [-s size]
   [-S]
   [-T]
   [-U identifier[,identifier]...]
   [-v]
   [-V]
   [--version]
   [-W phase,"opt...",]
   [-x dirlist]
   [-X npes]
   [-Y phase,dirname]
   [--]
   sourcefile [sourcefile ...]

IMPLEMENTATION

Cray Linux Environment (CLE)

DESCRIPTION

The ftn command invokes the Cray Fortran Compiler. Typically, the command processes the input files named on the command line and generates a binary object file, and then loads the binary object file and generates the executable file a.out.

When options are specified that are not available, the compiler issuse either warnings or errors. If only warnings are issued, compilation continues.

For a more detailed description of the ftn command, see the Cray Fortran Reference Manual. Information contained in this man page may differ from the reference manual. Where the information differs, this man page supersedes the information contained in the reference manual.

OpenMP Support

OpenMP is disabled by default and must be explicitly enabled using the -homp or -fopenmp option.

CCE supports full OpenMP 5.0 and partial OpenMP 5.1 and 5.2. See the intro_openmp(7) man page for full details.

Module information files

The compiler creates modules through the MODULE statement. A module is referenced with the USE statement. By default, all .mod files are named MODULENAME.mod, where MODULENAME is the name of the module (in uppercase) specified in the MODULE or USE statement.

Options that change this are -e/dm, -e/df, -J, and -Q.

  • -em is the default.

  • -dm causes the information to be written to the binary .o file.

  • -ef modifies -em to write the information to the modulename.mod file rather than MODULENAME.mod. -ef is not allowed with -dm.

  • -J and -Q specify a directory where all .mod output is created in and searched for. -J is only allowed with -em and -ef and only affects module information location. -Q is also allowed with -dm and affects all non-temporary files.

The search order for satisfying module references in USE statements is as follows:

  1. The current compilation.

  2. The -J dir_name directory, if specified.

  3. Any directories or files specified with the -p and -I options, in order of specification.

  4. Any directories or files specified with the FORTRAN_MODULE_PATH environment variable.

  5. The current working directory or the -Q directory, if specified.

By default, when searching within a directory, the compiler first searches the .mod files, then the .o files, then the .a files, and then the directories, in the order specified.

For module compatibility purposes, the Cray Fortran compiler supports the current release and two previous releases.

Command-line Options

The ftn command accepts the following options:

-A module_name[,module_name]

Directs the compiler to behave as if you entered a USE module_name statement for each module_name in your Fortran source code. The USE statements are entered in every program unit and interface body in the source file being compiled.

-b bin_obj_file

Disables the link step and saves the binary object file of your program in bin_obj_file.

  • Only one input file is allowed when the -b bin_obj_file option is specified. If you have more than one input file, use the -c option instead. If only one input file is being processed and neither the -b nor -c option is specified, the binary object file of your program is not saved after the link step is completed.

  • If both -b bin_obj_file and -c are specified, the link step is disabled and the binary object file is written to bin_obj_file.

  • Default: disabled

-c

Disables the link step and saves the binary object file version of your program in file.o, where file is the name of the source file. If there is more than one source file, a file.o is created for each input file specified.

  • Default: off

-d disable, -e enable

Disables or enables compiling options. To specify more than one compiling option, enter the options without separators between them; for example, -e aj. disable/enable can be one or more of the following options:

Option

Action

0

Initializes all undefined local stack, static, and heap variables to 0 (zero). If a user variable is of type character, it is initialized to NUL. If logical, initialized to false. The stack variables are initialized upon each execution of the procedure. When used in combination with -ei, Real and Complex variables are initialized to signaling NaNs, while all other typed objects are initialized to 0. Objects in common blocks will be initialized if the common block is declared within a BLOCKDATA program unit compiled with this option.

  • Default: disabled

a

Aborts compilation after encountering the first error.

  • Default: disabled

A

Treat all module variables as PUBLIC. Do not override any explicit PRIVATE statements or attributes. Disabling this option with -dA has the effect of including a PRIVATE statement in the specification part of the module.

  • Default: enabled

b

If enabled, issue a warning message rather than an error message when the compiler detects a call to a procedure with one or more dummy arguments having the TARGET, VOLATILE or ASYNCHRONOUS attribute and there is not an explicit interface definition.

  • Default: disabled

B

Generates binary output. If disabled, inhibits all optimization and allows only syntactic and semantic checking.

  • Default: enabled

c

Interface checking: use Cray system modules to check library calls in a compilation. If you have a procedure with the same name as one in the library, you will get errors, as the compiler does not skip user-specified procedures when performing checks.

  • Default: disabled

C

Enable/disable some types of standard call site checking. The current Fortran standard requires that the number and types of arguments must agree between the caller and callee. These constraints are enforced in cases where the compiler can detect them, however, specifying -dC disables some of this error-checking, which may be necessary in order to get some older Fortran codes to compile.

  • Note: If error-checking is disabled, unexpected compile-time or runtime errors may occur.

  • In addition, the compiler by default attempts to detect situations in which an interface block should be specified but is not. Specifying -dC disables this type of checking as well.

  • Default: enabled

d

Controls a column-oriented debugging feature when using fixed source form. When enabled, the compiler replaces a D or d character appearing in column 1 of your source with a blank and treats the entire line as a valid source line. This feature is useful if you want to insert PRINT statements as part of your debugging process.

  • Default: disabled

D

The -eD option enables all debugging options. This option is equivalent to specifying the -G0 option with the -m2, -rl, -R bcdsp, and -e0 options.

  • Default: disabled

e

Enable/disable masking expression support for non-integer type operands. This allows masking expressions to be evaluated without type conversion.

  • For example, with this enabled,

    real_variable = real_variable .or. another_real_variable

    will be evaluated as a bitwise or and the assignment will occur without type conversion. By default, the compiler will turn .or. into the IOR intrinsic and type conversion will occur when the value is assigned to the real_variable. This option may not be supported in all situations because of new compiler optimization requirements.

  • Default: disabled

E

The -eE option allows existing declarations to duplicate the declarations contained in a used module. Only existing declarations that declare the function name or generic name in an EXTERNAL or type statement are allowable under this option. Therefore, you do not have to modify the older code by removing the existing declarations. Because the declarations are not removed, the use associated objects duplicate declarations already in the code, which is not standard conforming. However, this option allows the compiler to accept these statements as long as the declarations match the declarations in the module.

  • Existing declarations of a procedure must match the interface definitions in the module; otherwise an error is generated.

f

This option is a modifier to the -em option. When this option is enabled, module files are created with lowercase names, as in modulename.mod. When it is disabled, module file creation is determined by the setting of the -em option. The compiler writes a modulename.mod file for each module; modulename is created by taking the name of the module and, if necessary, converting it to lowercase.

  • Default: disabled

F

Controls preprocessor expansion of macros in Fortran source lines.

  • Default: enabled whenever preprocessing is enabled.

g

Allows branching into the code block for a DO or DO WHILE construct, which may be necessary in order to permit older codes to compile. Historically, codes used branches out of and into DO constructs. Current Fortran standards prohibit branching into a DO construct from outside of that construct and the compiler issues an error in this situation. Specifying the -eg option will allow codes with these constructs to compile, but performance may suffer as a result.

  • Default: disabled

h

Enables support for 8-bit and 16-bit INTEGER and LOGICAL types that use explicit kind or star values.

  • By default (-eh), data objects declared as INTEGER(kind=1) or LOGICAL(kind=1) are 8 bits long and objects declared as INTEGER(kind=2) or LOGICAL(kind=2) are 16 bits long. When this option is disabled (-dh), data objects declared as INTEGER(kind=1), INTEGER(kind=2), LOGICAL(kind=1), or LOGICAL(kind=2) are 32 bits long.

  • Note: Vectorization of 8- and 16-bit objects is deferred.

  • Default: enabled

i

Initializes all undefined local stack, static, and heap variables of type REAL or COMPLEX to an invalid value (signaling NaN). Stack variables are initialized upon each execution of the procedure. Objects in common blocks will be initialized if the common block is declared within a BLOCKDATA program unit compiled with this option.

  • Default: disabled

I

Treat all variables as if an IMPLICIT NONE statement had been specified. Do not override any IMPLICIT statements or explicit type statements. All variables must be typed.

  • Default: disabled

j

Execute DO loops at least once.

  • Default: disabled

K

Allow character literal continuation in free source form without the leading & (ampersand character) on the continuing line. This is an extension to the Fortran standard.

  • Default: enabled

m

When this option is enabled, the compiler creates MODULENAME.mod files to hold module information for future compiles.

  • The compiler writes a MODULENAME.mod file for each module; MODULENAME is created by taking the name of the module and, if necessary, converting it to uppercase.

  • The -ef option is a modifier to the -em option. If -ef is specified, the output goes to modulename.mod rather than MODULENAME.mod.

  • Default: enabled

n

Generates messages to note nonstandard Fortran usage.

  • Default: disabled

N

-eN is the same as -en, except that the messages are ERROR level.

  • If -dN is specified, ANSI messages are not generated. This is the same as -dn

  • If multiple -en, -dn, -eN, or -dN options are specified, the last one encountered takes precedence.

  • Default: disabled

o

Display to stderr the optimization options the compiler used for this compilation. This is the same as specifying -h display_opt.

  • Default: disabled

p

Enables or disables double precision arithmetic. This option can only be used when the default data size is 64 bits (-s default64 or -s real64). Double precision arithmetic is disabled, by default.

  • When the -s default64 or -s real64 option is used, and double precision arithmetic disabled, variables declared on a DOUBLE PRECISION statement and constants specified with the D exponent are converted to default real type (64-bit). If double precision is enabled (-ep), they are handled as a double precision type (128-bit).

  • Similarly when -s default64 or -s real64 option is used, variables declared on a DOUBLE COMPLEX statement and complex constants specified with the D exponent are mapped to the complex type in which each part has a default real type, so the complex variable is 128-bit. If double precision is enabled (-ep), each part has double precision type, so the double complex variable is 256-bit.

  • Default: disabled

P

Performs source preprocessing on Fortran source files, but does not compile. When specified, source code is included by #include directives but not by Fortran INCLUDE lines. Generates file.i, which contains the source code after the preprocessing has been performed and the effects applied to the source program. If the -oout_file is also specified, the preprocessed source is written to out_file instead of file.i.

  • Default: disabled

q

Aborts compilation if 100 or more errors are generated.

  • Default: enabled

Q

Controls whether or not the compiler accepts variable names that begin with a leading underscore (_) character. For example, when -e Q is specified, the compiler accepts _ANT as a variable name. Enabling this option can cause collisions with system name space; for example, library entry point names.

  • Default: disabled

R

Compiles all functions and subroutines as if they contained a RECURSIVE keyword.

  • Default: enabled

s

Scale the values of the count and count_rate arguments for the SYSTEM_CLOCK intrinsic function down by a factor of 2**14 (16384) if the storage size of the values of each of the count and count_rate arguments is 32 bits.

  • Default: enabled

S

Generates assembly language output and saves it in file.s.

  • Default: disabled

T

Controls preprocessing of Fortran source files. When enabled, source preprocessing is performed. Macro expansion within Fortran source lines is enabled but can be controlled by the -e/d F command line option. When disabled (-dT), preprocessing of the Fortran source file is not performed, even for files with upper case suffixes such as file.F90.

  • Default: When not specified, the default is to honor the case of the file name suffix, and other preprocessing options such as -e/d Z, -e/d P, and -e/d F.

v

Allocate variables to static storage. These variables are treated as if they had appeared in a SAVE statement. Variables that are explicitly or implicitly defined as automatic variables are not allocated to static storage.

  • The following types of variables are not allocated to static storage: automatic variables (explicitly or implicitly stated), variables declared with the AUTOMATIC attribute, variables allocated in an ALLOCATE statement, and local variables in explicit recursive procedures. Variables with the ALLOCATABLE attribute remain allocated upon procedure exit, unless explicitly deallocated, but they are not allocated in static memory. Variables in explicit recursive procedures consist of those in functions, in subroutines, and in internal procedures within functions and subroutines that have been defined with the RECURSIVE attribute. The STACK compiler directive overrides this option.

  • Default: disabled

w

Enables support for automatic memory allocation for allocatable variables and arrays that are on the left hand side of intrinsic assignment statements.

  • Using this option may degrade runtime performance, even when automatic memory allocation is not needed. It can affect optimizations for a code region containing an assignment to allocatable variables or arrays; for example, by preventing loop fusion for multiple array syntax assignment statements with the same shape.

  • Default: enabled

X

If a module variable has initializers, implicit or explicit, and the variable has greater than 10,000 elements to be initialized, optionally create a new module procedure to do the initialization at runtime before MAIN is called. Enabling this option may significantly reduce compile time and reduce the size of the executable for some code, while increasing execution time. If performance is the only issue, disable this option.

  • Default: enabled

x

Enabling this option causes the SYSTEM_CLOCK intrinsic to use clock_gettime().

  • Default: disabled

z

Initialize all memory allocated by Fortran ALLOCATE statements to zero. This option applies only for the current source file and should be specified for each source file compilation where this behavior is desired.

  • Default: disabled

Z

Perform source preprocessing and compilation on Fortran source files. When specified, source code is included by both #include directives and Fortran INCLUDE lines. Generates file file.i, which contains the source code after the preprocessing has been performed and the effects applied to the source program.

  • Default: disabled

-D identifier[=value]

Defines variables used for source preprocessing as if they had been defined by a #define source preprocessing directive. If a value is specified, there can be no spaces on either side of the equal sign. If no value is specified, the default value is 1.

  • Compare to the -U identifier option.

-E

Performs source preprocessing on Fortran source files, but does not compile. When specified, source code is included by #include directives but not by Fortran INCLUDE lines. The preprocessed source code is sent to stdout. This option overrides other preprocessing control, -e/dP and -e/dZ.

-f source_form

Specifies whether the Fortran source file is written in fixed source form or free source form. For source_form, enter free or fixed.

  • The default is fixed for source files that have .f, .F, .for, or .FOR extensions. The default is free for source files that have .f90, .F90, .f95, .F95, .f03, .F03, .f08, .F08, .f18, .F18, .ftn, or .FTN extensions.

  • The upper-case file extensions, .F, .FOR, .F90, .F95, .F03, .F08, .F18, or .FTN, will enable source preprocessing by default.

-f backslash

Change the interpretation of backslashes in character literals from a single backslash character to “C-style” escape characters. The following combinations are expanded “a”, “b”, “f”, “n”, “r”, “t”, “v”, “\”, and “0” to the ASCII characters alert, backspace, form feed, newline, carriage return, horizontal tab, vertical tab, backslash, and NUL, respectively.

**-f cray-program-library-path=***program_library*

Create and use a persistent repository of compiler information specified by program_library. When used with -h wp, this option provides application-wide, cross-file, automatic inlining. This option is an alias to -h pl= program_library compiler option. See -h wp.

-f [no-]openmp

Enable or disable compiler recognition of OpenMP directives. Using -fno-openmp is similar to the -h thread0 option, in that it disables OpenMP, but unlike -h thread0, -fno-openmp does not affect autothreading. This option is an alias to -h[no]omp. CrayPE will link in the serial version of LibSci when -fno-openmp is used.

  • Default: -f no-openmp [-h noomp]

-f [no-]openmp-simd

Enable or disable compiler recognition of OpenMP SIMD directives. This option may be enabled (-h omp_simd or -fopenmp-simd) when general OpenMP is disabled (-h noomp or -fno-openmp), allowing the compiler to take advantage of omp simd constructs for CPU vectorization without enabling CPU threading for omp parallel constructs. This option may not be disabled (-h noomp_simd or -fno-openmp-simd) when general OpenMP is enabled (-h omp or -fno-openmp). Specifying -O0 with OpenMP disabled (-h noomp or -fno-openmp) will disable OpenMP SIMD recognition (-h noomp_simd or -fno-openmp-simd). This option is an alias to -h [no]omp_simd.

  • Default: -f openmp-simd

-f denormal-fp-math=ieee

When applied on the link step, begin execution with Gradual Underflow for denormals.

-f denormal-fp-math=preserve-sign

When applied on the link step, begin execution with Abrupt Underflow (aka flush-to-zero) for denormals. This is default behavior for Fortran on CPUs.

-f pic, -f PIC

Generates position independent code (PIC), which allows a virtual address change from one process to another, as is necessary in the case of shared, dynamically linked objects. The virtual addresses of the instructions and data in PIC code are not known until dynamic link time. These are aliases to -hpic and -hPIC.

-f sanitize=<check>

Turns on runtime checks for various forms of undefined or suspicious behavior. This is an experimental feature currently.

This option controls whether the compiler adds runtime checks for various forms of undefined or suspicious behavior, and is disabled by default. If a check fails, a diagnostic message is produced at runtime explaining the problem.

The following checks are currently supported:

-fsanitize=address

Enables AddressSanitizer, a memory error detector.

  • Note: COMMON variables are not supported currently.

-fsanitize=thread

Enables ThreadSanitizer, a data race detector.

  • Note: Address Sanitizer and Thread Sanitizer cannot be used simultaneously.

  • Note: Lower optimization levels are more likely to produce accurate sanitizer reports

-f syntax-only

A fast syntax only check of your source file. The code is parsed and most semantic error checking is done. The optimizer is not called and no code is generated. Thus any errors generated in the optimizer are not checked for. Modules are written out to the .mod files so that subsequent USE statements will resolve correctly. This option is not allowed with -dm.

-F

Macro expansion in Fortran source lines is now enabled by default whenever preprocessing is enabled. See the -d|e F option. The -F option is obsolete and supported for compatibility with legacy make files.

-g

When specified with no optimization options or with -O0, provides debugging support identical to specifying the -G0 option. If any optimization option is specified, -g is ignored.

  • Default: off

-G debug_lvl

Controls the tradeoffs between ease of debugging and compiler optimizations. The compiler produces some level of internal debugger information (DWARF) at all times. This DWARF data provides function and source line information to debuggers for tracebacks and breakpoints, as well as type and location information about data variables.

  • Note: The -g or -G options can be specified on a per-file basis, so that only part of an application pays the price for improved debugging.

debug_lvl

0

Full DWARF information is available for debugging, but at the cost of a slower and larger executable. Breakpoints can be set at each line. Most optimizations are disabled including floating point optimizations. This level of debugging implies, -h ipa0, -h scalar0, -h thread0, -h vector0 and -h fp0. Pattern, fusion and unrolling are all off.

1

Most DWARF information is available with partial optimization. Some optimizations make tracebacks and limited breakpoints available in the debugger. Some scalar optimizations and all loop nest restructuring is disabled, but the source code will be visible and most symbols will be available. This allows block-by-block debugging, with the exception of innermost loops. The executable will be faster than with -g or -G0.

2

Partial DWARF information. Most optimizations, tracebacks and very limited breakpoints are available in the debugger. The source code will be visible and some symbols will be available. This level allows post-mortem debugging, but local information such as the value of a loop index variable is not necessarily reliable at this level because such information often is carried in registers in optimized code. The executable will be faster and smaller than with -G1.

-h arg

The -h arg option enables you to access various compiler functions. Some of these options duplicate -O arg options.

[no]acc

Enables or disables the compiler recognition of OpenACC accelerator directives. See the intro_openacc(7) man page.

  • Default: acc

acc_model=option[:option] …

Explicitly control execution and memory model utilized by the accelerator support system. The option arguments identify the type of behavior desired. There are three option sets, only one member of a set may be used at a time; however, all three sets may be used together.

  • option Set 1:

    auto_async_none

    Execute kernels and updates synchronously, unless there is an async clause present on the kernels or update directive.

    auto_async_kernel

    Default. Execute all kernels asynchronously ensuring program order is maintained.

    auto_async_all

    Execute all kernels and data transfers asynchronously, ensuring program order is maintained.

  • option Set 2:

    no_fast_addr

    Use default types for addressing.

    fast_addr

    Default. Attempt to use 32 bit integers in all addressing to improve performance. Base addresses remain as 64 bit. The performance is improved by potentially using fewer registers and faster arithmetic for offset calculations. This optimization may result in incorrect behavior for codes that make use within accelerator regions of any of the following: very large arrays (offsets would require greater than 32 bits); very large array lower bounds (max offset plus lower bound is greater than 32 bits); bitfields/other bit operations.

  • option Set 3:

    no_deep_copy

    Default. Do not look inside of an object type to transfer sub-objects. Allocatable members of derived type objects will not be allocated on the device.

    deep_copy

    (Fortran only) Look inside of derived type objects and recreate the derived type on the accelerator recursively. A derived type object that contains an allocatable member will have memory allocated on the device for the member.

  • Default: auto_async_kernel:fast_addr:no_deep_copy

[no]add_paren

The -hadd_paren option automatically adds parenthesis to select associative operations (+,-,*) to encourage left to right evaluation of floating point and complex expressions. Left to right evaluation is not required by the language standards, but some applications may expect it.

  • Default: noadd_paren

[no]aggress

Causes the compiler to treat a subroutine, function, or main program as a single optimization region. Doing so can improve the optimization of large program units but also increases compile time and size.

  • Default: noaggress.

[no]align_arrays

Controls padding of arrays in static data. Some statically allocated arrays are aligned and padded for better cache behavior. Common block data is not affected.

  • Default: align_arrays

[no]autoprefetch

Controls automatic prefetch optimization. Does not affect loop_info [no]prefetch directive.

  • Default: autoprefetch.

[no]autothread

The -h [no]autothread option enables or disables autothreading.

  • Default: noautothread

[no]bounds

Enables checking of array bounds. Bounds checking is not performed on arrays dimensioned as (1). Enables -Ooverindex. Equivalent to the -Rb option.

byteswapio

Forces byte-swapping of all input and output files for direct and sequential unformatted I/O. Byteswapio is implemented during the linker phase so that it can be uniformly applied across the entire executable. This is a link-time option.

cblockn

Specify cache blocking policy, where n is a level from 0 to 3. At level 0 no cache blocking is performed, directives are ignored; at level 1 only block according to directives; at level 2 honor directives and block for largest private cache; at level 3 honor directives and block for largest cache (prorated for core sharing).

  • Default: cblock0

cachen

Specify the level of automatic cache management to be performed, where n is a value from 0 to 3 with 0 being no cache management and 3 being the most aggressive. Note that cache blocking is controlled by the cblock level, a separate option.

  • Default: cache0

[no]caf

Enable the compiler to recognize coarray syntax. The macro _CRAY_COARRAY will be defined as 1 if -hcaf is specified on the command line.

  • Note: -hnocaf is required for Fortran code when it will be linked with C++ code.

  • Note: PGAS behavior is determined by the number of physical cores on the node. For more information, see the intro_pgas(7) man page.

  • Note: On Cray Cluster Systems (CCS), the default is nocaf. If using the -h caf option, the -L <path_to_pmi> option must also be used. The path_to_pmi argument should be the location where libpmi.so is located on the system. For example, if a site is using slurm and the slurm install base is located at /global/opt/slurm/default, the the following link option should be provided: -L /global/opt/slurm/default/lib64.

  • Default: caf

[no]concurrent

Equivalent to adding a concurrent directive before every loop in the file, including loops created from array syntax. This option may provide significant performance improvements for some codes. The user must ensure that all loops are clearly parallel; private arrays, ambiguous reductions and other special forms may not yield valid parallel code in this mode. -hnoconcurrent honors existing concurrent directives.

  • The default is -hnoconcurrent.

[no]contiguous

The -hcontiguous option declares that every assumed shape array and array pointer target is contiguous, whether or not they have a CONTIGUOUS keyword, potentially increasing the range of permitted compiler optimizations. By default, the compiler does not assume that all array pointers are pointers associated with contiguous targets or that all assumed shape arrays are contiguous and there is no way to verify this at compile time.

  • Note: Use with caution. This additional level of compiler optimization is safe when the memory objects occupy contiguous blocks of memory. Also, if there is potential for hidden dependencies between the memory locations which the pointers are referring to, then do not use this option.

  • Default: nocontiguous

[no]contiguous_assumed_shape

If contiguous_assumed_shape is specified, all assumed-shape dummy arguments are implicitly marked with the CONTIGUOUS attribute.

  • Default: nocontiguous_assumed_shape

cpu=target_system

Specify the target Cray system on which the absolute binary file is to be executed, where target_system can be either ivybridge, sandybridge, haswell, broadwell, mic-knl, x86-skylake, x86-cascadelake, x86-naples, or arm-thunderx2.

  • If target_system is set during compilation of any source file, it must be set to the same target during linking and loading.

  • Rather than setting this option directly, users should load one of the targeting modules (for example, craype-sandybridge). The targeting modules set CRAY_CPU_TARGET and define paths to the corresponding libraries. The compiler driver script translates CRAY_CPU_TARGET to the corresponding cpu=target_system option when calling the compiler.

  • If a user wishes to override the current target_system value set by the module environment (via the CRAY_CPU_TARGET definition), they should do so by specifying -hcpu=target_system on the compiler command line.

craylibs_arch_override

Forces the Cray math library to honor the processor architecture specified by the -h cpu option. Processor architecture is typically specified by loading one of the targeting modules, e.g., craype-sandybridge, but can be overridden at link time by using the -h cpu option.

  • If the CRAYLIBS_ARCH_OVERRIDE environment variable is defined, it takes precedence over this option.

develop

Reduce compile time at the expense of optimization, by omitting or scaling back optimizations that are known to increase compile time. This option is intended to be used when a program is under development and being recompiled frequently, and is different from and independent of the -O options. Consider using this option when using the -O0 or -O1 options results in a longer compile time, or when code compiled with the -O0 or -O1 options runs so slowly as to negate whatever time savings were gained by faster compilation.

  • Default: off

dir_check

Enables a run time check for the !dir$ collapse directive and checks the validity of the loop_info count information. Equivalent to the -Rd option.

display_opt

Display the compiler optimization settings currently in force. This option is identical to the -eo option.

dynamic

Directs the compiler driver to link dynamic libraries at runtime. This option is used to create dynamically linked executable files and may not be used with the -h static or -h shared options. Note that the preferred invocation is to call the generic ftn command with the -dynamic option, rather than using this compiler specific option. See the ftn(1) man page.

  • See also CRAYPE_LINK_TYPE in the Environment Variables section.

error_on_warning

If set, this changes the message level of all warning messages to error.

  • Default: off

find_dirs

Issues warning messages for all unsupported INTEL directives (they use !DIR$), all !OCL (fujitsu), !PGI$, !GCC$ and !DEC$ directives. This option is off by default.

flex_mp=level

Controls the aggressiveness of optimizations which may affect floating point and complex repeatability when application requirements require identical results when varying the number of ranks or threads.

  • The values for level are:

    intolerant

    Has the highest probability of repeatable results, but also the highest performance penalty.

    rigorous

    Maintains the bit-reproducibility of intolerant but provides most of the performance benefits of strict.

    strict

    Uses some safe optimizations and yields higher performance than intolerant, with a high probability of repeatable results.

    conservative

    Uses more aggressive optimization and yields higher performance than strict, but results may not be sufficiently repeatable for some applications.

    default

    Uses more aggressive optimization and yields higher performance than conservative, but results may not be sufficiently repeatable for some applications.

    tolerant

    Uses most aggressive optimization and yields highest performance, but results may not be sufficiently repeatable for some applications.

  • Default: default

[no]fma

The -hnofma option can be used to disable the generation of fused multiply add (FMA) instructions, if supported on the target hardware. FMA instructions are enabled by default at -hfp levels of 1 or higher, but disabled by default at -hfp0. This option can be used for debugging a numerically sensitive application. The use of FMAs are generally better for performance, but introduce different, although not necessarily incorrect, rounding. This will only affect compiler-generated FMA opportunities and will not affect pre-built libraries.

  • Default: fma (enabled, except at -hfp0)

[no]fortran_ptr_alias

The nofortran_ptr_alias option indicates storage accessed through a Fortran POINTER is only accessible from said POINTER. The compiler is free to assume no overlap with other POINTER based storage or variables with the TARGET attribute. This is a very strong assertion. When applicable, it permits very aggressive optimizaiton.

  • Default: fortran_ptr_alias

[no]fortran_ptr_overlap

The nofortran_ptr_overlap option indicates storage accessed through one Fortran POINTER does not overlap with storage accessed through any other Fortran POINTER; while overlap with non-POINTER variables with TARGET attribute is allowed.

  • Default: fortran_ptr_overlap

fpn[=[no]approx]

Controls the level of floating point optimizations, where n is a value between 0 and 4, with 0 giving the compiler minimum freedom to optimize floating point operations and 4 giving it maximum freedom. The higher the level, the less the floating point values conform to the IEEE standard. Use -h fp4 only if your application uses algorithms which are tolerant of reduced precision. Do not use -h fp4 for codes that use Boost I/O or for any codes that do “roll your own” I/O.

  • The approx option allows (approx) or prevents (noapprox) rewrites of square root and divide expressions using hardware reciprocal approximations. The defaults are noapprox for -hfp0 or -hfp1 and approx for all other optimization levels.

  • fp0 may provide well defined values from some intrisic operations where the Fortran language standard does not specify behavior. For examples see CEILING and FLOOR.

  • Default: fp2

[no]fp_trap

Controls whether the compiler generates code compatible with floating point traps being enabled.

  • Default: fp_trap, if traps are enabled using the -K trap option, or if -Ofp[0,1] is in effect. Otherwise, the default is nofp_trap.

[no]func_trace

The -h func_trace option is for use only with CrayPat (Cray performance analysis tool). If this option is specified, the compiler inserts CrayPat entry points into each function in the compiled source file. The names of the entry points are __pat_tp_func_entry and __pat_tp_func_return.

  • These are resolved by CrayPat when the program is instrumented using the pat_build command. When the instrumented program is executed and it encounters either of these entry points, CrayPat captures the address of the current function and its return address.

  • Default: nofunc_trace

fusionn

Controls loop fusion globally and changes the assertiveness of the FUSION directive.

  • Loop fusion can improve the performance of loops. Although in some rare cases it may degrade overall performance.

  • The n argument enables you to turn loop fusion on or off and determine where fusion should occur. It also affects the assertiveness of the FUSION directive. n can be one of the following values:

    0

    No fusion (ignore all FUSION directives and do not attempt to fuse other loops)

    1

    Attempt to fuse loops that are marked by the FUSION directive.

    2

    Attempt to fuse all loops (includes array syntax implied loops), except those marked with the NOFUSION directive.

  • Default: fusion2

gasp[=opt[:opt]]

Request GASP (Global Address Space Performance Analysis) instrumentation. With no options specified, remote data accesses are profiled. When opt is specified, the compiler provides additional instrumentation as follows:

local

Enables instrumentation of events generated by shared local accesses. Instrumenting these events can add runtime overhead to the application.

functions

Enables function instrumentation. It sets -hipa0.

[no]heap_allocate

-h heap_allocate forces all variable-size local arrays and temporary arrays to be allocated on the heap. heap_allocate directives are ignored.

  • -h noheap_allocate places variable-size local arrays and temporary arrays on the stack, except where the heap_allocate directive applies.

  • Default: noheap_allocate

ignore_unknown_dirs

Suppress generation of warning messages when compiler encounters an unknown directive.

ipalevel

Specifies the level of interprocedural optimization (IPA). level may be one of the following values.

0

Disable interprocedural analysis and optimizations. All inlining/cloning compiler directives are ignored.

1

Inlining/cloning is attempted for call sites and routines that are under the control of a compiler directive.

2

Includes level 1. Inline a call site to an arbitrary depth as long as the expansion does not exceed some compiler-determined threshold. The call site must flatten for any expansion to occur. The call site is said to “flatten” when there are no calls present in the expanded code. The call site must reside within the body of a loop and the entire loop body must flatten. A loop body is said to “flatten” when all call sites within the body of the loop are flattened.

3

(Default) Includes levels 1 and 2. Inline call sites that contain constant actual argument(s). Additionally, any call site (regardless of location) that is below some small compiler-determined threshold will inline, provided that call site flattens. If a routine does not inline, the compiler may clone said routine if there exists a performance benefit.

4

Includes levels 1, 2, and 3. Additionally, a call site does not have to reside in a loop body to inline, nor does the call site necessarily have to flatten.

5

Includes levels 1, 2, 3, and 4. Thresholds are raised and may allow for additional inlining/cloning that was not achieved at level 4.

nointerchange

Inhibits the compiler’s attempts to interchange loops. Interchanging loops by having the compiler replace an inner loop with an outer loop can increase performance. The compiler performs this optimization by default.

  • Specifying the -h nointerchange option is equivalent to specifying a NOINTERCHANGE directive prior to every loop. To disable loop interchange on individual loops, use the NOINTERCHANGE directive.

keepfiles

The -h keepfiles option prevents the removal of the object ( .o) and temporary assembly (.s) files after an executable is created. Normally, the compiler automatically removes these files after linking them to create an executable. Since the original object files are required in order to instrument a program for performance analysis, if you plan to use CrayPat to conduct performance analysis experiments, you can use this option to preserve the object files.

keep_frame_pointer

Retain call stack information back to main entry point for CrayPat performance sampling.

  • Default: off

list=a|c|d|e|E|i|l|m|o|s|T|x

Produce a listing file. The arguments are:

a

Include all reports in the listing (including source, cross references, options, lint, loopmarks, common block, and options used during compilation).

c

Listing includes a COMMON block report (lists all common blocks and members of each block).

d

Decompiles (translates) the intermediate representation of the compiler into listings that resemble the format of the source code. You can use these files to examine the restructuring and optimization changes made by the compiler, which can lead to insights about changes you can make to your Fortran source to improve its performance.

  • The compiler produces two decompilation listing files per source file specified on the command line, with these two extensions: .opt and .cg.

e

Expands included files in the source listing. This option is off by default.

E

Same as -h list=e for Fortran.

i

Used with the -h list=m option to intersperse loop optimization messages within the loopmark listing. By default, the messages are placed at the bottom of the program unit.

l

Lists source code and includes lint style checking. The listing includes the COMMON block report (see the -h list=c option for more information about the COMMON block report).

m

Produces a source listing with loopmark information. To provide a more complete report, this option automatically enables the -O negmsg option to show why loops were not optimized. If you do not require this information, use the -O nonegmsg option on the same command line. Loopmark information will not be displayed if the -d B option has been specified.

o

Show all options used by the compiler during compilation.

s

Lists source code.

T

Retains file.T after processing rather than deleting it. The file.T can be used to call ftnlx directly. For more information, see the ftnlx(1) man page.

x

Produces a cross-reference listing.

loop_trips=[tiny|small|medium|large|huge]

Specifies runtime loop trip counts for all loops in a compiled source file. This information is used to better tune optimizations to the runtime characteristics of the application.

map_long_double_to_real16

Maps the C_LONG_DOUBLE KIND from the ISO_C_BINDING module to a 128-bit REAL. This allows for interoperability in what would otherwise be an incompatible 80-bit extended precision C format. The corresponding C files must be compiled with the -mlong-double-128 option.

[no]modinline

Directs the compiler to create templates for module procedures and store them in file.o, MODULENAME.mod, or modulename.mod. These templates are used by IPA to inline/clone a routine. A USE statement makes the templates available to IPA.

  • Default: modinline

[no]msgs

Controls whether messages describing optimizations performed are written to stderr. Similar information in a more-readable format can be obtained by using the -rm option instead.

  • Default: nomsgs

[no]negmsgs

Controls whether messages explaining why optimizations such as vectorization or inlining did not occur are written to stderr. The -h negmsgs option enables the -h msgs option. The -rm option enables the -h negmsgs option.

  • Default: nonegmsgs

network=nic

Specifies the target machine’s interconnection attribute. The supported values are gemini and aries.

[no]omp

Enable or disable compiler recognition of OpenMP directives. Using -h noomp is similar to the -h thread0 option, in that it disables OpenMP, but unlike -h thread0, noomp does not affect autothreading. The -O [no]omp option is identical to the -h [no]omp option. CrayPE will link in the serial version of LibSci when -hnoomp is used.

  • Default: noomp

[no]omp_simd

Enable or disable compiler recognition of OpenMP SIMD directives. This option may be enabled (-h omp_simd or -fopenmp-simd) when general OpenMP is disabled (-h noomp or -fno-openmp), allowing the compiler to take advantage of omp simd constructs for CPU vectorization without enabling CPU threading for omp parallel constructs. This option may not be disabled (-h noomp_simd or -fno-openmp-simd) when general OpenMP is enabled (-h omp or -fno-openmp). Specifying -O0 with OpenMP disabled (-h noomp or -fno-openmp) will disable OpenMP SIMD recognition (-h noomp_simd or -fno-openmp-simd). This option is an alias to -f[no-]openmp-simd.

  • Default: omp_simd

[no]omp_trace

Enable or disable the insertion of CrayPat OpenMP tracing calls.

  • Default: noomp_trace

[no]overindex

Declares that there exists an array subscript applied to a multidimensional array such that the subscript exceeds the declared bounds of its dimension. Such a subscript still must result in an access to the same multidimensional array object.

  • Default: nooverindex

page_align_allocate

The -h page_align_allocate option directs the compiler to force allocations of arrays larger than the memory page size to be aligned on a page boundary. This option affects only the ALLOCATE statements of the current source file; therefore it must be specified for each source file where this behavior is desired. Using this option can improve DIRECTIO performance.

patternn

Enables pattern matching for library substitution. The pattern matching feature searches your code for specific code patterns and replaces them with calls to highly optimized routines. Use one of these values for n :

0

No pattern matching

1

Match memory copy and set.

2

Also match BLAS routines like matrix multiply

3

Also match specialized forms, such as max with index

  • The -h pattern option is enabled only for optimization levels -O2, -h vector2 or higher; there is no way to force pattern matching for lower levels.

  • Specifying -h nopattern disables pattern matching and causes the compiler to ignore the PATTERN and NOPATTERN directives. Same as -h pattern0.

  • Default: pattern3 (on most targets)

NOTE: maximum pattern level is reduced on targets where

library support is not yet complete.

[no]pattern

Enables pattern matching for library substitution.

  • nopattern is equivalent to pattern0

  • pattern is equivalent to the default pattern level (see above)

[no]pgas_runtime

The -h pgas_runtime option directs the compiler driver to link with the runtime libraries required when linking programs that use UPC or coarrays. In general, a resource manager job launcher such as aprun or srun must be used to launch the resulting executable.

  • The -hnopgas_runtime option prevents this runtime library environment from being added to the link line.

  • Use the -hnopgas_runtime option when you have a program that does not use UPC or coarrays and you want to execute it outside of the aprun/srun job launch context. For example, you may want to test a serial program that does not contain any UPC or coarray code on a login or service node, or fork/exec an executable on a compute node. Also, compile non-coarray Fortran using the -hnocaf option.

  • Note: PGAS behavior is determined by the number of physical cores on the node. For more information, see the intro_pgas(7) man page.

  • Note: For Cray Cluster Systems (CCS), the default is nopgas_runtime. If using the -h pgas_runtime option, the -L <path_to_pmi> option must also be used. The path_to_pmi argument should be the location where libpmi.so is located on the system. For example, if a site is using slurm and the slurm install base is located at /global/opt/slurm/default, the the following link option should be provided: -L /global/opt/slurm/default/lib64.

  • Default: pgas_runtime

pic, PIC

Generates position independent code (PIC), which allows a virtual address change from one process to another, as is necessary in the case of shared, dynamically linked objects. The virtual addresses of the instructions and data in PIC code are not known until dynamic link time.

pl=program_library

Create and use a persistent repository of compiler information specified by program_library. When used with -h wp, this option provides application-wide, cross-file, automatic inlining. The -fcray-program-library-path=program_library is provided as an alias to pl=program_library to match the CCE C/C++ compiler option. See -h wp.

  • The program_library repository is implemented as a directory and the information contained in program library is built up with each compiler invocation. Any compilation that does not have the -h pl option will not add information to this repository.

  • Because of the persistence of program_library, it is the user’s responsibility to manage it. For example, rm -r program_library might be added to the make clean target in an application makefile. Because program_library is a directory, use rm -r to remove it.

  • If an application makefile works by creating files in multiple directories during a single build, the program_library should be an absolute path, otherwise multiple and incomplete program library repositories will be created. For example, avoid -hpl=./PL.1 and use -hpl=/fullpath/builddir/PL.1 instead.

[no]preferred_vector_width[=64|128|256|512]

Specify the preferred vector width to use when vectorizing loops. This option does not guarantee that the specified vector width will be used, only that it is preferred. The optimizer is still free to choose a smaller width if it is expected to perform better. As the set of acceptable widths is target-sensitive and fairly complicated, the optimizer diagnoses any illegal values.

  • A value is not required when specifying nopreferred_vector_width.

profile_generate

Enables instrumenting of source code for CrayPat profile-guided optimization. For more information, see the intro_craypat(1) and pat_build(1) man pages.

scalarn

Specifies the level of scalar optimization, where n can be one of the following levels:

0

Disables scalar optimization.

1

Specifies conservative scalar optimization.

2

Specifies moderate scalar optimization.

3

Specifies aggressive scalar optimization.

  • Default: scalar2

shared

Creates a library which may be dynamically linked at runtime. Note that the preferred invocation is to call the generic ftn command with the -shared option, rather than using this compiler specific option. See the ftn(1) man page.

  • See also CRAYPE_LINK_TYPE in the Environment Variables section.

shortcircuitn

Specifies various levels of short circuit evaluation, which is an optimization in which the compiler analyzes all or part of a logical expression based on the results of a preliminary analysis. When enabled, the compiler attempts short circuit evaluation of logical expressions that are used in IF statement scalar logical expressions. This evaluation is performed on the .AND. and .OR. operator. n can be one of the following levels:

0

Disables short circuiting of IF and ELSEIF statement logical conditions.

1

Specifies short circuiting of IF and ELSEIF logical conditions only when a PRESENT, ALLOCATED, or ASSOCIATED intrinsic procedure is in the condition.

2

Specifies short circuiting of IF and ELSEIF logical conditions, and it is done left to right. This is the default for architectures without predicated vector support.

3

Specifies short circuiting of IF and ELSEIF logical conditions. It is an attempt to avoid making function calls. If either the left or right operand to .AND. and .OR. operators contain function calls, short circuit evaluation is performed. This is the default for architectures with predicated vector support.

static

Directs the linker to use the static version of the libraries, not the dynamic version of the libraries, to create an executable file. Note that the preferred invocation is to call the generic ftn command with the -static option. See the ftn(1) man page.

  • See also CRAYPE_LINK_TYPE in the Environment Variables section.

[no]safe_addr

Provides assurance that most conditionally executed memory references are thread safe, which in turn supports a more aggressive use of speculative writes, thereby improving application performance. If -h nosafe_addr is specified, the optimizer performs speculative stores only when it can prove absolute thread safety using the information available within the application code.

  • Default: -h safe_addr

[no]summary

Stops the log summary from printing out when any Warnings, Comments, Notes, or Optimization messages are issued. If Errors are issued, a log summary will always print out. If both -V[V[V]] and -h nosummary are specified, the last one specified wins.

  • Default: summary

threadn

Control the compilation and optimization of OpenMP directives, where n is a value from 0 to 3 with 0 being off and 3 specifying the most aggressive optimization. This option is identical to the -O threadn option. If -h thread1 is specified, it is equivalent to specifying -h nosafe_addr.

  • Default: thread2

[no]**thread_do_concurrent**

The -h thread_do_concurrent option permits DO CONCURRENT nests to be threaded unless prohibited by the loop_info prefer_nothread directive. The -h nothread_do_concurrent option disallows DO CONCURRENT nests to be threaded unless forced by the loop_info prefer_thread directive.

  • Default: nothread_do_concurrent

[no]**offload_do_concurrent**

The -h offload_do_concurrent option permits DO CONCURRENT nests to be offloaded to an accelerator. offload_do_concurrent overrides prior thread_do_concurrent flags; likewise, thead_do_concurrent overrides prior offload_do_concurrent flags. This feature requires an accelerator with Unified Shared Memory. See intro_openmp for details on specific accelerator types.

  • Default: nooffload_do_concurrent

unrolln

The -h unrolln option globally controls loop unrolling and changes the assertiveness of the UNROLL directive. By default, the compiler attempts to unroll all loops, unless the NOUNROLL directive is specified for a loop. Generally, unrolling loops increases single processor performance at the cost of increased compile time and code size. The n argument enables you to turn loop unrolling on or off and determine where unrolling should occur. It also affects the assertiveness of the UNROLL directive.

Use one of these values for n:

0

No unrolling (ignore all UNROLL directives and do not attempt to unroll other loops)

1

Attempt to unroll loops that are marked by the UNROLL directive.

2

Attempt to unroll all loops (includes array syntax implied loops), except those marked with the NOUNROLL directive. This is the default.

  • Default: unroll2

vectorn

Specifies the level of automatic vectorizing to be performed. Vectorization results in dramatic performance improvements with a small increase in object code size. Vectorization directives are unaffected by this option.

0

Minimal automatic vectorization. Characteristics include low compile time and small compile size. This option is compatible with all scalar optimization levels. The compiler will still vectorize array syntax in order to allow full source level debugging with reasonable performance. When this option is specified in conjunction with -hfp0 or -hfp1, then array syntax containing associative floating point or complex operations will not be vectorized.

1

Conservative vectorization. The -h vector1 option is compatible with -h scalar1, -h scalar2, and -h scalar3.

2

Moderate vectorization. Loop nests are restructured. The -h vector2 option is compatible with -h scalar2 or -h scalar3.

3

Aggressive vectorization.

  • Default: vector2

vector_classic

Prior to CCE 9.0, the Fortran NOVECTOR directive applied to the rest of the program unit, unless subsequently superseded by a VECTOR directive. Beginning with CCE 9.0, the VECTOR and NOVECTOR directives apply only to the next loop.

  • The -h vector_classic option, if specified, provides the pre-CCE 9.0 behavior and causes the VECTOR and NOVECTOR directives to behave as toggle switches, controlling vectorization for the remainder of the program unit unless superseded by the countervailing directive.

wp

Enables the whole program mode. This option causes the compiler backend (IPA, optimizer, codegenerator) to be invoked at application link time, enabling whole program automatic inlining/cloning and future whole program interprocedural analysis (IPA) optimizations. Requires that -h pl=program_library is also specified. The options -h pl=program_library and -hwp should be specified on all compiler invocations and on the compiler link invocation.

  • Since the -h wp option provides automatic application-wide inlining, the -Oipafrom option is no longer needed for cross-file inlining and using these two options together is not permitted.

  • Since -h wp delays the compiler optimization step until link time, -c compiles will take less time and the link step will take longer. Normally, this is just a time shift from one build phase to another with roughly the same overall compile time. In some cases increased inlining may cause an increase in overall compile time. Using -h wp allows the compiler backend to be invoked in parallel during a build. Setting the environment variable NPROC controls the number of concurrent compiler backend invocations and this parallelism may reduce overall compile time.

  • -O ipan guides heuristics of inlining/cloning expansion while the specification of pl=program_library and -hwp guides location and availability of the candidates for expansion.

zero

Initializes all undefined local stack variables to 0 (zero). If a user variable is of type character, it is initialized to NUL. The variables are initialized upon each execution of the procedure. This option is identical to the -e0 option.

  • Default: disabled

[no]zeroinc

Cause the compiler to assume that a constant increment variable (CIV) can be incremented by zero. A CIV is a variable that is incremented only by a loop invariant value. For example, in a loop with variable J, the statement J = J + K, where K can be equal to zero, J is a CIV. -h zeroinc can cause less strength reduction to occur in loops that have variable increments.

  • Default: nozeroinc

-I incldir

Specifies a directory to be searched for files named in INCLUDE lines and #include directives. You must specify an -I option for each directory you want searched. Directories can be specified in incldir as full pathnames or as pathnames relative to the working directory.

  • If no -I is specified, only the working directory and system directories are searched.

-J dir_name

Specifies an alternate directory for the module information files. The compiler puts the .mod files in this directory and searches for .mod files in this directory. The compiler will search for modules stored in the directories specified using the -J dir_name option for the current compilation automatically; it is not necessary to use the -p option explicitly to make the compiler do this.

  • -J is not allowed with -dm.

  • By default, the files are written to the current working directory.

-K trap=opt[,opt] …

Enable traps for the specified exceptions. By default, no exceptions are trapped. Enabling traps using this option also has the effect of setting -h fp_trap.

  • If the specified options contradict each other, the last option has priority. For example, -Ktrap=none,fp is equivalent to -Ktrap=fp.

  • This option does not affect compile time optimizations; it detects runtime exceptions. This option is processed only at link time and affects the entire program; it is not processed when compiling subprograms. Therefore, traps may be set using this command line option at the beginning of execution of the main program only. The program may subsequently change these settings by calling intrinsic or library procedures. Use of this option may require the specification of -hfp_trap when compiling other files of the application.

    opt

    Exceptions

    denorm

    Trap on denormalized operands.

    divz

    Trap on divide-by-zero.

    fp

    Trap on divz, inv, or ovf exceptions.

    inexact

    Trap on inexact result (i.e. rounded result). Enabling traps for inexact results is not recommended.

    inv

    Trap on invalid operation.

    none

    Disables all traps (default).

    ovf

    Trap on overflow (i.e. the result of an operation is too large to be represented).

    unf

    Trap on underflow (i.e. the result of an operation is too small to be represented).

-l libname

Directs the compiler driver to search for the specified object library file when linking an executable. To request more than one library file, specify multiple -l options.

  • When statically linking, the compiler driver searches for libraries by prepending ldir/lib on the front of libname and appending .a on the end of it, for each ldir that has been specified by using the -L option. It uses the first file it finds.

  • When dynamically linking, the library search process is similar to the static case, with a few differences. The compiler driver searches for libraries by prepending ldir/lib on the front of libname and appending .so on the end of it, for each ldir that has been specified by using the -L option. If a matching .so is not found, the compiler driver replaces .so with .a and repeats the process from the beginning. It uses the first file it finds.

  • There is no search order dependency for libraries.

  • If you specify personal libraries by using the -l command line option, those libraries are added before the default CCE library list.

  • For example, when the following command line is issued, the linker looks for a library named libmylib.a (following the naming convention) and adds it to the top of the list of default libraries.

% ftn -l mylib target.f
-L ldir

Changes the -l option search algorithm to look for library files in directory ldir. To request more than one library directory, specify multiple -L options.

  • Note: Multiple -L options are treated cumulatively as if all ldir arguments appeared on one -L option preceding all -l options. Therefore, do not attempt to link functions of the same name from different libraries through the use of alternating -L and -l options.

  • The compiler driver searches for library files in directory ldir before searching the default directories: /opt/ctl/libs and /lib.

  • For example, when statically linking, if -L ../mylib, -L /loclib, and -l m are specified, the compiler driver searches for the following files and uses the first one found:

../mylibs/libm.a
/loclib/libm.a
/opt/ctl/libs/libm.a
/lib/libm.a
-m msg_lvl

Specifies the minimum compiler message levels to enable. The following list shows the values for msg_lvl to specify in order to generate each type of message and which messages are generated by default:

0

Error, Warning, Caution, Note, and Comment

1

Error, Warning, Caution, and Note

2

Error, Warning, and Caution

3

Error and Warning (default)

4

Error

  • You can use the explain(1) command to view a message explanation.

-M msgs

The -M msgs option suppresses messages at the Warning, Caution, Note, and Comment levels and can change the default message severity to an Error or a Warning level. You cannot suppress or alter the severity of Error-level messages with this option.

  • To suppress messages, specify one or more integer numbers that correspond to the Cray Fortran Compiler messages you want to suppress. To specify more than one message number, specify a comma (but no spaces) between the message numbers. For example, -M 110,300 suppresses messages 110 and 300.

  • To change a message’s severity to an Error level or a Warning level, specify an E (for Error) or a W (for Warning) and then the number of the message. For example, consider the following option:

  • -M 300,E600,W400

    • This specification results in the following:

      • Message 300 is disabled and is not issued, provided that it is not an Error-level message by default. Error-level messages cannot be suppressed and cannot have their severity downgraded.

      • Message 600 is issued as an Error-level message, regardless of its default severity.

      • Message 400 is issued as a Warning-level message, provided that is it not an Error-level message by default.

-N col

Specifies the line width for source lines. The value specified for col determines the maximum number of columns per line.

  • col can be set to 72, 80, 132, 255, or 1023.

  • Characters in columns beyond the col specification are ignored.

  • By default, lines are 72 characters wide for fixed-format sources, and up to 10,000 characters wide for free-format sources.

-O opt[,opt]…

Specifies optimization features. The opt values 0, 1, 2, and 3 (fast) enable you to specify increasing general levels of optimization. The other opt values enable you to select specific optimization features.

  • The -O1, -O2, and -O3 (-Ofast) specifications do not directly correspond to the numeric optimization levels for scalar optimization and vectorization. For example, specifying -O3 does not necessarily enable scalar3 and vector3. Cray reserves the right to alter the specific optimizations performed at these levels from release to release. You can use the -eo option or the ftnlx command to display the optimization options used during compilation.

  • The valid opt values are:

    opt

    Optimization Provided

    -O0

    Disables all optimizations including floating point optimizations and OpenACC acceleration. (Equivalent to specifying -hfp0 and -hnoacc). To disable optimizations but leave acceleration enabled, specify -O0 -hacc.

    • Some informational messages may not be issued.

    -O1, -O2, -O3
    • Default: 2

    [no]aggress

    Cause the compiler to treat a subroutine, function, or main program as a single optimization region. Doing so can improve the optimization of large program units but also increases compile time and size.

    • Default: noaggress

    [no]autoprefetch

    Controls automatic prefetch optimization. Does not affect loop_info [no]prefetch directive.

    • Default: autoprefetch

    [no]autothread

    Enables or disables autothreading.

    • Default: noautothread

    cachen

    Specify the level of automatic cache management, where n can be one of the following values:

    0

    Specifies no automatic cache management; all memory references are allocated to cache. Both automatic cache blocking and manual cache blocking (by use of the BLOCKABLE directive) are shut off. Characteristics include low compile time. This option is compatible with all optimization levels.

    1

    Specifies conservative automatic cache management. Characteristics include moderate compile time. Symbols are placed in the cache when the possibility of cache reuse exists and the predicted cache footprint of the symbol in isolation is small enough to experience reuse.

    2

    Specifies moderately aggressive automatic cache management. Characteristics include moderate compile time. Symbols are placed in the cache when the possibility of cache reuse exists and the predicted state of the cache model is such that the symbol will be reused.

    3

    Specifies aggressive automatic cache management. Characteristics include potentially high compile time. Symbols are placed in the cache when the possibility of cache reuse exists and the allocation of the symbol to the cache is predicted to increase the number of cache hits.

    fast

    -Ofast is a synonym for -O3 and will result in the same optimization settings. It is provided for command line compatibility with the CCE Clang c/C++ compiler.

    fpn

    Controls the level of floating point optimizations, where n is a value between 0 and 3, with 0 giving the compiler minimum freedom to optimize floating point operations and 4 giving it maximum freedom. The higher the level, the less the floating point values conform to the IEEE standard.

    • When -hfp[0,1] is specified, it also has the effect of setting -hfp_trap.

    • Default: fp2

    fusionn

    Control loop fusion globally and changes the assertiveness of the FUSION directive.

    • Loop fusion can improve the performance of loops. although in some rare cases it may degrade overall performance.

    • The n argument enables you to turn loop fusion on or off and determine where fusion should occur. It also affects the assertiveness of the FUSION directive. n can be one of the following values:

      0

      No fusion (ignore all FUSION directives and do not attempt to fuse other loops)

      1

      Attempt to fuse loops that are marked by the FUSION directive.

      2

      Attempt to fuse all loops (includes array syntax implied loops), except those marked with the NOFUSION directive.

      • Default: fusion2

    ipalevel

    Control level of interprocedural analysis (IPA) which implies the control over the level of automatic inlining and cloning.

    • -O ipalevel guides heuristics of inlining/cloning expansion while the specification of -O ipafrom=source, or pl=program_library and -hwp guides location and availability of the candidates for expansion.

    • Inlining is the process of replacing a user procedure call with the procedure definition itself. This saves subprogram call overhead and may allow better optimization of the inlined code. If all calls within a loop are inlined, the loop becomes a candidate for parallelization.

    • Cloning is a situation in which a procedure is duplicated with modifications such that it will run more efficiently. For example, the compiler will clone a procedure for a specific call site when there are constant actual arguments present in that call site. When the clone is made, the dummy arguments are replaced with the constant actual arguments, and the original call to the procedure is replaced with a call to the duplicate copy.

    • When -O ipalevel is used alone, the candidates for expansion are all those functions that are present in the input file to the compile step. If -O ipalevel is used in conjunction with -O ipafrom=source or in conjunction with pl=program_library and -hwp, the candidates for expansion are those functions present in source or program_library, respectively.

    • The valid values for level are:

      0

      Disable interprocedural analysis and optimizations. All inlining and cloning compiler directives are ignored.

      1

      Directive IPA. Inlining/cloning is attempted for call sites and routines that are under the control of a compiler directive.

      2

      Inlining. Inline a call site to an arbitrary depth as long as the expansion does not exceed some compiler-determined threshold. The call site must flatten for any expansion to occur. The call site is said to “flatten” when there are no calls present in the expanded code. The call site must reside within the body of a loop and the entire loop body must flatten. A loop body is said to “flatten” when all call sites within the body of the loop are flattened. Includes level 1.

      3

      (Default) Constant actual argument inlining and tiny routine inlining. This includes levels 1 and 2, plus any call site that contains a constant actual argument. Additionally, any call nest (regardless of location) that is below some small compiler-determined threshold will be inlined, provided that call nest flattens completely. Cloning directives are recognized.

      4

      Aggressive inlining. This includes levels 1, 2, and 3. Additionally, a call site does not have to reside in a loop body to inline, nor does the call site necessarily have to flatten.

      5

      Aggressive inlining and aggressive cloning. Includes levels 1, 2, 3, and 4, plus routine cloning is attempted if inlining fails at a given call site.

    ipafrom=source*[:*source] …

    Explicitly indicate the procedures to consider for inlining/cloning.

    • The source arguments identify each file or directory that contains the functions to consider for inlining/cloning. Whenever a call is encountered in the input program that matches a function in source, inlining/cloning is attempted for that call site.

    • Note: Blank spaces are not allowed on either side of the equal sign.

    • All inlining directives are recognized with explicit inlining.

    • Note that the routines in source are not actually linked with the final program. They are simply templates for the inliner. To have a routine contained in source linked with the program, you must include it in an input file to the compilation.

    • The following source arguments are supported.

      Fortran source files

      The routines in Fortran source files are candidates for inline expansion and must contain error-free code. Source files that are acceptable for inlining are files that have one of the following extensions: .f, .F, .for, .FOR, .f90, .F90, .f95, .F95, .f03, .F03, .f08, .F08, .f18, .F18, .ftn, or .FTN

      module files

      MODULENAME.mod and modulename.mod files that contain precompiled inlining templates can be specified. However, this is unnecessary, as the compiler will find these files when resolving the USE statement during compilation.

      Directories

      A directory containing any of the Fortran source of Module files described above.

    loop_trips=[tiny|small|medium|large|huge]

    Specifies runtime loop trip counts for all loops in a compiled source file. This information is used to tune optimizations to the runtime characteristics of the application.

    • Default: none

[no]modinline

Directs the compiler to create templates for module procedures and store them in file.o, MODULENAME.mod, or modulename.mod. These templates are used by IPA to inline/clone a routine. A USE statement makes the templates available to IPA.

  • Default: modinline

[no]msgs

[no]msgs

Cause the compiler to write optimization messages to stderr. Similar information in a more-readable format can be obtained by using the -h list=m (-rm) option instead. Specifying the -h list=m option enables -h msgs.

  • Default: nomsgs

[no]negmsgs

Cause the compiler to generate messages to stderr that indicate why optimizations such as vectorization or inlining did not occur in a given instance. The -O negmsgs option enables the -O msgs option. The -rm option enables the -O negmsgs option.

  • Default: nonegmsgs

nointerchange

Inhibit the compiler’s attempts to interchange loops. Interchanging loops by having the compiler replace an inner loop with an outer loop can increase performance. The compiler performs this optimization by default.

  • Specifying the -O nointerchange option is equivalent to specifying a NOINTERCHANGE directive prior to every loop. To disable loop interchange on individual loops, use the NOINTERCHANGE directive.

[no]omp

Enable or disable compiler recognition of OpenMP directives. Using -O noomp is similar to the -O thread0 option, in that it disables OpenMP, but unlike -O thread0, noompdoes not affect autothreading. The -O [no]omp option is identical to the -h [no]omp option.

  • Default: noomp

[no]overindex

Declares that there exists an array subscript applied to a multidimensional array such that the subscript exceeds the declared bounds of its dimension. Such a subscript still must result in an access to the same multidimensional array object.

  • Default: nooverindex

[no]pattern

Enables pattern matching for library substitution. The pattern matching feature searches your code for specific code patterns and replaces them with calls to highly optimized routines.

  • The -O pattern option is enabled only for optimization levels -O2, -O vector2 or higher; there is no way to force pattern matching for lower levels.

  • Specifying -O nopattern disables pattern matching and causes the compiler to ignore the PATTERN and NOPATTERN directives.

  • Default: pattern

scalarn

Specifies the level of scalar optimization, where n can be one of the following levels:

0

Disables scalar optimization.

1

Specifies conservative scalar optimization.

2

Specifies moderate scalar optimization. This is the default.

3

Specifies aggressive scalar optimization.

shortcircuitn

Specifies various levels of short circuit evaluation, which is an optimization in which the compiler analyzes all or part of a logical expression based on the results of a preliminary analysis. When enabled, the compiler attempts short circuit evaluation of logical expressions that are used in IF statement scalar logical expressions. This evaluation is performed on the .AND. and .OR. operator. n can be one of the following levels:

0

Disables short circuiting of IF and ELSEIF statement logical conditions.

1

Specifies short circuiting of IF and ELSEIF logical conditions only when a PRESENT, ALLOCATED, or ASSOCIATED intrinsic procedure is in the condition.

2

Specifies short circuiting of IF and ELSEIF logical conditions, and it is done left to right. This is the default for x86-64.

3

Specifies short circuiting of IF and ELSEIF logical conditions. It is an attempt to avoid making function calls. If either the left or right operand to .AND. and .OR. operators contain function calls, short circuit evaluation is performed. This is the default for target cpus other than x86-64.

[no]safe_addr

Provides assurance that most conditionally executed memory references are thread safe, which in turn supports a more aggressive use of speculative writes, thereby improving application performance. If -h nosafe_addr is specified, the optimizer performs speculative stores only when it can prove absolute thread safety using the information available within the application code.

  • Default: -h safe_addr

threadn

Control the compilation and optimization of OpenMP directives, where n is a value from 0 to 3 with 0 being off and 3 specifying the most aggressive optimization.

  • The valid values for n are:

    0

    No autothreading or OpenMP threading. The -O thread0 option is similar to -O noomp, but -O noomp disables OpenMP only and does not affect autothreading.

    1

    Specifies strict compliance with the OpenMP standard for directive compilation. Strict compliance is defined as no extra optimizations in or around OpenMP constructs. In other words, the compiler performs only the requested optimizations. If -h thread1 is specified, it is equivalent to specifying -h nosafe_addr.

    2

    OpenMP parallel regions are subjected to some optimizations; that is, some parallel region expansion. Parallel region expansion is an optimization that merges two adjacent parallel regions in a compilation unit into a single parallel region.

    3

    Full optimization: loop restructuring, including modifying iteration space for static schedules (breaking standard compliance). Reduction results may not be repeatable.

  • Default: -O thread2

unrolln

The -O unrolln option globally controls loop unrolling and changes the assertiveness of the UNROLL directive. By default, the compiler attempts to unroll all loops, unless the NOUNROLL directive is specified for a loop. Generally, unrolling loops increases single processor performance at the cost of increased compile time and code size.

  • The n argument enables you to turn loop unrolling on or off and determine where unrolling should occur. It also affects the assertiveness of the UNROLL directive. Use one of these values for n:

    0

    No unrolling (ignore all UNROLL directives and do not attempt to unroll other loops)

    1

    Attempt to unroll loops that are marked by the UNROLL directive.

    2

    Attempt to unroll all loops (includes array syntax implied loops), except those marked with the NOUNROLL directive. This is the default.

  • Default: unroll2

vectorn

Specifies the level of automatic vectorizing to be performed. Vectorization results in dramatic performance improvements with a small increase in object code size. Vectorization directives are unaffected by this option.

0

Minimal automatic vectorization. Characteristics include low compile time and small compile size. This option is compatible with all scalar optimization levels. The compiler will still vectorize array syntax in order to allow full source level debugging with reasonable performance. When this option is specified in conjunction with -hfp0 or -hfp1, then array syntax containing associative floating point or complex operations will not be vectorized.

1

Conservative vectorization. The -h vector1 option is compatible with -h scalar1, -h scalar2, and -h scalar3.

2

Moderate vectorization. Loop nests are restructured. The -h vector2 option is compatible with -h scalar2 or -h scalar3.

3

  • Default: 2 Aggressive vectorization.

[no]zeroinc

Cause the compiler to assume that a constant increment variable (CIV) can be incremented by zero. A CIV is a variable that is incremented only by a loop invariant value. For example, in a loop with variable J, the statement J = J + K, where K can be equal to zero, J is a CIV. -O zeroinc can cause less strength reduction to occur in loops that have variable increments.

  • Default: nozeroinc

-o out_file

Override the default executable file name, a.out, with the name specified in the out_file argument.

  • If both the -oout_file and -c options are specified, the link step is disabled and the binary file is written to out_file.

  • If both the -oout_file and -eP (preprocess only) options are specified, the preprocessed source is written to out_file.

-p module_site

Specify where to look for Fortran modules to satisfy USE statements. The module_site argument specifies the name of a file or directory to search for modules. The module_site specified can be a .mod file, .o (object) file, .a (archive) file, or a directory.

-Q path

Specifies the directory to contain all saved nontemporary files from this compilation (for example, all .o and .mod files). Specific file types (such as .o files) are saved to a different directory if the -b, -J, -o, or -eS options are used.

  • By default, this option is disabled and the compiler puts all nontemporary files in the current working directory.

-r list_opt

Produces a listing file. The list_opt arguments are as follows:

  • Note: Argument d does not invoke the ftnlx(1) command. All others do.

a

Includes all reports in the listing (including source, cross references, options, lint, loopmarks, common block, and options used during compilation).

c

Listing includes a COMMON block report (lists all common blocks and members of each block).

d

Decompiles (translates) the intermediate representation of the compiler into listings that resemble the format of the source code. You can use these files to examine the restructuring and optimization changes made by the compiler, which can lead to insights about changes you can make to your Fortran source to improve its performance.

  • The compiler produces two decompilation listing files, with these extensions, per source file specified on the command line: .opt and .cg.

e

Expands included files in the source listing. This option is off by default.

E

Same as -re.

i

Used with the -rm option to intersperse loop optimization messages within the loopmark listing. By default, the messages are placed at the bottom of the program unit.

l

Lists source code and includes lint style checking. The listing includes the COMMON block report (see the -rc option for more information about the COMMON block report).

m

Produces a source listing with loopmark information. To provide a more complete report, this option automatically enables the -O negmsg option to show why loops were not optimized. If you do not require this information, use the -O nonegmsg option on the same command line. Loopmark information will not be displayed if the -d B option has been specified.

o

Show all options used by the compiler during compilation.

s

Lists source code.

T

Retains file.T after processing rather than deleting it. The file.T can be used to call ftnlx directly. For more information, see the ftnlx(1) man page.

x

Produces a cross-reference listing.

-R runchk

Specifies any of a group of runtime checks for your program. To specify more than one type of checking, specify consecutive runchk arguments, as follows: -R bs.

  • runchk can be one or more of the following suboptions:

    a

    Enables argument present check on entry.

    b

    Enables checking of array bounds. Bounds checking is not performed on arrays dimensioned as (1). Enables -Ooverindex.

    c

    Enables conformance checking of array operands in array expressions. Additionally, when -Rc is specified, the RESHAPE intrinsic will call the runtime library instead of executing inline code. This allows for additional semantic checks on the RESHAPE intrinsic.

    d

    Enables a run time check for the !dir$ collapse directive and checks the validity of the loop_info count information.

    p

    Generates run time code to check the association or allocation status of referenced POINTER variables, ALLOCATABLE arrays, or assumed-shape arrays.

    s

    Enables checking of character substring bounds.

  • Lower case checks (abcdps) issue messages and keep going.

  • Upper case checks (ABCDPS) abort on first error.

  • By default, no runtime checks are performed.

-s size

The -ssize option allows you to modify the sizes of variables, literal constants, and intrinsic function results declared as type REAL, INTEGER, LOGICAL, COMPLEX, DOUBLE COMPLEX, or DOUBLE PRECISION. Use one of these for size:

byte_pointer

Applies a byte scaling factor to integers used in pointer arithmetic involving Cray pointers. That is, Cray pointers are moved on byte instead of word boundaries.

default32

Adjusts the data size of default types as follows:

  • 32 bits: REAL, INTEGER, LOGICAL

  • 64 bits: COMPLEX, DOUBLE PRECISION

  • 128 bits: DOUBLE COMPLEX

Note:

The data sizes of integers and logicals that use explicit kind and star values are not affected by this option. However, they are affected by the -e h option.

default64

Adjust the data size of default types as follows:

  • 64 bits: REAL, INTEGER, LOGICAL

  • 64 bits: DOUBLE PRECISION (implied -dp)

  • 128 bits: COMPLEX

  • 128 bits: DOUBLE COMPLEX (implied -dp)

  • If you used the -s default64 at compile time, you must also specify this option when invoking the ftn command for linking.

Note:

The data sizes of integers and logicals that use explicit kind and star values are not affected by this option. However, they are affected by the -eh option.

integer32

Adjusts the default data size of default integers and logicals to 32 bits.

integer64

Adjusts the default data size of default integers and logicals to 64 bits.

real32

Adjusts the default data size of default real types as follows:

  • 32 bits: REAL

  • 64 bits: DOUBLE PRECISION

  • 64 bits: COMPLEX

  • 128 bits: DOUBLE COMPLEX

real64

Adjusts the default data size of default real types as follows:

  • 64 bits: REAL

  • 64 bits: DOUBLE PRECISION (implied -dp)

  • 128 bits: COMPLEX

  • 128 bits: DOUBLE COMPLEX (implied -dp)

word_pointer

Applies a word scaling factor to integers used in pointer arithmetic involving Cray pointers. That is, Cray pointers are moved on word instead of byte boundaries.

  • The default data size options (for example, -s default64) do not affect the size of data that explicitly declare the size of the data (for example, REAL(KIND=4) X).

  • REAL(KIND=16) and COMPLEX(KIND=16) support 128-bit floating point and 256-bit complex types, sometimes referred to as quad-precision.

-S

Generates assembly language output and saves it in file.s. Has the same effect as -eS.

  • By default, this option is off.

-T

Disables the compiler but displays all options currently in effect.

  • By default, this option is off.

-U identifier[,identifier] …

The -Uidentifier [,identifier] … option undefines variables used for source preprocessing. This option removes the initial definition of a predefined macro or sets a user predefined macro to an undefined state.

  • The -Didentifier [=value] option defines variables used for source preprocessing. If both -D and -U are used for the same identifier, in any order, the identifier is undefined.

  • This option is ignored unless one of the following conditions is true:

  • The Fortran input source file is specified as either file.extension, where extension is one of the following: .F, .FOR, .F90, .F95, .F03, .F08, .F18, or .FTN.

  • The -e P or -e Z options have been specified.

-v

Prints information about each compilation phase to the standard error file (stderr). The information contains what the compiler, lister, and linker is doing and what it is calling.

  • By default, this option is off.

-V

Directs each compilation phase to send a message containing version information to the standard error file (stderr). Unlike all other command line options, you can specify this option without specifying an input file name; that is, specifying ftn -V is valid.

  • By default, this option is off.

–version

Directs each compilation phase to send a message containing version information to the stdout. Unlike most other command line options, you can specify this option without specifying an input file name; that is, specifying ftn –version is valid. Note that -version is incorrect. It must be –version.

  • By default, this option is off.

-W phase,”opt…

Passes arguments directly to a phase of the compiling system.

  • The values of phase are:

------------------------------------------------------
phase            System Phase          Command
------------------------------------------------------
0 (zero)         Compiler              ftn
a                Assembler             as
c                Linker                arg
l                Linker                ld
r                Lister                ftnlx
x                Assembler             arg
------------------------------------------------------
  • Arguments to be passed to system phases can be entered in either of two styles. If spaces appear within a string to be passed, the string is enclosed in double quotes. When double quotes are not used, spaces cannot appear in the string. Commas can appear wherever spaces normally appear; an option and its argument can be either separated by a comma or not separated. If a comma is part of an argument, it must be preceded by the \ character. For example, any of the following command lines would send -e name to the linker:

    % ftn -Wl,”-e name” file.F08

    % ftn -Wl,-e,name file.F08

    % ftn -Wl,”-ename” file.F08

    • -Wa,”assembler_opt passes the assembler_opt option directly to the as command, directing it to enable all pseudos, regardless of location field name. This option is meaningful to the system only when file.s is specified as an input file on the command line. For more information about assembler options, see the as(1) man page.

    • The -Wr,”lister_opt option passes lister_opt directly to the ftnlx command. For example, specifying -Wr,”-o cfile.o” passes the argument cfile.o directly to the ftnlx command’s -o option; this directs ftnlx to override the default output listing and put the output file in cfile.o. If specifying the -Wr,”lister_opt option, specify the -hlist_opt option in addition to the -Wr. For more information about options, see the ftnlx man page.

    • The -Wl,-rpathldir option changes the run time library search algorithm to look for files in directory ldir. To request more than one library directory, specify multiple -rpath options. Note that a library may be found at link time with an -L option, but may not be found at run time if a corresponding -rpath option was not supplied on the link line. Also note that the compiler driver does not pass the -rpath option to the linker. You must explicitly specify -Wl when using this option.

    • At link time, all ldir arguments are added to the executable. The dynamic linker will search these paths first for shared dynamic libraries at run time, with one exception. The Linux environment variable LD_LIBRARY_PATH precedes all other search paths for shared dynamically linked libraries. The use of LD_LIBRARY_PATH is discouraged.

    • -Wx,”arg passes command line arguments to the PTX assembler for OpenACC applications.

    • -Wc,”arg passes command line arguments to the CUDA linker for OpenACC applications.

    Caution:

    • Caution should be used when setting LD_LIBRARY_PATH. Doing so will change the shared dynamically linked library search paths for all executable files in your environment.

-x dirlist

Disables specified directives or specified classes of directives. If specifying a multiword directive, either enclose the directive name in quotation marks or remove the spaces between the words in the directive’s name. dirlistcan be one of the following options:

acc

All OpenACC API directives.

all

All compiler and OpenMP Fortran API directives.

dec

All !DEC$ directives.

dir

All !DIR$ directives.

directive

One or more compiler directives. If specifying more than one, separate them with commas, as follows: -x INLINEALWAYS,”NO SIDE EFFECTS”,BOUNDS.

gcc

All gcc directives.

intel

All Intel directives.

ocl

All Fujitsu directives.

pgi

All PGI directives.

omp

All OpenMP Fortran API directives.

conditional_omp

All C$ and !$ conditional compilation lines.

  • By default, no directives or specified classes of directives are disabled.

-Y phase,dirname

Specifies a new directory (dirname) from which the designated phase should be executed. phase can be one or more of the following values:

---------------------------------------------
phase         System Phase       Command
---------------------------------------------
0             Compiler           ftn
a             Assembler          as
---------------------------------------------

Signifies the end of options. After this symbol, specify the files to be processed.

sourcefile [sourcefile …]

Fortran source files to be processed. Possible suffixes of sourcefile indicate the following:

-----------------------------------------------------------
suffix            Format, Processing
-----------------------------------------------------------
.f, .for          Fixed-format source, compile
.F, .FOR          Fixed-format source, preprocess, compile
.f90, .f95, .f03, Free-format source, compile
.f08, .f18, .ftn
.F90, .F95, .F03, Free-format source, preprocess, compile
.F08, .F18, .FTN
.o                object file, link
.a                assembler source, assemble
-----------------------------------------------------------
Note:

The source form specified on the -fsource_form option overrides the source form implied by the file suffixes.

If only one source file is specified on the command line, the .o file is created and deleted. To retain the .o file, use the -c option to disable the linker. You can specify object files produced by the Cray Fortran, C, C++, or assembler compilers. Object files are passed to the linker in the order in which they appear on the ftn command line. If the linker is disabled by the -b or -c option, no files are passed to the linker.

The source filename and path lengths are limited depending on system. On Linux, the filename must be shorter than 250 characters. The path length can be up to 4096 characters. If the source file is a symlink, the symlinks must not exceed 40 levels.

ENVIRONMENT VARIABLES

The Cray Fortran Compiler recognizes these compile-time environment variables (for OpenMP environment variables, see Cray Fortran Reference Manual):

CRAY_CPU_TARGET

Specifies the target CPU on which the absolute binary file is to be executed. The valid values are: ivybridge, sandybridge, haswell, broadwell, mic-knl, x86-skylake, x86-cascadelake, x86-naples, or arm-thunderx2. This environment variable can be overidden by the -h cpu= command line argument.

CRAY_FTN_OPTIONS

Specifies additional options to attach to the command line.

CRAYPE_LINK_TYPE

Specifies the default linking behavior. The valid values are: dynamic, shared, or static. The default value is dynamic.

FORMAT_TYPE_CHECKING

Specifies various levels of conformance between the data type of each I/O list item and the formatted data edit descriptor.

  • When set to RELAXED, the run-time I/O library enforces limited conformance between the data type of each I/O list item and the formatted data edit descriptor.

  • When set to STRICT77, the run-time I/O library enforces strict FORTRAN 77 conformance between the data type of each I/O list item and the formatted data edit descriptor.

  • When set to STRICT90 or STRICT95, the run-time I/O library enforces strict Fortran 90/95 conformance between the data type of each I/O list item and the formatted data edit descriptor.

FORTRAN_MODULE_PATH

As with the ftn -p module_site command line option, this environment variable enables you to specify the files or directory to search for the modules to use. The files specified can be a .mod file, .o (object) file, .a (archive) file, or a directory. The compiler appends the contents specified by the FORTRAN_MODULE_PATH environment variable to anything specified with the -p module_site command option.

  • Since the FORTRAN_MODULE_PATH environment variable can specify multiple files and directories, a colon separates each path as shown in the following example:

% set FORTRAN_MODULE_PATH='path1 : path2 : path3'
LISTIO_PRECISION

The LISTIO_PRECISION environment variable controls the number of digits of precision printed by list-directed output. The LISTIO_PRECISION environment variable can be set to FULL or PRECISION.

  • FULL prints full precision (default).

  • PRECISION prints x or x + 1 decimal digits, where x is value of the PRECISION intrinsic function for a given real value. This is a smaller number of digits, which usually ensures that the last decimal digit is accurate to within 1 unit. This number of digits is usually insufficient to assure that subsequent input will restore a bit-identical floating point value.

NLSPATH

Specifies the message system library catalog path. This environment variable affects compiler interactions with the message system. For more information on this environment variable, see the catopen(3c) man page.

NPROC

Specifies the maximum number of processes to be run. Setting NPROC to a number other than 1 can speed up a compilation if machine resources permit.

  • The effect of NPROC is seen at compilation time, not at execution time. NPROC requests a number of compilations to be done in parallel. It affects all the compilers and also make.

  • For example, assume that NPROC is set as follows:

setenv NPROC 2
  • The following command is entered:

ftn -o t main.f sub.f
  • In this example, the compilations from .f files to .o files for main.f and sub.f happen in parallel, and when both are done, the load step is performed. If NPROC is unset, or set to 1, main.f is compiled to main.o; sub.f is compiled to sub.o, and then the link step is performed.

  • You can set NPROC to any value, but large values can overload the system. For debugging purposes, NPROC should be set to 1. By default, NPROC is 1.

TMPDIR

Compiler temporary files are placed in the directory specified by TMPDIR.

  • On an OPEN statement, if STATUS=SCRATCH is specified, the file is placed in the directory specified by the TMPDIR. If TMPDIR is not set, or the file cannot be created in the specified directory for some other reason, the file is placed in the /tmp directory. If /tmp does not exist, or cannot be accessed, the program aborts.

ZERO_WIDTH_PRECISION

The ZERO_WIDTH_PRECISION environment variable controls the field width when field width w of Fw.d is zero on output. The ZERO_WIDTH_PRECISION environment variable can be set to PRECISION or HALF.

  • PRECISION specifies that full precision will be written. This is the default.

  • HALF specifies that half of the full precision will be written.

Cray Fortran Compiler recognizes these run time environment variables (for other run time environment variables, see Cray Fortran Reference Manual):

CRAY_ACC_DEBUG

Write accelerator-related activity to stderr for debugging purposes. Valid output levels range from 0, which indicates no output, through 3, which indicates verbose. Default is 0

CRAY_MALLOPT_OFF

If set, then the system default mallopt parameters are used, instead of the compiler default parameters. For most programs, run time performance is improved by using the compiler defaults, but more memory may be used.

CRAY_RANK_THREAD_PREFIX

Prepend a string identifying mpi rank and omp thread id to each line written to stdout and stderr.

CRAYLIBS_ARCH_OVERRIDE

Override the default Cray math library run time selection and specify the library to use by CPU architecture. The valid options are: ivybridge, sandybridge, haswell, broadwell, mic-knl, x86-skylake, x86-cascadelake, x86-naples, or arm-thunderx2.

  • This run time environment variable can be used to specify that a lowest-common-denominator math library be used instead of the default selection, thus ensuring that identical computations produce identical results regardless of the type of compute node CPU actually used. The trade-off is that specifying on older library may affect performance on a newer CPU. For example, if ivybridge is specified, the code will run and produce identical results on a haswell compute node, but performance may be reduced.

  • Default: If not set, the library specific to the type of CPU selected at run time is used.

MALLOC_MMAP_MAX_

Specifies the maximum number of memory chunks to allocate with mmap. The compiler default value is 0. For most programs, run time performance is improved by using the compiler default, but more memory may be used.

MALLOC_TRIM_THRESHOLD_

Specifies the minimum size of the unused memory region at the top of the heap before the region is returned to the operating system. The compiler default value is 536870912 bytes. For most programs, run time performance is improved by using the compiler default, but more memory may be used.

NO_STOP_MESSAGE

If set, and if the STOP [stop_code] statement does not specify the optional stop_code, then STOP messages are not produced when this statement is executed.

PGAS_ERROR_FILE

Specifies the location to which libpgas (the library which provides an interface to the internal system network) error messages are written. The default is stderr. If stdout is specified, errors will be written to standard output.

FILES

Files containing Fortran source code have names with one of the following extensions: .f, .F, .for, .FOR, .f90, .F90, .f95, .F95, .f03, .F03, .f08, .F08, .f18, .F18, .ftn, or .FTN. See sourcefile. By default, several files are created during processing. The Cray Fortran Compiler adds a suffix to the file portion of the file name and places the files it creates into your working directory.

The loader produces an executable file (by default a.out). See the -o out_file option for information about specifying a different file name for the executable. If only one source file is specified on the command line, the .o file is created and deleted. To retain the .o file, use the -c option.

The following files may be produced by the compiler:

a.out

Default name of the executable output file.

file.a

Library file to be searched for external references.

file.i

File containing output from the source preprocessor.

file.lst

Listing file.

file.o

Relocatable object file.

file.s

Assembly language file.

modulename.mod

If the -em option is specified, the compiler writes a MODULENAME.mod file for each module; MODULENAME is created by taking the name of the module and, if necessary, converting it to uppercase. This file contains module information, including any contained procedures.

  • If -ef is specified, the compiler writes modulename.mod for each module, rather than MODULENAME.mod.

SEE ALSO

as(1), ftnlx(1), explain(1), intro_directives(7), intro_openacc(7), intro_openmp(7), make(1)