Remove "get_compiler_duplicates" (#46077)
This function is used only in tests.
This commit is contained in:
parent
699735016f
commit
f9065f0c7e
@ -599,24 +599,6 @@ def compiler_for_spec(compiler_spec, arch_spec):
|
|||||||
return compilers[0]
|
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
|
@llnl.util.lang.memoized
|
||||||
def class_for_compiler_name(compiler_name):
|
def class_for_compiler_name(compiler_name):
|
||||||
"""Given a compiler module name, get the corresponding Compiler class."""
|
"""Given a compiler module name, get the corresponding Compiler class."""
|
||||||
|
@ -42,25 +42,6 @@ def test_multiple_conflicting_compiler_definitions(mutable_config):
|
|||||||
assert cmp.f77 == "f77"
|
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():
|
def test_compiler_flags_from_config_are_grouped():
|
||||||
compiler_entry = {
|
compiler_entry = {
|
||||||
"spec": "intel@17.0.2",
|
"spec": "intel@17.0.2",
|
||||||
|
Loading…
Reference in New Issue
Block a user