summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2019-12-13 17:31:37 -0800
committerTodd Gamblin <tgamblin@llnl.gov>2019-12-18 11:37:59 -0800
commit52ebc19b4e0401e66d292c8f5090c73830dce2e4 (patch)
tree75e3bee715ca4271d7b971ffaf9e158efcb76a34 /lib
parent4eb54b6358c5825d69558662d0ef1787e75a24ab (diff)
downloadspack-52ebc19b4e0401e66d292c8f5090c73830dce2e4.tar.gz
spack-52ebc19b4e0401e66d292c8f5090c73830dce2e4.tar.bz2
spack-52ebc19b4e0401e66d292c8f5090c73830dce2e4.tar.xz
spack-52ebc19b4e0401e66d292c8f5090c73830dce2e4.zip
bugfix: don't fail if checking for "real" compiler version
doesn't understand a custom, user-defined compiler version. However, if the compiler's version check fails, you can't build anything with the custom compiler. - [x] Be more lenient: fall back to the custom compiler version and use it verbatim if the version check fails.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/architecture.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/spack/spack/architecture.py b/lib/spack/spack/architecture.py
index 0e318bbccf..72cb3e57cc 100644
--- a/lib/spack/spack/architecture.py
+++ b/lib/spack/spack/architecture.py
@@ -69,6 +69,7 @@ from llnl.util.lang import memoized, list_modules, key_ordering
import spack.compiler
import spack.paths
import spack.error as serr
+import spack.util.executable
import spack.version
from spack.util.naming import mod_to_class
from spack.util.spack_yaml import syaml_dict
@@ -214,7 +215,11 @@ class Target(object):
import spack.spec
if isinstance(compiler, spack.spec.CompilerSpec):
compiler = spack.compilers.compilers_for_spec(compiler).pop()
- compiler_version = compiler.cc_version(compiler.cc)
+ try:
+ compiler_version = compiler.cc_version(compiler.cc)
+ except spack.util.executable.ProcessError as e:
+ # log this and just return compiler.version instead
+ tty.debug(str(e))
return self.microarchitecture.optimization_flags(
compiler.name, str(compiler_version)