diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2019-07-30 18:05:00 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-30 18:05:00 +0300 |
commit | 986587067cf49d4466a706f94c8247e6992873c8 (patch) | |
tree | 3dd88617d6bd0714697ffbaba43e14d88e6cd58a | |
parent | 645a8584fede006915f053de4787e1cef610f2d9 (diff) | |
parent | dfa52469d7dac6fbed285e90dbbd1b491cb5a471 (diff) | |
download | meson-986587067cf49d4466a706f94c8247e6992873c8.zip meson-986587067cf49d4466a706f94c8247e6992873c8.tar.gz meson-986587067cf49d4466a706f94c8247e6992873c8.tar.bz2 |
Merge pull request #5734 from scivision/flang_fix
Flang: Fortran project_tests fixes
-rw-r--r-- | mesonbuild/compilers/fortran.py | 3 | ||||
-rw-r--r-- | mesonbuild/dependencies/misc.py | 13 | ||||
-rw-r--r-- | test cases/fortran/13 coarray/meson.build | 7 |
3 files changed, 18 insertions, 5 deletions
diff --git a/mesonbuild/compilers/fortran.py b/mesonbuild/compilers/fortran.py index e417566..c10e2ca 100644 --- a/mesonbuild/compilers/fortran.py +++ b/mesonbuild/compilers/fortran.py @@ -321,6 +321,9 @@ class FlangFortranCompiler(ClangCompiler, FortranCompiler): '2': default_warn_args, '3': default_warn_args} + def language_stdlib_only_link_flags(self) -> List[str]: + return ['-lflang', '-lpgmath'] + class Open64FortranCompiler(FortranCompiler): def __init__(self, exelist, version, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwags): FortranCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwags) diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index 1bb1b6e..c463ec3 100644 --- a/mesonbuild/dependencies/misc.py +++ b/mesonbuild/dependencies/misc.py @@ -380,11 +380,14 @@ class OpenMPDependency(ExternalDependency): if openmp_date: self.version = self.VERSIONS[openmp_date] - if self.clib_compiler.has_header('omp.h', '', self.env, dependencies=[self], disable_cache=True)[0]: - self.is_found = True - self.compile_args = self.link_args = self.clib_compiler.openmp_flags() - else: - mlog.log(mlog.yellow('WARNING:'), 'OpenMP found but omp.h missing.') + # Flang has omp_lib.h + header_names = ('omp.h', 'omp_lib.h') + for name in header_names: + if self.clib_compiler.has_header(name, '', self.env, dependencies=[self], disable_cache=True)[0]: + self.is_found = True + self.compile_args = self.link_args = self.clib_compiler.openmp_flags() + else: + mlog.log(mlog.yellow('WARNING:'), 'OpenMP found but omp.h missing.') class ThreadDependency(ExternalDependency): diff --git a/test cases/fortran/13 coarray/meson.build b/test cases/fortran/13 coarray/meson.build index 3160aa6..e1fb34b 100644 --- a/test cases/fortran/13 coarray/meson.build +++ b/test cases/fortran/13 coarray/meson.build @@ -1,6 +1,13 @@ project('Fortran coarray', 'fortran', meson_version: '>=0.50') +fc = meson.get_compiler('fortran') +fcid = fc.get_id() + +if fcid == 'pgi' or fcid == 'flang' + error('MESON_SKIP_TEST: At least through: PGI 19.4 and Flang 7.0 do not support Fortran Coarrays.') +endif + # coarray is required because single-image fallback is an intrinsic feature coarray = dependency('coarray', required : true) |