Commit 4371af27 authored by Tin Huynh's avatar Tin Huynh Committed by Brad King
Browse files

LLVMFlang: Add support for LLVM Flang

LLVM Flang ( is an LLVM
Fortran compiler that shares the same name as Flang (also known as Classic
Flang). Classic Flang is in active development and is already identified by
CMake as Flang. As such, LLVM Flang will be identified as `LLVMFlang`.

Fixes: #22387
parent 1c126941
* LLVM's `flang`_ Fortran compiler is now supported, with compiler id ``LLVMFlang``.
.. _`flang`:
......@@ -18,7 +18,8 @@ include:
Clang = LLVM Clang (
Cray = Cray Compiler (
Embarcadero, Borland = Embarcadero (
Flang = Flang LLVM Fortran Compiler
Flang = Classic Flang Fortran Compiler (
LLVMFlang = LLVM Flang Fortran Compiler (
Fujitsu = Fujitsu HPC compiler (Trad mode)
FujitsuClang = Fujitsu HPC compiler (Clang mode)
G95 = G95 Fortran (
......@@ -89,6 +89,7 @@ else()
set(_Fortran_COMPILER_NAMES_Absoft af95 af90 af77)
set(_Fortran_COMPILER_NAMES_PGI pgf95 pgfortran pgf90 pgf77)
set(_Fortran_COMPILER_NAMES_Flang flang)
set(_Fortran_COMPILER_NAMES_LLVMFlang flang)
set(_Fortran_COMPILER_NAMES_PathScale pathf2003 pathf95 pathf90)
set(_Fortran_COMPILER_NAMES_XL xlf)
set(_Fortran_COMPILER_NAMES_VisualAge xlf95 xlf90 xlf)
......@@ -147,6 +147,13 @@
# if defined(__FLANG_PATCHLEVEL__)
# endif
#elif defined(__flang__)
PRINT *, 'INFO:compiler[LLVMFlang]'
# define COMPILER_VERSION_MAJOR DEC(__flang_major__)
# define COMPILER_VERSION_MINOR DEC(__flang_minor__)
# if defined(__flang_patchlevel__)
# define COMPILER_VERSION_PATCH DEC(__flang_patchlevel__)
# endif
#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
PRINT *, 'INFO:compiler[VisualAge]'
#elif defined(__hpux) || defined(__hpux__)
set(CMAKE_Fortran_SUBMODULE_SEP "-")
set(CMAKE_Fortran_SUBMODULE_EXT ".mod")
set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-ffixed-form")
set(CMAKE_Fortran_FORMAT_FREE_FLAG "-ffree-form")
set(CMAKE_Fortran_MODDIR_FLAG "-module-dir")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment