compilers: add openmp_flag() method
This commit is contained in:
parent
2cdfe14e5a
commit
9776dc0433
6 changed files with 28 additions and 2 deletions
|
@ -47,6 +47,14 @@ class Clang(Compiler):
|
|||
'f77' : 'f77',
|
||||
'fc' : 'f90' }
|
||||
|
||||
@property
|
||||
def openmp_flag(self):
|
||||
ver = '%s' % self.version
|
||||
if ver.endswith('-apple'):
|
||||
tty.die("Clang from Apple does not support Openmp yet.")
|
||||
else:
|
||||
return "-fopenmp"
|
||||
|
||||
@property
|
||||
def cxx11_flag(self):
|
||||
if ver.endswith('-apple'):
|
||||
|
|
|
@ -49,6 +49,10 @@ class Gcc(Compiler):
|
|||
'f77' : 'gcc/gfortran',
|
||||
'fc' : 'gcc/gfortran' }
|
||||
|
||||
@property
|
||||
def openmp_flag(self):
|
||||
return "-fopenmp"
|
||||
|
||||
@property
|
||||
def cxx11_flag(self):
|
||||
if self.version < ver('4.3'):
|
||||
|
|
|
@ -43,6 +43,10 @@ class Intel(Compiler):
|
|||
'f77' : 'intel/ifort',
|
||||
'fc' : 'intel/ifort' }
|
||||
|
||||
@property
|
||||
def openmp_flag(self):
|
||||
return "-openmp"
|
||||
|
||||
@property
|
||||
def cxx11_flag(self):
|
||||
if self.version < ver('11.1'):
|
||||
|
@ -68,5 +72,3 @@ def default_version(cls, comp):
|
|||
"""
|
||||
return get_compiler_version(
|
||||
comp, '--version', r'\((?:IFORT|ICC)\) ([^ ]+)')
|
||||
|
||||
|
||||
|
|
|
@ -20,6 +20,10 @@ class Nag(Compiler):
|
|||
'f77' : 'nag/nagfor',
|
||||
'fc' : 'nag/nagfor' }
|
||||
|
||||
@property
|
||||
def openmp_flag(self):
|
||||
return "-openmp"
|
||||
|
||||
@property
|
||||
def cxx11_flag(self):
|
||||
tty.die("cxx11_flag() is not implemented for nag. Consider creating a pull-request.")
|
||||
|
|
|
@ -43,6 +43,10 @@ class Pgi(Compiler):
|
|||
'f77' : 'pgi/pgfortran',
|
||||
'fc' : 'pgi/pgfortran' }
|
||||
|
||||
@property
|
||||
def openmp_flag(self):
|
||||
return "-mp"
|
||||
|
||||
@property
|
||||
def cxx11_flag(self):
|
||||
tty.die("cxx11_flag() is not implemented for pgi. Consider creating a pull-request.")
|
||||
|
|
|
@ -44,6 +44,10 @@ class Xl(Compiler):
|
|||
'f77' : 'xl/xlf',
|
||||
'fc' : 'xl/xlf90' }
|
||||
|
||||
@property
|
||||
def openmp_flag(self):
|
||||
return "-qsmp=omp"
|
||||
|
||||
@property
|
||||
def cxx11_flag(self):
|
||||
if self.version < ver('13.1'):
|
||||
|
|
Loading…
Reference in a new issue