diff options
author | Michael Hirsch, Ph.D <scivision@users.noreply.github.com> | 2019-01-16 12:26:47 -0500 |
---|---|---|
committer | Michael Hirsch, Ph.D <scivision@users.noreply.github.com> | 2019-01-16 17:06:43 -0500 |
commit | b40c1af900df5e199fab63c1486f7d17b46386b4 (patch) | |
tree | 4ae2836126a2ec4239c8d34cbb56ad84d1b10f00 | |
parent | 2ba2c7771fc27a086d3b73bbb25462eff300c2a2 (diff) | |
download | meson-b40c1af900df5e199fab63c1486f7d17b46386b4.zip meson-b40c1af900df5e199fab63c1486f7d17b46386b4.tar.gz meson-b40c1af900df5e199fab63c1486f7d17b46386b4.tar.bz2 |
Flang Fortran compiler added.
-rw-r--r-- | docs/markdown/Reference-tables.md | 1 | ||||
-rw-r--r-- | mesonbuild/compilers/__init__.py | 2 | ||||
-rw-r--r-- | mesonbuild/compilers/compilers.py | 23 | ||||
-rw-r--r-- | mesonbuild/compilers/fortran.py | 7 | ||||
-rw-r--r-- | mesonbuild/environment.py | 4 |
5 files changed, 37 insertions, 0 deletions
diff --git a/docs/markdown/Reference-tables.md b/docs/markdown/Reference-tables.md index 9688bf8..a6289df 100644 --- a/docs/markdown/Reference-tables.md +++ b/docs/markdown/Reference-tables.md @@ -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 | diff --git a/mesonbuild/compilers/__init__.py b/mesonbuild/compilers/__init__.py index b5b2475..b4807c6 100644 --- a/mesonbuild/compilers/__init__.py +++ b/mesonbuild/compilers/__init__.py @@ -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, diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 34c0e3b..1e86978 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -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. diff --git a/mesonbuild/compilers/fortran.py b/mesonbuild/compilers/fortran.py index 2eb4c71..911df46 100644 --- a/mesonbuild/compilers/fortran.py +++ b/mesonbuild/compilers/fortran.py @@ -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) diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index 0e74851..4f5115f 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -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) |