From 52ebc19b4e0401e66d292c8f5090c73830dce2e4 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Fri, 13 Dec 2019 17:31:37 -0800 Subject: 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. --- lib/spack/spack/architecture.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib') 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) -- cgit v1.2.3-60-g2f50