summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/bootstrap.py8
-rw-r--r--lib/spack/spack/main.py6
2 files changed, 11 insertions, 3 deletions
diff --git a/lib/spack/spack/cmd/bootstrap.py b/lib/spack/spack/cmd/bootstrap.py
index 71db75c788..96cb8ccaa9 100644
--- a/lib/spack/spack/cmd/bootstrap.py
+++ b/lib/spack/spack/cmd/bootstrap.py
@@ -3,6 +3,7 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+import llnl.util.cpu
import llnl.util.tty as tty
import spack.repo
@@ -56,7 +57,12 @@ def bootstrap(parser, args, **kwargs):
# Define requirement dictionary defining general specs which need
# to be satisfied, and the specs to install when the general spec
# isn't satisfied.
- requirement_dict = {'environment-modules': 'environment-modules~X'}
+ requirement_dict = {
+ # Install environment-modules with generic optimizations
+ 'environment-modules': 'environment-modules~X target={0}'.format(
+ llnl.util.cpu.host().family
+ )
+ }
for requirement in requirement_dict:
installed_specs = spack.store.db.query(requirement)
diff --git a/lib/spack/spack/main.py b/lib/spack/spack/main.py
index 89b4d3dc85..ff2ff74da3 100644
--- a/lib/spack/spack/main.py
+++ b/lib/spack/spack/main.py
@@ -20,6 +20,7 @@ import traceback
import warnings
from six import StringIO
+import llnl.util.cpu
import llnl.util.tty as tty
import llnl.util.tty.color as color
from llnl.util.tty.log import log_output
@@ -621,8 +622,9 @@ def print_setup_info(*info):
# print environment module system if available. This can be expensive
# on clusters, so skip it if not needed.
if 'modules' in info:
- specs = spack.store.db.query(
- 'environment-modules arch=%s' % spack.architecture.sys_type())
+ generic_arch = llnl.util.cpu.host().family
+ module_spec = 'environment-modules target={0}'.format(generic_arch)
+ specs = spack.store.db.query(module_spec)
if specs:
shell_set('_sp_module_prefix', specs[-1].prefix)
else: