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.
This commit is contained in:
parent
4eb54b6358
commit
52ebc19b4e
1 changed files with 6 additions and 1 deletions
|
@ -69,6 +69,7 @@
|
|||
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 @@ def optimization_flags(self, compiler):
|
|||
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)
|
||||
|
|
Loading…
Reference in a new issue