From 473a5542bed01e2f70370ddd5ceb70ac41fe178e Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Tue, 3 May 2016 18:04:08 +0200 Subject: compiler: make default openmp_flag() and cxx11_flag() die when these properties are not implemented in a derived class --- lib/spack/spack/compiler.py | 15 ++++++++------- 1 file 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 -- cgit v1.2.3-70-g09d2