Remove a few unused classes and globals (#46054)
This commit is contained in:
parent
cbe18d9cbc
commit
394e6159d6
@ -6,7 +6,6 @@
|
|||||||
"""This module contains functions related to finding compilers on the
|
"""This module contains functions related to finding compilers on the
|
||||||
system and configuring Spack to use multiple compilers.
|
system and configuring Spack to use multiple compilers.
|
||||||
"""
|
"""
|
||||||
import collections
|
|
||||||
import importlib
|
import importlib
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
@ -640,50 +639,10 @@ def class_for_compiler_name(compiler_name):
|
|||||||
return cls
|
return cls
|
||||||
|
|
||||||
|
|
||||||
def all_os_classes():
|
|
||||||
"""
|
|
||||||
Return the list of classes for all operating systems available on
|
|
||||||
this platform
|
|
||||||
"""
|
|
||||||
classes = []
|
|
||||||
|
|
||||||
platform = spack.platforms.host()
|
|
||||||
for os_class in platform.operating_sys.values():
|
|
||||||
classes.append(os_class)
|
|
||||||
|
|
||||||
return classes
|
|
||||||
|
|
||||||
|
|
||||||
def all_compiler_types():
|
def all_compiler_types():
|
||||||
return [class_for_compiler_name(c) for c in supported_compilers()]
|
return [class_for_compiler_name(c) for c in supported_compilers()]
|
||||||
|
|
||||||
|
|
||||||
#: Gathers the attribute values by which a detected compiler is considered
|
|
||||||
#: unique in Spack.
|
|
||||||
#:
|
|
||||||
#: - os: the operating system
|
|
||||||
#: - compiler_name: the name of the compiler (e.g. 'gcc', 'clang', etc.)
|
|
||||||
#: - version: the version of the compiler
|
|
||||||
#:
|
|
||||||
CompilerID = collections.namedtuple("CompilerID", ["os", "compiler_name", "version"])
|
|
||||||
|
|
||||||
#: Variations on a matched compiler name
|
|
||||||
NameVariation = collections.namedtuple("NameVariation", ["prefix", "suffix"])
|
|
||||||
|
|
||||||
#: Groups together the arguments needed by `detect_version`. The four entries
|
|
||||||
#: in the tuple are:
|
|
||||||
#:
|
|
||||||
#: - id: An instance of the CompilerID named tuple (version can be set to None
|
|
||||||
#: as it will be detected later)
|
|
||||||
#: - variation: a NameVariation for file being tested
|
|
||||||
#: - language: compiler language being tested (one of 'cc', 'cxx', 'fc', 'f77')
|
|
||||||
#: - path: full path to the executable being tested
|
|
||||||
#:
|
|
||||||
DetectVersionArgs = collections.namedtuple(
|
|
||||||
"DetectVersionArgs", ["id", "variation", "language", "path"]
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def is_mixed_toolchain(compiler):
|
def is_mixed_toolchain(compiler):
|
||||||
"""Returns True if the current compiler is a mixed toolchain,
|
"""Returns True if the current compiler is a mixed toolchain,
|
||||||
False otherwise.
|
False otherwise.
|
||||||
@ -888,11 +847,6 @@ def __init__(self, compiler_spec):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class NoCompilersError(spack.error.SpackError):
|
|
||||||
def __init__(self):
|
|
||||||
super().__init__("Spack could not find any compilers!")
|
|
||||||
|
|
||||||
|
|
||||||
class UnknownCompilerError(spack.error.SpackError):
|
class UnknownCompilerError(spack.error.SpackError):
|
||||||
def __init__(self, compiler_name):
|
def __init__(self, compiler_name):
|
||||||
super().__init__("Spack doesn't support the requested compiler: {0}".format(compiler_name))
|
super().__init__("Spack doesn't support the requested compiler: {0}".format(compiler_name))
|
||||||
@ -903,25 +857,3 @@ def __init__(self, compiler_spec, target):
|
|||||||
super().__init__(
|
super().__init__(
|
||||||
"No compilers for operating system %s satisfy spec %s" % (target, compiler_spec)
|
"No compilers for operating system %s satisfy spec %s" % (target, compiler_spec)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class CompilerDuplicateError(spack.error.SpackError):
|
|
||||||
def __init__(self, compiler_spec, arch_spec):
|
|
||||||
config_file_to_duplicates = get_compiler_duplicates(compiler_spec, arch_spec)
|
|
||||||
duplicate_table = list((x, len(y)) for x, y in config_file_to_duplicates.items())
|
|
||||||
descriptor = lambda num: "time" if num == 1 else "times"
|
|
||||||
duplicate_msg = lambda cfgfile, count: "{0}: {1} {2}".format(
|
|
||||||
cfgfile, str(count), descriptor(count)
|
|
||||||
)
|
|
||||||
msg = (
|
|
||||||
"Compiler configuration contains entries with duplicate"
|
|
||||||
+ " specification ({0}, {1})".format(compiler_spec, arch_spec)
|
|
||||||
+ " in the following files:\n\t"
|
|
||||||
+ "\n\t".join(duplicate_msg(x, y) for x, y in duplicate_table)
|
|
||||||
)
|
|
||||||
super().__init__(msg)
|
|
||||||
|
|
||||||
|
|
||||||
class CompilerSpecInsufficientlySpecificError(spack.error.SpackError):
|
|
||||||
def __init__(self, compiler_spec):
|
|
||||||
super().__init__("Multiple compilers satisfy spec %s" % compiler_spec)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user