From 85e2ed64554bb027d6201c5a782eb00fe36c9804 Mon Sep 17 00:00:00 2001 From: Kenneth Hoste Date: Sat, 12 Nov 2022 17:29:44 +0100 Subject: [PATCH 1/2] enhance EasyBuild hooks to fix installation of MetaBAT in EESSI --- eb_hooks.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/eb_hooks.py b/eb_hooks.py index 653094266d..850b3da3b4 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -1,6 +1,7 @@ # Hooks to customize how EasyBuild installs software in EESSI # see https://docs.easybuild.io/en/latest/Hooks.html import os +import re from easybuild.tools.build_log import EasyBuildError, print_msg from easybuild.tools.config import build_option, update_build_option @@ -130,6 +131,23 @@ def pre_configure_hook(self, *args, **kwargs): PRE_CONFIGURE_HOOKS[self.name](self, *args, **kwargs) +def metabat_preconfigure(self, *args, **kwargs): + """ + Pre-configure hook for MetaBAT: + - take into account that zlib is a filtered dependency, + and that there's no libz.a in the EESSI compat layer + """ + if self.name == 'MetaBAT': + print("from metadata_preconfigure hook: %s" % self.cfg['configopts']) + configopts = self.cfg['configopts'] + regex = re.compile(r"\$EBROOTZLIB/lib/libz.a") + print(regex.search(configopts)) + self.cfg['configopts'] = regex.sub('$EPREFIX/usr/lib64/libz.so', configopts) + print(self.cfg['configopts']) + else: + raise EasyBuildError("MetaBAT-specific hook triggered for non-MetaBAT easyconfig?!") + + def wrf_preconfigure(self, *args, **kwargs): """ Pre-configure hook for WRF: @@ -144,6 +162,7 @@ def wrf_preconfigure(self, *args, **kwargs): else: raise EasyBuildError("WRF-specific hook triggered for non-WRF easyconfig?!") + PARSE_HOOKS = { 'CGAL': cgal_toolchainopts_precise, 'fontconfig': fontconfig_add_fonts, @@ -151,5 +170,6 @@ def wrf_preconfigure(self, *args, **kwargs): } PRE_CONFIGURE_HOOKS = { + 'MetaBAT': metabat_preconfigure, 'WRF': wrf_preconfigure, } From d48fbdf78ed0a60da70660f23a5a8643b3ea7bfe Mon Sep 17 00:00:00 2001 From: Kenneth Hoste Date: Wed, 14 Dec 2022 11:04:03 +0100 Subject: [PATCH 2/2] remove debug print statements in eb_hooks.py --- eb_hooks.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/eb_hooks.py b/eb_hooks.py index 850b3da3b4..1877e27b44 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -138,12 +138,9 @@ def metabat_preconfigure(self, *args, **kwargs): and that there's no libz.a in the EESSI compat layer """ if self.name == 'MetaBAT': - print("from metadata_preconfigure hook: %s" % self.cfg['configopts']) configopts = self.cfg['configopts'] regex = re.compile(r"\$EBROOTZLIB/lib/libz.a") - print(regex.search(configopts)) self.cfg['configopts'] = regex.sub('$EPREFIX/usr/lib64/libz.so', configopts) - print(self.cfg['configopts']) else: raise EasyBuildError("MetaBAT-specific hook triggered for non-MetaBAT easyconfig?!")