summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Davydov <davydden@gmail.com>2016-05-03 18:04:08 +0200
committerDenis Davydov <davydden@gmail.com>2016-05-05 10:44:41 +0200
commit473a5542bed01e2f70370ddd5ceb70ac41fe178e (patch)
treea85860d272eb8aa13983335638408728d2075165
parent30b65d3114e20506fb2d36c0aa7f34babf3c4f72 (diff)
downloadspack-473a5542bed01e2f70370ddd5ceb70ac41fe178e.tar.gz
spack-473a5542bed01e2f70370ddd5ceb70ac41fe178e.tar.bz2
spack-473a5542bed01e2f70370ddd5ceb70ac41fe178e.tar.xz
spack-473a5542bed01e2f70370ddd5ceb70ac41fe178e.zip
compiler: make default openmp_flag() and cxx11_flag() die when these properties are not implemented in a derived class
-rw-r--r--lib/spack/spack/compiler.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/spack/spack/compiler.py b/lib/spack/spack/compiler.py
index 1f1cf97ce9..622eed6c10 100644
--- a/lib/spack/spack/compiler.py
+++ b/lib/spack/spack/compiler.py
@@ -120,19 +120,20 @@ class Compiler(object):
def version(self):
return self.spec.version
- # Default implementation of OpenMP linking flag.
- # Override in derived classes if needed
+ # This property should be overridden in the compiler subclass if
+ # OpenMP is supported by that compiler
@property
def openmp_flag(self):
- return "-fopenmp"
+ # 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.")
- # Default implementation of c++11 linking flag.
- # Override in derived classes if needed
+ # This property should be overridden in the compiler subclass if
+ # C++11 is supported by that compiler
@property
def cxx11_flag(self):
- return "-std=c++11"
-
+ # 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.")
#
# Compiler classes have methods for querying the version of