From b6d2a12ceb090692aa2be363b46d7f25486c0245 Mon Sep 17 00:00:00 2001 From: Mario Melara Date: Wed, 7 Oct 2015 15:57:29 -0700 Subject: [PATCH] Started changing the find in modules method written by Todd --- lib/spack/spack/compiler.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/spack/spack/compiler.py b/lib/spack/spack/compiler.py index e7d450ee8b..cbe6d8cd7d 100644 --- a/lib/spack/spack/compiler.py +++ b/lib/spack/spack/compiler.py @@ -272,9 +272,11 @@ def find_in_modules(cls): if cls.PrgEnv: if not cls.PrgEnv_compiler: tty.die('Must supply PrgEnv_compiler with PrgEnv') - - output = _shell('module avail %s' % cls.PrgEnv_compiler) - matches = re.findall(r'(%s)/([^\s(]*)' % cls.PrgEnv_compiler, output) + + loaded_modules = os.environ["LOADEDMODULES"].split(":") + #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: v = version + '-craype'