Flang command line argument reference

Introduction

-flang-experimental-exec

Enable support for generating executables (experimental)

-help, --help, /?, -?, /HELP, -HELP, /help, -help, /help<arg>, -help<arg>, --help<arg>

Display available options

-mllvm <arg>

Additional arguments to forward to LLVM’s option processing

-mmlir <arg>

Additional arguments to forward to MLIR’s option processing

-module-dir<dir>, -J<arg>

This option specifies where to put .mod files for compiled modules. It is also added to the list of directories to be searched by an USE statement. The default is the current directory.

-o<file>, /Fo<arg>, -Fo<arg>, --output <arg>, --output=<arg>

Write output to <file>

-print-effective-triple, --print-effective-triple

Print the effective target triple

-print-target-triple, --print-target-triple

Print the normalized target triple

-save-temps=<arg>, --save-temps=<arg>, -save-temps (equivalent to -save-temps=cwd), --save-temps (equivalent to -save-temps=cwd)

Save intermediate compilation results.

--target=<arg>, -target <arg>

Generate code for the given target

--version

Print version information

-x<language>, --language <arg>, --language=<arg>

Treat subsequent input files as having type <language>

Actions

The action to perform on the input.

-E, /E, -E, --preprocess

Only run the preprocessor

-S, --assemble

Only run preprocess and compilation steps

-c, /c, -c, --compile

Only run preprocess, compile, and assemble steps

-emit-llvm

Use the LLVM representation for assembler and object files

Compilation flags

Flags controlling the behavior of Clang during compilation. These flags have no effect during actions that do not perform compilation.

-Xflang <arg>

Pass <arg> to the flang compiler

-std=<arg>, --std=<arg>, --std <arg>

Language standard to compile for

Preprocessor flags

Flags controlling the behavior of the Clang preprocessor.

-D<macro>=<value>, /D<macro[=value]>, -D<macro[=value]>, --D<arg>, /D<arg>, -D<arg>, --define-macro <arg>, --define-macro=<arg>

Define <macro> to <value> (or 1 if <value> omitted)

-P, --no-line-commands

Disable linemarker output in -E mode

-U<macro>, /U<macro>, -U<macro>, --undefine-macro <arg>, --undefine-macro=<arg>

Undefine macro <macro>

Include path management

Flags controlling how #includes are resolved to files.

-I<dir>, /I<dir>, -I<dir>, --include-directory <arg>, --include-directory=<arg>

Add directory to include search path. For C++ inputs, if there are multiple -I options, these directories are searched in the order they are given before the standard system directories are searched. If the same directory is in the SYSTEM include search paths, for example if also specified with -isystem, the -I option will be ignored

Diagnostic flags

Flags controlling which warnings, errors, and remarks Clang will generate. See the full list of warning and remark flags.

-W<warning>, /WX (equivalent to -Werror), -WX (equivalent to -Werror), /WX- (equivalent to -Wno-error), -WX- (equivalent to -Wno-error), /Wall (equivalent to -Weverything), -Wall (equivalent to -Weverything), /Zc:strictStrings (equivalent to -Werror=c++11-compat-deprecated-writable-strings), -Zc:strictStrings (equivalent to -Werror=c++11-compat-deprecated-writable-strings), --extra-warnings, /validate-charset (equivalent to -Winvalid-source-encoding), -validate-charset (equivalent to -Winvalid-source-encoding), /validate-charset- (equivalent to -Wno-invalid-source-encoding), -validate-charset- (equivalent to -Wno-invalid-source-encoding), --warn-<arg>, --warn-=<arg>

Enable the specified warning

Target-independent compilation options

-cpp

Enable predefined and command line preprocessor macros

-falternative-parameter-statement

Enable the old style PARAMETER statement

-fbackslash, -fno-backslash

Specify that backslash in string introduces an escape character

-fcolor-diagnostics, -fdiagnostics-color, -fno-color-diagnostics

Enable colors in diagnostics

-fdefault-double-8

Set the default double precision kind to an 8 byte wide type

-fdefault-integer-8

Set the default integer kind to an 8 byte wide type

-fdefault-real-8

Set the default real kind to an 8 byte wide type

-ffixed-form

Process source files in fixed form

-ffixed-line-length=<arg>, -ffixed-line-length-<arg>

Set column after which characters are ignored in typical fixed-form lines in the source file

-ffree-form

Process source files in free form

-fimplicit-none, -fno-implicit-none

No implicit typing allowed unless overridden by IMPLICIT statements

-finput-charset=<arg>, /source-charset:<arg>, -source-charset:<arg>

Specify the default character set for source files

-fintrinsic-modules-path <dir>
This option specifies the location of pre-compiled intrinsic modules,

if they are not in the default location expected by the compiler.

-flarge-sizes

Use INTEGER(KIND=8) for the result type in size-related intrinsics

-flogical-abbreviations, -fno-logical-abbreviations

Enable logical abbreviations

-fopenacc

Enable OpenACC

-fopenmp, -fno-openmp, /openmp, -openmp, /openmp:experimental, -openmp:experimental

Parse OpenMP pragmas and generate parallel code.

-fxor-operator, -fno-xor-operator

Enable .XOR. as a synonym of .NEQV.

-nocpp

Disable predefined and command line preprocessor macros

-pedantic, --pedantic, -no-pedantic, --no-pedantic

Warn on language extensions