Merge pull request #1419 from LLNL/bugfix-compiler-error-message
Bugfix compiler error message
This commit is contained in:
		| @@ -336,14 +336,18 @@ def _proper_compiler_style(cspec, arch): | |||||||
|             spack.pkgsort.compiler_compare, other_spec.name) |             spack.pkgsort.compiler_compare, other_spec.name) | ||||||
|         matches = sorted(compiler_list, cmp=cmp_compilers) |         matches = sorted(compiler_list, cmp=cmp_compilers) | ||||||
|         if not matches: |         if not matches: | ||||||
|             raise UnavailableCompilerVersionError(other_compiler) |             arch = spec.architecture | ||||||
|  |             raise UnavailableCompilerVersionError(other_compiler, | ||||||
|  |                                                   arch.platform_os) | ||||||
|  |  | ||||||
|         # copy concrete version into other_compiler |         # copy concrete version into other_compiler | ||||||
|         index = 0 |         index = 0 | ||||||
|         while not _proper_compiler_style(matches[index], spec.architecture): |         while not _proper_compiler_style(matches[index], spec.architecture): | ||||||
|             index += 1 |             index += 1 | ||||||
|             if index == len(matches) - 1: |             if index == len(matches) - 1: | ||||||
|                 raise NoValidVersionError(spec) |                 arch = spec.architecture | ||||||
|  |                 raise UnavailableCompilerVersionError(spec.compiler, | ||||||
|  |                                                       arch.platform_os) | ||||||
|         spec.compiler = matches[index].copy() |         spec.compiler = matches[index].copy() | ||||||
|         assert(spec.compiler.concrete) |         assert(spec.compiler.concrete) | ||||||
|         return True  # things changed. |         return True  # things changed. | ||||||
| @@ -489,9 +493,9 @@ class UnavailableCompilerVersionError(spack.error.SpackError): | |||||||
|     """Raised when there is no available compiler that satisfies a |     """Raised when there is no available compiler that satisfies a | ||||||
|        compiler spec.""" |        compiler spec.""" | ||||||
|  |  | ||||||
|     def __init__(self, compiler_spec): |     def __init__(self, compiler_spec, operating_system): | ||||||
|         super(UnavailableCompilerVersionError, self).__init__( |         super(UnavailableCompilerVersionError, self).__init__( | ||||||
|             "No available compiler version matches '%s'" % compiler_spec, |             "No available compiler version matches '%s' on operating_system %s" % compiler_spec, operating_system,  # NOQA: ignore=E501 | ||||||
|             "Run 'spack compilers' to see available compiler Options.") |             "Run 'spack compilers' to see available compiler Options.") | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 becker33
					becker33