Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions eb_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@

EESSI_INSTALLATION_REGEX = r"^/cvmfs/[^/]*.eessi.io/versions/"
HOST_INJECTIONS_LOCATION = "/cvmfs/software.eessi.io/host_injections/"
SITE_INSTALLATION_LOCATION = os.getenv("EESSI_SITE_SOFTWARE_PREFIX", HOST_INJECTIONS_LOCATION)

# Make sure a single environment variable name is used for this throughout the hooks
EESSI_IGNORE_ZEN4_GCC1220_ENVVAR="EESSI_IGNORE_LMOD_ERROR_ZEN4_GCC1220"
Expand Down Expand Up @@ -744,7 +745,7 @@ def pre_fetch_hook_check_installation_path(self, *args, **kwargs):
accelerator_toolchains = ['rocm-compilers', 'rompi', 'rfbf', 'rfoss']
strict_eessi_installation = (
bool(re.search(EESSI_INSTALLATION_REGEX, self.installdir)) or
self.installdir.startswith(HOST_INJECTIONS_LOCATION))
self.installdir.startswith(SITE_INSTALLATION_LOCATION))
if strict_eessi_installation and not os.getenv("EESSI_OVERRIDE_STRICT_INSTALLPATH_CHECK"):
dependency_names = self.cfg.dependency_names()
if (
Expand All @@ -757,15 +758,19 @@ def pre_fetch_hook_check_installation_path(self, *args, **kwargs):
raise EasyBuildError(
f"It seems you are trying to install an accelerator package {self.cfg.name} into a "
f"non-accelerator location {self.installdir}. You need to reconfigure your installation to target "
"the correct location."
"the correct location. If using the EESSI-extend module, this means reloading that module "
"with EESSI_ACCELERATOR_INSTALL set:\n"
" EESSI_ACCELERATOR_TARGET=1 module load EESSI-extend"
)
else:
# If we don't have an accelerator dependency then we should be in a CPU installation path
if "/accel/" in self.installdir:
raise EasyBuildError(
f"It seems you are trying to install a CPU-only package {self.cfg.name} into accelerator location "
f"{self.installdir}. If this is a dependency of the package you are really interested in you will "
"need to first install the CPU-only dependencies of that package."
"need to first install the CPU-only dependencies of that package. If using the EESSI-extend "
"module, this means reloading that module with EESSI_ACCELERATOR_INSTALL unset:\n"
" unset EESSI_ACCELERATOR_TARGET=1 && module load EESSI-extend"
)


Expand Down
Loading