From 0f84782fccfcb5e57ecb0351fb629060100f337c Mon Sep 17 00:00:00 2001 From: Tiziano Müller Date: Wed, 31 May 2023 03:03:44 +0200 Subject: 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 --- lib/spack/spack/cmd/external.py | 15 +++++++++++++-- lib/spack/spack/cray_manifest.py | 3 ++- lib/spack/spack/platforms/cray.py | 4 +++- 3 files changed, 18 insertions(+), 4 deletions(-) (limited to 'lib') 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 @@ -79,6 +79,12 @@ def setup_parser(subparser): read_cray_manifest.add_argument( "--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", @@ -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): -- cgit v1.2.3-60-g2f50