Flang command line argument reference


-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


Print version information

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

Treat subsequent input files as having type <language>


The action to perform on the input.

-E, --preprocess

Only run the preprocessor

-S, --assemble

Only run preprocess and compilation steps

-c, --compile

Only run preprocess, compile, and assemble steps


Use the LLVM representation for assembler and object files


Run the preprocessor, parser and semantic analysis stages

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<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>, --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>, --extra-warnings, --warn-<arg>, --warn-=<arg>

Enable the specified warning

Target-independent compilation options


Enable predefined and command line preprocessor macros


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


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


Set the default integer kind to an 8 byte wide type


Set the default real kind to an 8 byte wide type


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


Process source files in free form

-fimplicit-none, -fno-implicit-none

No implicit typing allowed unless overridden by IMPLICIT statements


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.

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

-flogical-abbreviations, -fno-logical-abbreviations

Enable logical abbreviations


Enable OpenACC

-fopenmp, -fno-openmp

Parse OpenMP pragmas and generate parallel code.

-fxor-operator, -fno-xor-operator

Enable .XOR. as a synonym of .NEQV.


Disable predefined and command line preprocessor macros

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

Warn on language extensions