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.
This commit is contained in:
parent
83de658ee4
commit
e25150296a
@ -24,6 +24,7 @@
|
||||
##############################################################################
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
import itertools
|
||||
from datetime import datetime
|
||||
|
||||
@ -51,7 +52,7 @@ def _verify_executables(*paths):
|
||||
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'
|
||||
|
Loading…
Reference in New Issue
Block a user