diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2024-08-29 06:53:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-29 06:53:17 +0200 |
commit | f9065f0c7e82cfb4bcef00f56bb5ae2864f5e0ec (patch) | |
tree | 305b601bdd36fc6b18c01381bf66479e2a989a12 | |
parent | 699735016f6099952f09f127686f764e4bbd9525 (diff) | |
download | spack-f9065f0c7e82cfb4bcef00f56bb5ae2864f5e0ec.tar.gz spack-f9065f0c7e82cfb4bcef00f56bb5ae2864f5e0ec.tar.bz2 spack-f9065f0c7e82cfb4bcef00f56bb5ae2864f5e0ec.tar.xz spack-f9065f0c7e82cfb4bcef00f56bb5ae2864f5e0ec.zip |
Remove "get_compiler_duplicates" (#46077)
This function is used only in tests.
-rw-r--r-- | lib/spack/spack/compilers/__init__.py | 18 | ||||
-rw-r--r-- | lib/spack/spack/test/compilers/basics.py | 19 |
2 files changed, 0 insertions, 37 deletions
diff --git a/lib/spack/spack/compilers/__init__.py b/lib/spack/spack/compilers/__init__.py index 80e87c73fc..1d140b2b6b 100644 --- a/lib/spack/spack/compilers/__init__.py +++ b/lib/spack/spack/compilers/__init__.py @@ -599,24 +599,6 @@ def compiler_for_spec(compiler_spec, arch_spec): return compilers[0] -@_auto_compiler_spec -def get_compiler_duplicates(compiler_spec, arch_spec): - config = spack.config.CONFIG - - scope_to_compilers = {} - for scope in config.scopes: - compilers = compilers_for_spec(compiler_spec, arch_spec=arch_spec, scope=scope) - if compilers: - scope_to_compilers[scope] = compilers - - cfg_file_to_duplicates = {} - for scope, compilers in scope_to_compilers.items(): - config_file = config.get_config_filename(scope, "compilers") - cfg_file_to_duplicates[config_file] = compilers - - return cfg_file_to_duplicates - - @llnl.util.lang.memoized def class_for_compiler_name(compiler_name): """Given a compiler module name, get the corresponding Compiler class.""" diff --git a/lib/spack/spack/test/compilers/basics.py b/lib/spack/spack/test/compilers/basics.py index db9be42745..8f8d7fb876 100644 --- a/lib/spack/spack/test/compilers/basics.py +++ b/lib/spack/spack/test/compilers/basics.py @@ -42,25 +42,6 @@ def test_multiple_conflicting_compiler_definitions(mutable_config): assert cmp.f77 == "f77" -def test_get_compiler_duplicates(mutable_config, compiler_factory): - # In this case there is only one instance of the specified compiler in - # the test configuration (so it is not actually a duplicate), but the - # method behaves the same. - cnl_compiler = compiler_factory(spec="gcc@4.5.0", operating_system="CNL") - # CNL compiler has no target attribute, and this is essential to make detection pass - del cnl_compiler["compiler"]["target"] - mutable_config.set( - "compilers", [compiler_factory(spec="gcc@4.5.0", operating_system="SuSE11"), cnl_compiler] - ) - cfg_file_to_duplicates = spack.compilers.get_compiler_duplicates( - "gcc@4.5.0", spack.spec.ArchSpec("cray-CNL-xeon") - ) - - assert len(cfg_file_to_duplicates) == 1 - cfg_file, duplicates = next(iter(cfg_file_to_duplicates.items())) - assert len(duplicates) == 1 - - def test_compiler_flags_from_config_are_grouped(): compiler_entry = { "spec": "intel@17.0.2", |