diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2024-08-27 15:06:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-27 15:06:39 +0200 |
commit | 394e6159d676eb37fc9eccc59201136889e4aa9c (patch) | |
tree | f83a1ae845eea6151a8f0b30d2753236e691f53d | |
parent | cbe18d9cbcaf4ec18b7a3411b918ba9c58c0f7e0 (diff) | |
download | spack-394e6159d676eb37fc9eccc59201136889e4aa9c.tar.gz spack-394e6159d676eb37fc9eccc59201136889e4aa9c.tar.bz2 spack-394e6159d676eb37fc9eccc59201136889e4aa9c.tar.xz spack-394e6159d676eb37fc9eccc59201136889e4aa9c.zip |
Remove a few unused classes and globals (#46054)
-rw-r--r-- | lib/spack/spack/compilers/__init__.py | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/lib/spack/spack/compilers/__init__.py b/lib/spack/spack/compilers/__init__.py index d15ce87b2d..80e87c73fc 100644 --- a/lib/spack/spack/compilers/__init__.py +++ b/lib/spack/spack/compilers/__init__.py @@ -6,7 +6,6 @@ """This module contains functions related to finding compilers on the system and configuring Spack to use multiple compilers. """ -import collections import importlib import os import sys @@ -640,50 +639,10 @@ def class_for_compiler_name(compiler_name): 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(): 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): """Returns True if the current compiler is a mixed toolchain, False otherwise. @@ -888,11 +847,6 @@ class InvalidCompilerConfigurationError(spack.error.SpackError): ) -class NoCompilersError(spack.error.SpackError): - def __init__(self): - super().__init__("Spack could not find any compilers!") - - class UnknownCompilerError(spack.error.SpackError): def __init__(self, compiler_name): super().__init__("Spack doesn't support the requested compiler: {0}".format(compiler_name)) @@ -903,25 +857,3 @@ class NoCompilerForSpecError(spack.error.SpackError): super().__init__( "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) |