Flang Fortran compiler added.

pull/4792/head
Michael Hirsch, Ph.D 6 years ago
parent 2ba2c7771f
commit b40c1af900
No known key found for this signature in database
GPG Key ID: 6D23CDADAB0294F9
  1. 1
      docs/markdown/Reference-tables.md
  2. 2
      mesonbuild/compilers/__init__.py
  3. 23
      mesonbuild/compilers/compilers.py
  4. 7
      mesonbuild/compilers/fortran.py
  5. 4
      mesonbuild/environment.py

@ -13,6 +13,7 @@ These are return values of the `get_id` (Compiler family) and
| clang | The Clang compiler | gcc |
| clang-cl | The Clang compiler (MSVC compatible driver) | msvc |
| dmd | D lang reference compiler | |
| flang | Flang Fortran compiler | |
| g95 | The G95 Fortran compiler | |
| gcc | The GNU Compiler Collection | gcc |
| intel | Intel compiler | msvc on windows, otherwise gcc |

@ -62,6 +62,7 @@ __all__ = [
'GnuDCompiler',
'GnuFortranCompiler',
'ElbrusFortranCompiler',
'FlangFortranCompiler',
'GnuObjCCompiler',
'GnuObjCPPCompiler',
'IntelCompiler',
@ -153,6 +154,7 @@ from .fortran import (
G95FortranCompiler,
GnuFortranCompiler,
ElbrusFortranCompiler,
FlangFortranCompiler,
IntelFortranCompiler,
NAGFortranCompiler,
Open64FortranCompiler,

@ -1311,6 +1311,8 @@ class CompilerType(enum.Enum):
PGI_STANDARD = 50
FLANG_STANDARD = 60
@property
def is_standard_compiler(self):
return self.name in ('GCC_STANDARD', 'CLANG_STANDARD', 'ICC_STANDARD')
@ -1619,6 +1621,27 @@ class PGICompiler:
def openmp_flags(self):
return ['-fopenmp']
class FlangCompiler:
def __init__(self, compiler_type):
self.id = 'flang'
self.compiler_type = compiler_type
default_warn_args = ['-Minform=inform']
self.warn_args = {'1': default_warn_args,
'2': default_warn_args,
'3': default_warn_args}
def get_module_incdir_args(self):
return ('-module', )
def get_no_warn_args(self):
return ['-silent']
def openmp_flags(self):
return ['-fopenmp']
class ElbrusCompiler(GnuCompiler):
# Elbrus compiler is nearly like GCC, but does not support
# PCH, LTO, sanitizers and color output as of version 1.21.x.

@ -22,6 +22,7 @@ from .compilers import (
clike_debug_args,
Compiler,
GnuCompiler,
FlangCompiler,
ElbrusCompiler,
IntelCompiler,
PGICompiler
@ -382,6 +383,12 @@ class PGIFortranCompiler(FortranCompiler):
return val
class FlangFortranCompiler(FortranCompiler):
def __init__(self, exelist, version, is_cross, exe_wrapper=None, **kwags):
FortranCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwags)
FlangCompiler.__init__(self, CompilerType.FLANG_STANDARD)
class Open64FortranCompiler(FortranCompiler):
def __init__(self, exelist, version, is_cross, exe_wrapper=None, **kwags):
FortranCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwags)

@ -44,6 +44,7 @@ from .compilers import (
ClangObjCPPCompiler,
ClangClCCompiler,
ClangClCPPCompiler,
FlangFortranCompiler,
G95FortranCompiler,
GnuCCompiler,
GnuCPPCompiler,
@ -782,6 +783,9 @@ class Environment:
if 'PGI Compilers' in out:
return PGIFortranCompiler(compiler, version, is_cross, exe_wrap, full_version=full_version)
if 'flang' in out or 'clang' in out:
return FlangFortranCompiler(compiler, version, is_cross, exe_wrap, full_version=full_version)
if 'Open64 Compiler Suite' in err:
return Open64FortranCompiler(compiler, version, is_cross, exe_wrap, full_version=full_version)

Loading…
Cancel
Save