diff options
author | Adam J. Stewart <ajstewart426@gmail.com> | 2016-01-20 14:44:43 -0600 |
---|---|---|
committer | Adam J. Stewart <ajstewart426@gmail.com> | 2016-01-20 14:44:43 -0600 |
commit | e25150296a4ef34a80a664565e3d26f00f7d999f (patch) | |
tree | 0f6f8155d7fcfe35d733e7832206d74b4e9d19d9 | |
parent | 83de658ee42e08a27ce7d85d295955f4809c03dc (diff) | |
download | spack-e25150296a4ef34a80a664565e3d26f00f7d999f.tar.gz spack-e25150296a4ef34a80a664565e3d26f00f7d999f.tar.bz2 spack-e25150296a4ef34a80a664565e3d26f00f7d999f.tar.xz spack-e25150296a4ef34a80a664565e3d26f00f7d999f.zip |
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.
-rw-r--r-- | lib/spack/spack/compiler.py | 3 |
1 files changed, 2 insertions, 1 deletions
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' |