Skip to content

Commit c580338

Browse files
committed
Address review comments
1 parent a3eddb4 commit c580338

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

eb_hooks.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232

3333
SYSTEM = EASYCONFIG_CONSTANTS['SYSTEM'][0]
3434

35+
EESSI_INSTALLATION_REGEX = r"^/cvmfs/[^/]*.eessi.io/versions/"
36+
HOST_INJECTIONS_LOCATION = "/cvmfs/software.eessi.io/host_injections/"
37+
3538

3639
def get_eessi_envvar(eessi_envvar):
3740
"""Get an EESSI environment variable from the environment"""
@@ -419,7 +422,7 @@ def pre_configure_hook_extrae(self, *args, **kwargs):
419422
# and problem due to use of which only pops up when running make ?!
420423
self.cfg.update(
421424
'prebuildopts',
422-
"cp config/mpi-macros.m4 config/mpi-macros.m4.orig &&"
425+
"cp config/mpi-macros.m4 config/mpi-macros.m4.orig && "
423426
"sed -i 's/`which /`command -v /g' config/mpi-macros.m4 && "
424427
)
425428
else:
@@ -698,9 +701,7 @@ def post_postproc_cuda(self, *args, **kwargs):
698701
"""
699702

700703
# We need to check if we are doing an EESSI-distributed installation
701-
eessi_pattern = r"^/cvmfs/[^/]*.eessi.io/versions/"
702-
host_injections_location = "/cvmfs/software.eessi.io/host_injections/"
703-
eessi_installation = bool(re.search(eessi_pattern, self.installdir))
704+
eessi_installation = bool(re.search(EESSI_INSTALLATION_REGEX, self.installdir))
704705

705706
if self.name == 'CUDA' and eessi_installation:
706707
print_msg("Replacing files in CUDA installation that we can not ship with symlinks to host_injections...")
@@ -752,12 +753,12 @@ def post_postproc_cuda(self, *args, **kwargs):
752753
# if it is not in the allowlist, delete the file and create a symlink to host_injections
753754

754755
# the host_injections path is under a fixed repo/location for CUDA
755-
host_inj_path = re.sub(eessi_pattern, host_injections_location, full_path)
756+
host_inj_path = re.sub(EESSI_INSTALLATION_REGEX, HOST_INJECTIONS_LOCATION, full_path)
756757
# CUDA itself doesn't care about compute capability so remove this duplication from
757-
# under host_injections
758+
# under host_injections (symlink to a single CUDA installation for all compute
759+
# capabilities)
758760
accel_subdir = os.getenv("EESSI_ACCELERATOR_TARGET")
759761
if accel_subdir:
760-
host_inj_path = host_inj_path.replace('/accel/%s' % accel_subdir, '')
761762
host_inj_path = host_inj_path.replace("/accel/%s" % accel_subdir, '')
762763
# make sure source and target of symlink are not the same
763764
if full_path == host_inj_path:

0 commit comments

Comments
 (0)