'find and 'add' are options for adding compilers via command line

This commit is contained in:
Mario Melara 2016-06-17 09:16:03 -07:00
parent df84fe0b58
commit fe5eec5230

View file

@ -69,7 +69,7 @@ def setup_parser(subparser):
help="Configuration scope to read from.") help="Configuration scope to read from.")
def compiler_add(args): def compiler_find(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."""
paths = args.add_paths paths = args.add_paths
@ -79,7 +79,6 @@ def compiler_add(args):
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(scope=args.scope, if c.spec not in spack.compilers.all_compilers(scope=args.scope,
init_config=False)] init_config=False)]
if compilers: if compilers:
spack.compilers.add_compilers_to_config(compilers, scope=args.scope, spack.compilers.add_compilers_to_config(compilers, scope=args.scope,
init_config=False) init_config=False)
@ -139,9 +138,10 @@ def compiler_list(args):
def compiler(parser, args): def compiler(parser, args):
action = { 'add' : compiler_add, action = {'add' : compiler_find,
'remove' : compiler_remove, 'find' : compiler_find,
'rm' : compiler_remove, 'remove' : compiler_remove,
'info' : compiler_info, 'rm' : compiler_remove,
'list' : compiler_list } 'info' : compiler_info,
'list' : compiler_list }
action[args.compiler_command](args) action[args.compiler_command](args)