diff options
author | Mario Melara <maamelara@gmail.com> | 2015-10-30 15:58:49 -0700 |
---|---|---|
committer | Mario Melara <maamelara@gmail.com> | 2015-10-30 15:58:49 -0700 |
commit | e39586c81da152e8d02fd26bf48c66e00e26519a (patch) | |
tree | f9cc65b2b2f0514e987d55bcd446bac2a1f6c015 /lib | |
parent | 2d87bb92edb95cf1c9ec7d58f5d8a34e44bd11a4 (diff) | |
download | spack-e39586c81da152e8d02fd26bf48c66e00e26519a.tar.gz spack-e39586c81da152e8d02fd26bf48c66e00e26519a.tar.bz2 spack-e39586c81da152e8d02fd26bf48c66e00e26519a.tar.xz spack-e39586c81da152e8d02fd26bf48c66e00e26519a.zip |
Reverted back all architecture way of finding modules
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/cmd/compiler.py | 40 |
1 files changed, 16 insertions, 24 deletions
diff --git a/lib/spack/spack/cmd/compiler.py b/lib/spack/spack/cmd/compiler.py index cbe3aba864..3e86928977 100644 --- a/lib/spack/spack/cmd/compiler.py +++ b/lib/spack/spack/cmd/compiler.py @@ -38,7 +38,6 @@ from spack.util.environment import get_path from spack.spec import CompilerSpec description = "Manage compilers" -ARCHITECTURE = spack.architecture.sys_type() def setup_parser(subparser): 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 to Spack's configuration.""" - strategies = ARCHITECTURE.strategy() - for strategy in strategies: - if strategy == 'PATH': - paths = args.add_paths # This might be a parser method. Parsing method to add_paths - if not paths: - paths = get_path('PATH') - - compilers = [c for c in spack.compilers.find_compilers(*args.add_paths) - 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: - spack.compilers.add_compilers_to_config('user', *compilers) - n = len(compilers) - tty.msg("Added %d new compiler%s to %s" % ( - 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) - else: - tty.msg("Found no new compilers") + paths = args.add_paths # This might be a parser method. Parsing method to add_paths + if not paths: + paths = get_path('PATH') + + compilers = [c for c in spack.compilers.find_compilers(*args.add_paths) + if c.spec not in spack.compilers.all_compilers()] + + + if compilers: + spack.compilers.add_compilers_to_config('user', *compilers) + n = len(compilers) + tty.msg("Added %d new compiler%s to %s" % ( + 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) + else: + tty.msg("Found no new compilers") def compiler_remove(args): |