Got rid of my old method of finding in LOADEDMODULES

This commit is contained in:
Mario Melara 2015-11-13 11:47:36 -08:00
parent a5ba69d68d
commit 9458f7c7d0

View file

@ -283,13 +283,9 @@ def find_in_modules(cls):
modulecmd = which('modulecmd') modulecmd = which('modulecmd')
modulecmd.add_default_arg('python') modulecmd.add_default_arg('python')
output = modulecmd('avail', return_oe=True) output = modulecmd('avail', return_oe=True)
matches = re.findall(r'(%s)/([^\s(]*)' % cls.PrgEnv_compiler, output) matches = re.findall(r'(%s)/(\d+[\.\d]+)' % cls.PrgEnv_compiler, output)
# It's finding a weird third attribute
# loaded_modules = os.environ["LOADEDMODULES"].split(":") print matches
#output = _shell('module avail %s' % cls.PrgEnv_compiler)
# for module in loaded_modules:
# match = re.findall(r'(%s)/([^\s(]*)' % cls.PrgEnv_compiler, module)
for name, version in matches: for name, version in matches:
v = version v = version
comp = cls(spack.spec.CompilerSpec(name + '@' + v), comp = cls(spack.spec.CompilerSpec(name + '@' + v),