diff options
author | Michael Hirsch, Ph.D <scivision@users.noreply.github.com> | 2019-02-13 14:09:18 -0500 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-02-13 21:09:18 +0200 |
commit | ebfb09f5d64b8dbb9d10ae57f71a1d7be7fd9137 (patch) | |
tree | 70bf292ef9df5c94a2a34f0202a020315802446a /mesonbuild/dependencies/misc.py | |
parent | df0b734a17c15c3fb202e27b307f78e7f143c18b (diff) | |
download | meson-ebfb09f5d64b8dbb9d10ae57f71a1d7be7fd9137.zip meson-ebfb09f5d64b8dbb9d10ae57f71a1d7be7fd9137.tar.gz meson-ebfb09f5d64b8dbb9d10ae57f71a1d7be7fd9137.tar.bz2 |
Fortran 2008/2018 Coarray support
Diffstat (limited to 'mesonbuild/dependencies/misc.py')
-rw-r--r-- | mesonbuild/dependencies/misc.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index e49bdc9..db83422 100644 --- a/mesonbuild/dependencies/misc.py +++ b/mesonbuild/dependencies/misc.py @@ -32,6 +32,45 @@ from .base import ( ) +class CoarrayDependency(ExternalDependency): + """ + Coarrays are a Fortran 2008 feature. + + Coarrays are sometimes implemented via external library (GCC+OpenCoarrays), + while other compilers just build in support (Cray, IBM, Intel, NAG). + Coarrays may be thought of as a high-level language abstraction of + low-level MPI calls. + """ + def __init__(self, environment, kwargs): + super().__init__('coarray', environment, 'fortran', kwargs) + kwargs['required'] = False + kwargs['silent'] = True + self.is_found = False + + cid = self.get_compiler().get_id() + if cid == 'gcc': + """ OpenCoarrays is the most commonly used method for Fortran Coarray with GCC """ + self.is_found = True + kwargs['modules'] = 'OpenCoarrays::caf_mpi' + cmakedep = CMakeDependency('OpenCoarrays', environment, kwargs) + if not cmakedep.found(): + self.compile_args = ['-fcoarray=single'] + self.version = 'single image' + return + + self.compile_args = cmakedep.get_compile_args() + self.link_args = cmakedep.get_link_args() + self.version = cmakedep.get_version() + elif cid == 'intel': + """ Coarrays are built into Intel compilers, no external library needed """ + self.is_found = True + self.link_args = ['-coarray=shared'] + self.compile_args = self.link_args + elif cid == 'nagfor': + """ NAG doesn't require any special arguments for Coarray """ + self.is_found = True + + class HDF5Dependency(ExternalDependency): def __init__(self, environment, kwargs): |