You copied the Doc URL to your clipboard.

armflang for pgfortran Developers

The reference versions used in this guide are:

  • PGI Fortran Compiler 18.5

  • Arm Fortran Compiler 19.1

Invoking the compiler

The following table gives the equivalent PGI and Arm Compiler commands to invoke the Fortran compiler for preprocessing, compilation, assembly and linking.

Invoking the compiler

PGI

Arm

pgfortran <options> <filename>

armflang <options> <filename>

The following table gives the equivalent PGI and Arm Compiler commands to access compiler details and documentation.

Accessing version information and documentation

PGI

Arm

Version details

pgfortran --version

armflang --version

Help and documentation

pgfortran --help

man pgFortran

armflang --help

man armflang

Commonly used flags

The following table summarizes some of the compiler options most commonly used with the PGI Fortran compiler and gives the equivalent options to use with the Arm Fortran Compiler:

PGI and Arm Compiler equivalent options

PGI

Arm

Description

-c

-c

Run only preprocess, compile and assemble steps.

-o filename

-o filename

Write to output filename.

-g

-g

Generate source level debug information.

-Minform=inform

-w

-silent

-Minform=severe

-Wall

-w

Enable all warnings.

Suppress all warnings.

-Mpreprocess

-cpp

-nocpp

Preprocess Fortran source files.

Do not preprocess Fortran source files.

Note

By default, source files with the extensions, .F, .F90, .F95, .F03 and .F08 are preprocessed. -cpp forces the compiler to use the processor for all source files.

-mp

-fopenmp

Enable OpenMP.

See OpenMP support for Arm Fortran Compiler.

-module path

-module path

Specifies a directory to place and search for module files.

-On

-On

Level of optimization to use, where n=0,1,2,3.

See Optimization with the Arm Fortran Compiler.

-Mallocatable=03

-Mallocatable=95

-frealloc-lhs

-fno-realloc-lhs

-frealloc-lhs uses Fortran 2003 standard semantics for assignments to allocatables. An allocatable object on the left-hand side of an assignment is (re)allocated to match the dimensions of the right-hand side.

-fno-realloc-lhs uses pre-Fortran 2003 standard semantics for assignments to allocatables. The left-hand side of an allocatable assignment is assumed to be allocated with the correct dimensions. Incorrect behavior can occur if the left-hand side is not allocated with the correct dimensions.

Note

  • Default behavior in armflang versions 19.0+ supports the Fortran 2003 standard feature: (re)allocation on assignment. By default, earlier versions of armflang do not support this feature.

  • In version 19.0 of armflang, -Mallocatable=03 and -Mallocatable=95 are supported instead of -frealloc-lhs and -fno-realloc-lhs, respectively. The -Mallocatable option continues to be supported in the armflang, but from versions 19.1+ the documentation refers to the -frealloc-lhs and -fno-realloc-lhs nomenclature.

-byteswapio

-fconvert=big-endian

-fconvert=little-endian

-fconvert=native

-fconvert=swap

Swap the byte ordering for unformatted file access of numeric data to big endian from little endian, or the other way round.

armflang also provides options to set the byte order explicitly to big endian, little endian, or native.

Note

Default behavior is native.

-Dmacro=value

-Dmacro=value

Set macro to value.

-Ldirectory

-Ldirectory

Add directory to the include search path.

-llib

-llib

Search for the library lib when linking.

-r8

-r8

Set the default KIND for real and complex declarations, constants, functions, and intrinsics to 64bit (such as real (KIND=8)).

Unspecified real kinds are evaluated as KIND=8.

-i8

-i8

Set the default kind for INTEGER and LOGICAL to 64bit (KIND=8).

-fpic

-fPIC

-fpic

-fPIC

Generate position independent code.

With both armflang and pgf90, -fpic and -fPIC are equivalent.

For more information on the use of -fpic and -fPIC on AArch64, see Note about building Position Independent Code PIC on AArch64.

Optimization compiler options

The following table summarizes some of the most commonly used compiler options provided by the PGI and Arm Fortran Compiler:

Commonly used optimization options

Description

Syntax

Notes

Basic optimization switches

-On

Optimization level where n=0,1,2,3. There is no direct correlation between the optimizations employed at each level between the two compilers.

At n=0, the compiler performs little or no optimization.

At n=3, the compiler performs aggressive optimization.

At n=2 and n=3, debug information might not be satisfactory because the mapping of object code to source code is not always clear and the compiler can perform optimizations that cannot be described in the debug information.

Aggressive optimization

-Ofast

Enables all -O3 optimizations from level 3 and performs aggressive optimization, which can violate strict language compliance.

With armflang, this is equivalent to:

  • Setting: -O3 -Menable-no-infs

    -Menable-no-nans

    -Menable-unsafe-fp-math

    -fno-signed-zeros -freciprocal-math

    -fno-trapping-math -ffp-contract=fast

    -ffast-math -ffinite-math-only

    -fstack-arrays

  • Unsetting: -fmath-errno

Fused floating-point operations

-ffp-contract=fast/off

Instructs armflang to perform fused floating-point operations, such as fused multiply adds.

  • fast = always on (default for -O1 and above)

  • off = never

Reduced floating-point precision

-ffast-math

-funsafe-math-optimizations

Allows aggressive, lossy, floating-point optimizations.

Allows reciprocal optimizations and does not honor trapping or signed zero.

Finite maths

-finite-maths-only

Enable optimizations that ignore the possibility of NaNs and Infs.

Was this page helpful? Yes No