summaryrefslogtreecommitdiff
path: root/lib/spack/spack/compiler.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/spack/spack/compiler.py')
-rw-r--r--lib/spack/spack/compiler.py41
1 files changed, 35 insertions, 6 deletions
diff --git a/lib/spack/spack/compiler.py b/lib/spack/spack/compiler.py
index 20896f9eec..030dc449fc 100644
--- a/lib/spack/spack/compiler.py
+++ b/lib/spack/spack/compiler.py
@@ -94,12 +94,6 @@ class Compiler(object):
# Names of generic arguments used by this compiler
arg_rpath = '-Wl,-rpath,%s'
- # argument used to get C++11 options
- cxx11_flag = "-std=c++11"
-
- # argument used to get C++14 options
- cxx14_flag = "-std=c++1y"
-
def __init__(self, cspec, cc, cxx, f77, fc):
def check(exe):
@@ -120,6 +114,37 @@ class Compiler(object):
def version(self):
return self.spec.version
+ # This property should be overridden in the compiler subclass if
+ # OpenMP is supported by that compiler
+ @property
+ def openmp_flag(self):
+ # If it is not overridden, assume it is not supported and warn the user
+ tty.die("The compiler you have chosen does not currently support OpenMP.",
+ "If you think it should, please edit the compiler subclass and",
+ "submit a pull request or issue.")
+
+
+ # This property should be overridden in the compiler subclass if
+ # C++11 is supported by that compiler
+ @property
+ def cxx11_flag(self):
+ # If it is not overridden, assume it is not supported and warn the user
+ tty.die("The compiler you have chosen does not currently support C++11.",
+ "If you think it should, please edit the compiler subclass and",
+ "submit a pull request or issue.")
+
+
+ # This property should be overridden in the compiler subclass if
+ # C++14 is supported by that compiler
+ @property
+ def cxx14_flag(self):
+ # If it is not overridden, assume it is not supported and warn the user
+ tty.die("The compiler you have chosen does not currently support C++14.",
+ "If you think it should, please edit the compiler subclass and",
+ "submit a pull request or issue.")
+
+
+
#
# Compiler classes have methods for querying the version of
# specific compiler executables. This is used when discovering compilers.
@@ -205,6 +230,10 @@ class Compiler(object):
return None
successful = [key for key in parmap(check, checks) if key is not None]
+ # The 'successful' list is ordered like the input paths.
+ # Reverse it here so that the dict creation (last insert wins)
+ # does not spoil the intented precedence.
+ successful.reverse()
return dict(((v, p, s), path) for v, p, s, path in successful)
@classmethod