Retrieve environment-modules prefix based on architecture (#10975)

When multiple instances of environment-modules were installed with
different architectures, Spack was not retrieving the installation
appropriate for the current architecture when finding the module
prefix.
This commit is contained in:
ajw1980 2019-03-26 15:23:17 -05:00 committed by Peter Scheibel
parent 7a4712b90a
commit e5b86c5527

View file

@ -584,7 +584,8 @@ def shell_set(var, value):
# print environment module system if available. This can be expensive # print environment module system if available. This can be expensive
# on clusters, so skip it if not needed. # on clusters, so skip it if not needed.
if 'modules' in info: if 'modules' in info:
specs = spack.store.db.query('environment-modules') specs = spack.store.db.query(
'environment-modules arch=%s' % spack.architecture.sys_type())
if specs: if specs:
shell_set('_sp_module_prefix', specs[-1].prefix) shell_set('_sp_module_prefix', specs[-1].prefix)
else: else: