diff options
author | Denis Davydov <davydden@gmail.com> | 2016-05-03 10:47:39 +0200 |
---|---|---|
committer | Denis Davydov <davydden@gmail.com> | 2016-05-05 10:44:41 +0200 |
commit | 2cdfe14e5a8cbdefd3533d3bb0b0ac09fa9e4fa6 (patch) | |
tree | 2325745a9817185fa4d8652ba83967ef837376a4 /lib | |
parent | 13e52962ee59b6e88535d8e38acf25f462e5ec74 (diff) | |
download | spack-2cdfe14e5a8cbdefd3533d3bb0b0ac09fa9e4fa6.tar.gz spack-2cdfe14e5a8cbdefd3533d3bb0b0ac09fa9e4fa6.tar.bz2 spack-2cdfe14e5a8cbdefd3533d3bb0b0ac09fa9e4fa6.tar.xz spack-2cdfe14e5a8cbdefd3533d3bb0b0ac09fa9e4fa6.zip |
compilers: make sure cxx11_flag() is defined for all compilers
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/compilers/clang.py | 11 | ||||
-rw-r--r-- | lib/spack/spack/compilers/nag.py | 6 | ||||
-rw-r--r-- | lib/spack/spack/compilers/pgi.py | 7 |
3 files changed, 23 insertions, 1 deletions
diff --git a/lib/spack/spack/compilers/clang.py b/lib/spack/spack/compilers/clang.py index e406d86a24..8a60ebcaed 100644 --- a/lib/spack/spack/compilers/clang.py +++ b/lib/spack/spack/compilers/clang.py @@ -47,6 +47,17 @@ class Clang(Compiler): 'f77' : 'f77', 'fc' : 'f90' } + @property + def cxx11_flag(self): + if ver.endswith('-apple'): + # FIXME: figure out from which version Apple's clang supports c++11 + return "-std=c++11" + else: + if self.version < ver('3.3'): + tty.die("Only Clang 3.3 and above support c++11.") + else: + return "-std=c++11" + @classmethod def default_version(self, comp): """The '--version' option works for clang compilers. diff --git a/lib/spack/spack/compilers/nag.py b/lib/spack/spack/compilers/nag.py index 527a05a090..1df6b1c591 100644 --- a/lib/spack/spack/compilers/nag.py +++ b/lib/spack/spack/compilers/nag.py @@ -20,6 +20,12 @@ class Nag(Compiler): 'f77' : 'nag/nagfor', 'fc' : 'nag/nagfor' } + @property + def cxx11_flag(self): + tty.die("cxx11_flag() is not implemented for nag. Consider creating a pull-request.") + return "-std=c++11" + + @classmethod def default_version(self, comp): """The '-V' option works for nag compilers. diff --git a/lib/spack/spack/compilers/pgi.py b/lib/spack/spack/compilers/pgi.py index c6a1078bd9..ebf644404b 100644 --- a/lib/spack/spack/compilers/pgi.py +++ b/lib/spack/spack/compilers/pgi.py @@ -43,6 +43,12 @@ class Pgi(Compiler): 'f77' : 'pgi/pgfortran', 'fc' : 'pgi/pgfortran' } + @property + def cxx11_flag(self): + tty.die("cxx11_flag() is not implemented for pgi. Consider creating a pull-request.") + return "-std=c++11" + + @classmethod def default_version(cls, comp): """The '-V' option works for all the PGI compilers. @@ -54,4 +60,3 @@ class Pgi(Compiler): """ return get_compiler_version( comp, '-V', r'pg[^ ]* ([^ ]+) \d\d\d?-bit target') - |