summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBen Boeckel <mathstuf@users.noreply.github.com>2017-11-02 21:44:10 -0400
committerscheibelp <scheibel1@llnl.gov>2017-11-02 18:44:10 -0700
commit76305038ef11bcc9e33200df28d3e0a8073d95d8 (patch)
tree8e5fe9a7ca128226a75050bbae530330d0a01c02 /lib
parenta7925bb927f0368cd0af69d931372a07d4aa4918 (diff)
downloadspack-76305038ef11bcc9e33200df28d3e0a8073d95d8.tar.gz
spack-76305038ef11bcc9e33200df28d3e0a8073d95d8.tar.bz2
spack-76305038ef11bcc9e33200df28d3e0a8073d95d8.tar.xz
spack-76305038ef11bcc9e33200df28d3e0a8073d95d8.zip
determine full compiler version for gcc-7
Fixes #5778. Spack uses 'gcc -dumpversion' to determine the full version of gcc. 'gcc -dumpversion' no longer gives the full version on gcc 7.2.0. 'gcc -dumpfullversion' is required instead. This PR detects when 'gcc -dumpversion' gives a truncated version of '7' and in that case retrieves the full version with 'gcc -dumpfullversion'
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/compilers/gcc.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/spack/spack/compilers/gcc.py b/lib/spack/spack/compilers/gcc.py
index c302db5c37..32db85da26 100644
--- a/lib/spack/spack/compilers/gcc.py
+++ b/lib/spack/spack/compilers/gcc.py
@@ -97,7 +97,10 @@ class Gcc(Compiler):
if spack.compilers.clang.Clang.default_version(cc) != 'unknown':
return 'unknown'
- return super(Gcc, cls).default_version(cc)
+ version = super(Gcc, cls).default_version(cc)
+ if version in ['7']:
+ version = get_compiler_version(cc, '-dumpfullversion')
+ return version
@classmethod
def fc_version(cls, fc):