Skip to content

Commit ba12f61

Browse files
committed
Allow LLVM hook to run from within a Bundle
1 parent 463f564 commit ba12f61

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

eb_hooks.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -897,12 +897,24 @@ def pre_configure_hook_llvm(self, *args, **kwargs):
897897
into pointing to the compat layer.
898898
"""
899899
if self.name in ['LLVM', 'ROCm-LLVM']:
900+
from easybuild.easyblocks.generic.bundle import Bundle
901+
from easybuild.easyblocks.llvm import EB_LLVM
902+
900903
eprefix = get_eessi_envvar('EPREFIX')
901904

902-
for software in ('zlib', 'ncurses'):
903-
var_name = get_software_root_env_var_name(software)
904-
env.setvar(var_name, os.path.join(eprefix, 'usr'))
905-
self.deps.append(software)
905+
def recursive_set_deps(item, softwares):
906+
if isinstance(item, (list, tuple)):
907+
for item in item:
908+
recursive_set_deps(item, softwares)
909+
elif isinstance(item, Bundle):
910+
recursive_set_deps(item.comp_instances, softwares)
911+
elif isinstance(item, EB_LLVM):
912+
for sftw in softwares:
913+
var_name = get_software_root_env_var_name(sftw)
914+
env.setvar(var_name, os.path.join(eprefix, 'usr'))
915+
item.deps.append(sftw)
916+
917+
recursive_set_deps(self, softwares=('zlib', 'ncurses'))
906918
else:
907919
raise EasyBuildError("LLVM-specific hook triggered for non-LLVM easyconfig?!")
908920

0 commit comments

Comments
 (0)