Skip to content

Commit

Permalink
also consider $CRAY_PE_LIBSCI_PREFIX_DIR to determine installation pr…
Browse files Browse the repository at this point in the history
…efix for cray-libsci (fixes easybuilders#4536)
  • Loading branch information
boegel committed Jun 6, 2024
1 parent 35c7f33 commit 8718140
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions easybuild/toolchains/linalg/libsci.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,20 @@ def _get_software_root(self, name, required=True):
"""Get install prefix for specified software name; special treatment for Cray modules."""
if name == 'cray-libsci':
# Cray-provided LibSci module
env_var = 'CRAY_LIBSCI_PREFIX_DIR'
root = os.getenv(env_var, None)
if root is None:
cray_libsci_root = None
# consider both $CRAY_LIBSCI_PREFIX_DIR and $CRAY_PE_LIBSCI_PREFIX_DIR,
# cfr. https://github.com/easybuilders/easybuild-framework/issues/4536
env_vars = ('CRAY_LIBSCI_PREFIX_DIR', 'CRAY_PE_LIBSCI_PREFIX_DIR')
for env_var in env_vars:
cray_libsci_root = os.getenv(env_var, None)
if cray_libsci_root is not None:
self.log.debug("Obtained install prefix for %s via $%s: %s", name, env_var, cray_libsci_root)
break

if cray_libsci_root is None:
if required:
raise EasyBuildError("Failed to determine install prefix for %s via $%s", name, env_var)
env_vars_str = ', '.join('$' + e for e in env_vars)
raise EasyBuildError("Failed to determine install prefix for %s via $%s", name, env_vars_str)
else:
self.log.debug("Obtained install prefix for %s via $%s: %s", name, env_var, root)
else:
Expand Down

0 comments on commit 8718140

Please sign in to comment.