From e25150296a4ef34a80a664565e3d26f00f7d999f Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Wed, 20 Jan 2016 14:44:43 -0600 Subject: Redirect STDERR to STDOUT for compiler version This is necessary for the NAG Fortran compiler, which prints its version message to STDERR instead of STDOUT. This message was previously being ignored, preventing spack from finding the compiler's version or automatically adding it to the compilers.yaml configuration file. --- lib/spack/spack/compiler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/spack/spack/compiler.py b/lib/spack/spack/compiler.py index a665f6062d..887e416dc5 100644 --- a/lib/spack/spack/compiler.py +++ b/lib/spack/spack/compiler.py @@ -24,6 +24,7 @@ ############################################################################## import os import re +import subprocess import itertools from datetime import datetime @@ -51,7 +52,7 @@ _version_cache = {} def get_compiler_version(compiler_path, version_arg, regex='(.*)'): if not compiler_path in _version_cache: compiler = Executable(compiler_path) - output = compiler(version_arg, return_output=True, error=os.devnull) + output = compiler(version_arg, return_output=True, error=subprocess.STDOUT) match = re.search(regex, output) _version_cache[compiler_path] = match.group(1) if match else 'unknown' -- cgit v1.2.3-60-g2f50