diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/compilers/clang.py | 22 | ||||
-rw-r--r-- | lib/spack/spack/test/compilers/basics.py | 1 |
2 files changed, 3 insertions, 20 deletions
diff --git a/lib/spack/spack/compilers/clang.py b/lib/spack/spack/compilers/clang.py index f5c39889ec..846c3609dc 100644 --- a/lib/spack/spack/compilers/clang.py +++ b/lib/spack/spack/compilers/clang.py @@ -50,6 +50,8 @@ class Clang(Compiler): # Subclasses use possible names of Fortran 90 compiler fc_names = ['flang', 'gfortran', 'xlf90_r'] + version_argument = '--version' + @property def debug_flags(self): return ['-gcodeview', '-gdwarf-2', '-gdwarf-3', '-gdwarf-4', @@ -203,26 +205,6 @@ class Clang(Compiler): @classmethod @llnl.util.lang.memoized - def default_version(cls, comp): - """The ``--version`` option works for clang compilers. - On most platforms, output looks like this:: - - clang version 3.1 (trunk 149096) - Target: x86_64-unknown-linux-gnu - Thread model: posix - - On macOS, it looks like this:: - - Apple LLVM version 7.0.2 (clang-700.1.81) - Target: x86_64-apple-darwin15.2.0 - Thread model: posix - """ - compiler = Executable(comp) - output = compiler('--version', output=str, error=str) - return cls.extract_version_from_output(output) - - @classmethod - @llnl.util.lang.memoized def extract_version_from_output(cls, output): ver = 'unknown' match = re.search( diff --git a/lib/spack/spack/test/compilers/basics.py b/lib/spack/spack/test/compilers/basics.py index 3e43cd4e84..faf18e3871 100644 --- a/lib/spack/spack/test/compilers/basics.py +++ b/lib/spack/spack/test/compilers/basics.py @@ -389,6 +389,7 @@ def test_clang_flags(): supported_flag_test("fc_pic_flag", "-fPIC", "clang@2.0.0-apple") # non-Apple Clang. + supported_flag_test("version_argument", "--version", "clang@foo.bar") supported_flag_test("openmp_flag", "-fopenmp", "clang@3.3") unsupported_flag_test("cxx11_flag", "clang@3.2") supported_flag_test("cxx11_flag", "-std=c++11", "clang@3.3") |