diff options
author | Mat Cross <mathewc@nag.co.uk> | 2021-08-20 11:55:18 +0100 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2021-09-10 16:08:57 -0400 |
commit | 0e86258748b712a9074ebd67e2bf98fe7748c73f (patch) | |
tree | 5a59b92e88d11124cd0a8a4066da98d544838a8e /mesonbuild/compilers | |
parent | 3f796c43df2c218f615d445ad6ffdbc6ca119818 (diff) | |
download | meson-0e86258748b712a9074ebd67e2bf98fe7748c73f.zip meson-0e86258748b712a9074ebd67e2bf98fe7748c73f.tar.gz meson-0e86258748b712a9074ebd67e2bf98fe7748c73f.tar.bz2 |
Implemented some missing operation for the NAG Fortran Compiler.
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r-- | mesonbuild/compilers/detect.py | 12 | ||||
-rw-r--r-- | mesonbuild/compilers/fortran.py | 20 |
2 files changed, 27 insertions, 5 deletions
diff --git a/mesonbuild/compilers/detect.py b/mesonbuild/compilers/detect.py index cd0f252..de1845a 100644 --- a/mesonbuild/compilers/detect.py +++ b/mesonbuild/compilers/detect.py @@ -34,6 +34,7 @@ from ..linkers import ( C2000Linker, C2000DynamicLinker, DLinker, + NAGDynamicLinker, NvidiaHPC_DynamicLinker, PGIDynamicLinker, PGIStaticLinker, @@ -774,9 +775,14 @@ def detect_fortran_compiler(env: 'Environment', for_machine: MachineChoice) -> C exe_wrap, full_version=full_version, linker=linker) if 'NAG Fortran' in err: - linker = guess_nix_linker(env, - compiler, NAGFortranCompiler, for_machine) - return NAGFortranCompiler( + full_version = err.split('\n', 1)[0] + version = full_version.split()[-1] + cls = NAGFortranCompiler + env.coredata.add_lang_args(cls.language, cls, for_machine, env) + linker = NAGDynamicLinker( + compiler, for_machine, cls.LINKER_PREFIX, [], + version=version) + return cls( compiler, version, for_machine, is_cross, info, exe_wrap, full_version=full_version, linker=linker) diff --git a/mesonbuild/compilers/fortran.py b/mesonbuild/compilers/fortran.py index 00b0308..1a430a7 100644 --- a/mesonbuild/compilers/fortran.py +++ b/mesonbuild/compilers/fortran.py @@ -494,12 +494,28 @@ class NAGFortranCompiler(FortranCompiler): is_cross, info, exe_wrapper, linker=linker, full_version=full_version) self.id = 'nagfor' + self.warn_args = { + '0': ['-w=all'], + '1': [], + '2': [], + '3': [], + } - def get_warn_args(self, level: str) -> T.List[str]: - return [] + def get_always_args(self) -> T.List[str]: + return self.get_nagfor_quiet(self.version) def get_module_outdir_args(self, path: str) -> T.List[str]: return ['-mdir', path] + @staticmethod + def get_nagfor_quiet(version: str) -> T.List[str]: + return ['-quiet'] if version_compare(version, '>=7100') else [] + + def get_pic_args(self) -> T.List[str]: + return ['-PIC'] + + def get_std_exe_link_args(self) -> T.List[str]: + return self.get_always_args() + def openmp_flags(self) -> T.List[str]: return ['-openmp'] |