summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTiziano Müller <tiziano.mueller@hpe.com>2023-05-31 03:03:44 +0200
committerGitHub <noreply@github.com>2023-05-30 18:03:44 -0700
commit0f84782fccfcb5e57ecb0351fb629060100f337c (patch)
tree208a02f6193c7cc718467330b4204e619ac6fa1b /lib
parent43b86ce28270943849056893d0265db6e14bf2aa (diff)
downloadspack-0f84782fccfcb5e57ecb0351fb629060100f337c.tar.gz
spack-0f84782fccfcb5e57ecb0351fb629060100f337c.tar.bz2
spack-0f84782fccfcb5e57ecb0351fb629060100f337c.tar.xz
spack-0f84782fccfcb5e57ecb0351fb629060100f337c.zip
Bugfix: cray manifest parsing regression (#37909)
fa7719a changed syntax for specifying exact versions, which are required for some compiler specs (including those read as part of parsing a Cray manifest). This fixes that and also makes a couple other improvements to manifest parsing. * Instantiate compiler specs with exact versions (fixes #37893) * fix slingshot network detection (CPE 22.10+ has libcxi.so in /usr/lib64) * "spack external find": add arg to ignore default dir for cray manifests
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/external.py15
-rw-r--r--lib/spack/spack/cray_manifest.py3
-rw-r--r--lib/spack/spack/platforms/cray.py4
3 files changed, 18 insertions, 4 deletions
diff --git a/lib/spack/spack/cmd/external.py b/lib/spack/spack/cmd/external.py
index d859ad9d7a..6c794a70f2 100644
--- a/lib/spack/spack/cmd/external.py
+++ b/lib/spack/spack/cmd/external.py
@@ -80,6 +80,12 @@ def setup_parser(subparser):
"--directory", default=None, help="specify a directory storing a group of manifest files"
)
read_cray_manifest.add_argument(
+ "--ignore-default-dir",
+ action="store_true",
+ default=False,
+ help="ignore the default directory of manifest files",
+ )
+ read_cray_manifest.add_argument(
"--dry-run",
action="store_true",
default=False,
@@ -177,11 +183,16 @@ def external_read_cray_manifest(args):
manifest_directory=args.directory,
dry_run=args.dry_run,
fail_on_error=args.fail_on_error,
+ ignore_default_dir=args.ignore_default_dir,
)
def _collect_and_consume_cray_manifest_files(
- manifest_file=None, manifest_directory=None, dry_run=False, fail_on_error=False
+ manifest_file=None,
+ manifest_directory=None,
+ dry_run=False,
+ fail_on_error=False,
+ ignore_default_dir=False,
):
manifest_files = []
if manifest_file:
@@ -191,7 +202,7 @@ def _collect_and_consume_cray_manifest_files(
if manifest_directory:
manifest_dirs.append(manifest_directory)
- if os.path.isdir(cray_manifest.default_path):
+ if not ignore_default_dir and os.path.isdir(cray_manifest.default_path):
tty.debug(
"Cray manifest path {0} exists: collecting all files to read.".format(
cray_manifest.default_path
diff --git a/lib/spack/spack/cray_manifest.py b/lib/spack/spack/cray_manifest.py
index 4fdbc095e5..13a7fc43f0 100644
--- a/lib/spack/spack/cray_manifest.py
+++ b/lib/spack/spack/cray_manifest.py
@@ -48,7 +48,8 @@ def translated_compiler_name(manifest_compiler_name):
def compiler_from_entry(entry):
compiler_name = translated_compiler_name(entry["name"])
paths = entry["executables"]
- version = entry["version"]
+ # to instantiate a compiler class we may need a concrete version:
+ version = "={}".format(entry["version"])
arch = entry["arch"]
operating_system = arch["os"]
target = arch["target"]
diff --git a/lib/spack/spack/platforms/cray.py b/lib/spack/spack/platforms/cray.py
index 3d88285f70..10294676ec 100644
--- a/lib/spack/spack/platforms/cray.py
+++ b/lib/spack/spack/platforms/cray.py
@@ -37,7 +37,9 @@ _xc_craype_dir = "/opt/cray/pe/cdt"
def slingshot_network():
- return os.path.exists("/opt/cray/pe") and os.path.exists("/lib64/libcxi.so")
+ return os.path.exists("/opt/cray/pe") and (
+ os.path.exists("/lib64/libcxi.so") or os.path.exists("/usr/lib64/libcxi.so")
+ )
def _target_name_from_craype_target_name(name):