Use the following commands to get a list of compiler options.
$flang -help
$flang --help-hidden
The Flang compiler supports all Clang 17.0.1 Compiler Options and the following Flang-specific compiler options.
-
-KieeeEnabled by default from AOCC 2.2.0, it instructs the compiler to conform to the IEEE-754 specifications. The compiler will perform floating-point operations in strict conformance with the IEEE 754 standard. Some optimizations are disabled when this option is specified.
-
-no-flang-libsDo not link against Flang libraries.
-
-mpEnable OpenMP and link with OpenMP library libomp.
-
-nompDo not link with OpenMP library libomp.
-
-MbackslashTreat backslash in quoted strings as any other character.
-
-MnobackslashTreat backslash in quoted strings as a C-style escape character (default).
-
-MbyteswapioSwap byte-order from big-endian to little-endian or vice-versa for unformatted input/output.
-
-MfixedAssume fixed-format source.
-
-MextendAllow source lines up to 132 characters.
-
-MfreeformAssume free-format source.
-
-MpreprocessRun preprocessor for Fortran files.
-
-MstandardCheck standard conformance.
-
-MsaveAssume all variables have SAVE attribute.
-
-modulePath to module file (-I also works).
-
-Mallocatable=95Select Fortran 95 semantics for assignments to allocatable objects (default).
-
-Mallocatable=03Select Fortran 03 semantics for assignments to allocatable objects.
-
-static-flang-libsLink using static Flang libraries.
-
-M[no]dazTreat denormalized numbers as zero.
-
-M[no]flushzSet SSE to flush-to-zero mode.
-
-Mcache_alignAlign large objects on cache-line boundaries.
-
-M[no]fprelaxedThis option is ignored.
-
-fdefault-integer-8Treat INTEGER and LOGICAL as INTEGER*8 and LOGICAL*8.
-
-fdefault-real-8Treat REAL as REAL*8.
-
-i8Treat INTEGER and LOGICAL as INTEGER*8 and LOGICAL*8.
-
-r8Treat REAL as REAL*8.
-
-fno-fortran-mainDo not link in Fortran main.
-
-MrecursiveAllocate local variables on the stack thus allowing recursion. Saved, data-initialized, or namelist members are always allocated statically regardless of the setting of this switch.
-
-fdo-concurrent-to-openmp=<host, none>Enables/disables parallelization support for
Do Concurrentloops by mapping existingDo Concurrentloop to OpenMP constructs. Currently,hostandnoneoptions are supported. Thehostoption enables parallelization support while thenoneoption disables it.Usage
-fopenmp -fdo-concurrent-to-openmp=host-fopenmp -fdo-concurrent-to-openmp=noneExample
test.f90:
program do_concurrent_reduction implicit none integer :: i real :: arr(1000), sum_val arr = [(real(i), i = 1, 1000)] sum_val = 0.0 do concurrent (i = 1:1000) reduce(+:sum_val) sum_val = sum_val + arr(i) end do print *, sum_val end program do_concurrent_reductionflang -fopenmp -fdo-concurrent-to-openmp=host test.f90