Reverted back all architecture way of finding modules

This commit is contained in:
Mario Melara 2015-10-30 15:58:49 -07:00
parent 2d87bb92ed
commit e39586c81d

View file

@ -38,7 +38,6 @@
from spack.spec import CompilerSpec from spack.spec import CompilerSpec
description = "Manage compilers" description = "Manage compilers"
ARCHITECTURE = spack.architecture.sys_type()
def setup_parser(subparser): def setup_parser(subparser):
sp = subparser.add_subparsers(metavar='SUBCOMMAND', dest='compiler_command') sp = subparser.add_subparsers(metavar='SUBCOMMAND', dest='compiler_command')
@ -59,30 +58,23 @@ def compiler_add(args):
"""Search either $PATH or a list of paths OR MODULES for compilers and add them """Search either $PATH or a list of paths OR MODULES for compilers and add them
to Spack's configuration.""" to Spack's configuration."""
strategies = ARCHITECTURE.strategy()
for strategy in strategies: paths = args.add_paths # This might be a parser method. Parsing method to add_paths
if strategy == 'PATH': if not paths:
paths = args.add_paths # This might be a parser method. Parsing method to add_paths paths = get_path('PATH')
if not paths:
paths = get_path('PATH')
compilers = [c for c in spack.compilers.find_compilers(*args.add_paths) compilers = [c for c in spack.compilers.find_compilers(*args.add_paths)
if c.spec not in spack.compilers.all_compilers()] if c.spec not in spack.compilers.all_compilers()]
elif strategy == "MODULES":
from spack.compilers.cray import Cray
compilers = Cray.find_in_modules()
#TODO: Find a way to locate the executables
if compilers: if compilers:
spack.compilers.add_compilers_to_config('user', *compilers) spack.compilers.add_compilers_to_config('user', *compilers)
n = len(compilers) n = len(compilers)
tty.msg("Added %d new compiler%s to %s" % ( tty.msg("Added %d new compiler%s to %s" % (
n, 's' if n > 1 else '', spack.config.get_config_scope_filename('user', 'compilers'))) n, 's' if n > 1 else '', spack.config.get_config_scope_filename('user', 'compilers')))
colify(reversed(sorted(c.spec for c in compilers)), indent=4) colify(reversed(sorted(c.spec for c in compilers)), indent=4)
else: else:
tty.msg("Found no new compilers") tty.msg("Found no new compilers")
def compiler_remove(args): def compiler_remove(args):