From 76305038ef11bcc9e33200df28d3e0a8073d95d8 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 2 Nov 2017 21:44:10 -0400 Subject: 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' --- lib/spack/spack/compilers/gcc.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib') 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): -- cgit v1.2.3-60-g2f50