Merge pull request #4792 from scivision/flang
Flang Fortran compiler added.
This commit is contained in:
commit
57424e9403
|
@ -13,6 +13,7 @@ These are return values of the `get_id` (Compiler family) and
|
||||||
| clang | The Clang compiler | gcc |
|
| clang | The Clang compiler | gcc |
|
||||||
| clang-cl | The Clang compiler (MSVC compatible driver) | msvc |
|
| clang-cl | The Clang compiler (MSVC compatible driver) | msvc |
|
||||||
| dmd | D lang reference compiler | |
|
| dmd | D lang reference compiler | |
|
||||||
|
| flang | Flang Fortran compiler | |
|
||||||
| g95 | The G95 Fortran compiler | |
|
| g95 | The G95 Fortran compiler | |
|
||||||
| gcc | The GNU Compiler Collection | gcc |
|
| gcc | The GNU Compiler Collection | gcc |
|
||||||
| intel | Intel compiler | msvc on windows, otherwise gcc |
|
| intel | Intel compiler | msvc on windows, otherwise gcc |
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
## added the Flang compiler
|
||||||
|
[Flang](https://github.com/flang-compiler/flang/releases) Fortran compiler support was added.
|
||||||
|
As with other Fortran compilers, flang is specified using `FC=flang meson ..` or similar.
|
|
@ -62,6 +62,7 @@ __all__ = [
|
||||||
'GnuDCompiler',
|
'GnuDCompiler',
|
||||||
'GnuFortranCompiler',
|
'GnuFortranCompiler',
|
||||||
'ElbrusFortranCompiler',
|
'ElbrusFortranCompiler',
|
||||||
|
'FlangFortranCompiler',
|
||||||
'GnuObjCCompiler',
|
'GnuObjCCompiler',
|
||||||
'GnuObjCPPCompiler',
|
'GnuObjCPPCompiler',
|
||||||
'IntelCompiler',
|
'IntelCompiler',
|
||||||
|
@ -153,6 +154,7 @@ from .fortran import (
|
||||||
G95FortranCompiler,
|
G95FortranCompiler,
|
||||||
GnuFortranCompiler,
|
GnuFortranCompiler,
|
||||||
ElbrusFortranCompiler,
|
ElbrusFortranCompiler,
|
||||||
|
FlangFortranCompiler,
|
||||||
IntelFortranCompiler,
|
IntelFortranCompiler,
|
||||||
NAGFortranCompiler,
|
NAGFortranCompiler,
|
||||||
Open64FortranCompiler,
|
Open64FortranCompiler,
|
||||||
|
|
|
@ -1617,7 +1617,11 @@ class PGICompiler:
|
||||||
return ['-silent']
|
return ['-silent']
|
||||||
|
|
||||||
def openmp_flags(self):
|
def openmp_flags(self):
|
||||||
return ['-fopenmp']
|
return ['-mp']
|
||||||
|
|
||||||
|
def get_allow_undefined_link_args(self):
|
||||||
|
return []
|
||||||
|
|
||||||
|
|
||||||
class ElbrusCompiler(GnuCompiler):
|
class ElbrusCompiler(GnuCompiler):
|
||||||
# Elbrus compiler is nearly like GCC, but does not support
|
# Elbrus compiler is nearly like GCC, but does not support
|
||||||
|
|
|
@ -22,6 +22,7 @@ from .compilers import (
|
||||||
clike_debug_args,
|
clike_debug_args,
|
||||||
Compiler,
|
Compiler,
|
||||||
GnuCompiler,
|
GnuCompiler,
|
||||||
|
ClangCompiler,
|
||||||
ElbrusCompiler,
|
ElbrusCompiler,
|
||||||
IntelCompiler,
|
IntelCompiler,
|
||||||
PGICompiler
|
PGICompiler
|
||||||
|
@ -370,7 +371,7 @@ class PathScaleFortranCompiler(FortranCompiler):
|
||||||
return ['-mp']
|
return ['-mp']
|
||||||
|
|
||||||
|
|
||||||
class PGIFortranCompiler(FortranCompiler):
|
class PGIFortranCompiler(PGICompiler, FortranCompiler):
|
||||||
def __init__(self, exelist, version, is_cross, exe_wrapper=None, **kwags):
|
def __init__(self, exelist, version, is_cross, exe_wrapper=None, **kwags):
|
||||||
FortranCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwags)
|
FortranCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwags)
|
||||||
PGICompiler.__init__(self, CompilerType.PGI_STANDARD)
|
PGICompiler.__init__(self, CompilerType.PGI_STANDARD)
|
||||||
|
@ -382,6 +383,17 @@ class PGIFortranCompiler(FortranCompiler):
|
||||||
return val
|
return val
|
||||||
|
|
||||||
|
|
||||||
|
class FlangFortranCompiler(ClangCompiler, FortranCompiler):
|
||||||
|
def __init__(self, exelist, version, is_cross, exe_wrapper=None, **kwags):
|
||||||
|
FortranCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwags)
|
||||||
|
ClangCompiler.__init__(self, CompilerType.CLANG_STANDARD)
|
||||||
|
self.id = 'flang'
|
||||||
|
default_warn_args = ['-Minform=inform']
|
||||||
|
self.warn_args = {'1': default_warn_args,
|
||||||
|
'2': default_warn_args,
|
||||||
|
'3': default_warn_args}
|
||||||
|
|
||||||
|
|
||||||
class Open64FortranCompiler(FortranCompiler):
|
class Open64FortranCompiler(FortranCompiler):
|
||||||
def __init__(self, exelist, version, is_cross, exe_wrapper=None, **kwags):
|
def __init__(self, exelist, version, is_cross, exe_wrapper=None, **kwags):
|
||||||
FortranCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwags)
|
FortranCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwags)
|
||||||
|
|
|
@ -44,6 +44,7 @@ from .compilers import (
|
||||||
ClangObjCPPCompiler,
|
ClangObjCPPCompiler,
|
||||||
ClangClCCompiler,
|
ClangClCCompiler,
|
||||||
ClangClCPPCompiler,
|
ClangClCPPCompiler,
|
||||||
|
FlangFortranCompiler,
|
||||||
G95FortranCompiler,
|
G95FortranCompiler,
|
||||||
GnuCCompiler,
|
GnuCCompiler,
|
||||||
GnuCPPCompiler,
|
GnuCPPCompiler,
|
||||||
|
@ -782,6 +783,9 @@ class Environment:
|
||||||
if 'PGI Compilers' in out:
|
if 'PGI Compilers' in out:
|
||||||
return PGIFortranCompiler(compiler, version, is_cross, exe_wrap, full_version=full_version)
|
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:
|
if 'Open64 Compiler Suite' in err:
|
||||||
return Open64FortranCompiler(compiler, version, is_cross, exe_wrap, full_version=full_version)
|
return Open64FortranCompiler(compiler, version, is_cross, exe_wrap, full_version=full_version)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue