summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGreg Becker <becker33@llnl.gov>2020-06-13 06:31:24 -0700
committerGitHub <noreply@github.com>2020-06-13 15:31:24 +0200
commit58332d028e58f568d2080318c374c6087ec9881d (patch)
treebfd10dcfdc833606d0abd693d29cedfad37474a0 /lib
parentb9cf50d571271be6572339669ac4b507caf9b845 (diff)
downloadspack-58332d028e58f568d2080318c374c6087ec9881d.tar.gz
spack-58332d028e58f568d2080318c374c6087ec9881d.tar.bz2
spack-58332d028e58f568d2080318c374c6087ec9881d.tar.xz
spack-58332d028e58f568d2080318c374c6087ec9881d.zip
clang: add 'version_argument', remove redundant method (#17071)
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/compilers/clang.py22
-rw-r--r--lib/spack/spack/test/compilers/basics.py1
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")