From d5e1b1ae1e5a3214e1ae16e3dba32e064ddf10b4 Mon Sep 17 00:00:00 2001 From: Richard Top Date: Mon, 29 Sep 2025 17:11:00 +0000 Subject: [PATCH 1/2] changes required for GRASS --- eb_hooks.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/eb_hooks.py b/eb_hooks.py index 953bbe65..76e74ed9 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -409,6 +409,26 @@ def parse_hook_cgal_toolchainopts_precise(ec, eprefix): raise EasyBuildError("CGAL-specific hook triggered for non-CGAL easyconfig?!") +def parse_hook_grass(ec, *args, **kwargs): + """ + Parse hook to remove filtered deps specific configopts lines for readline, zlib, and bzlib + """ + if ec.name == 'GRASS': + # Configuration options to remove + options_to_remove = [ + '--with-readline-libs=$EBROOTLIBREADLINE/lib --with-readline-includes=$EBROOTLIBREADLINE/include ', + '--with-zlib-libs=$EBROOTZLIB/lib --with-zlib-includes=$EBROOTZLIB/include ', + '--with-bzlib --with-bzlib-libs=$EBROOTBZIP2/lib --with-bzlib-includes=$EBROOTBZIP2/include ' + ] + current_configopts = ec.get('configopts', '') + for option in options_to_remove: + current_configopts = current_configopts.replace(option, '') + ec['configopts'] = current_configopts.strip() + print_msg("Using custom configure options for %s", ec.name) + else: + raise EasyBuildError("GRASS-specific hook triggered for non-GRASS easyconfig?!") + + def parse_hook_fontconfig_add_fonts(ec, eprefix): """Inject --with-add-fonts configure option for fontconfig.""" if ec.name == 'fontconfig': @@ -1579,6 +1599,7 @@ def post_easyblock_hook(self, *args, **kwargs): PARSE_HOOKS = { 'casacore': parse_hook_casacore_disable_vectorize, 'CGAL': parse_hook_cgal_toolchainopts_precise, + 'GRASS': parse_hook_grass, 'fontconfig': parse_hook_fontconfig_add_fonts, 'FreeImage': parse_hook_freeimage_aarch64, 'grpcio': parse_hook_grpcio_zlib, From a6c8c1c190dfe0d96e6110919a7f00508f9f87c1 Mon Sep 17 00:00:00 2001 From: Richard Top Date: Tue, 30 Sep 2025 09:24:26 +0000 Subject: [PATCH 2/2] replaced the hook with a pre_configure_hook --- eb_hooks.py | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/eb_hooks.py b/eb_hooks.py index 76e74ed9..3932eb6b 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -409,26 +409,6 @@ def parse_hook_cgal_toolchainopts_precise(ec, eprefix): raise EasyBuildError("CGAL-specific hook triggered for non-CGAL easyconfig?!") -def parse_hook_grass(ec, *args, **kwargs): - """ - Parse hook to remove filtered deps specific configopts lines for readline, zlib, and bzlib - """ - if ec.name == 'GRASS': - # Configuration options to remove - options_to_remove = [ - '--with-readline-libs=$EBROOTLIBREADLINE/lib --with-readline-includes=$EBROOTLIBREADLINE/include ', - '--with-zlib-libs=$EBROOTZLIB/lib --with-zlib-includes=$EBROOTZLIB/include ', - '--with-bzlib --with-bzlib-libs=$EBROOTBZIP2/lib --with-bzlib-includes=$EBROOTBZIP2/include ' - ] - current_configopts = ec.get('configopts', '') - for option in options_to_remove: - current_configopts = current_configopts.replace(option, '') - ec['configopts'] = current_configopts.strip() - print_msg("Using custom configure options for %s", ec.name) - else: - raise EasyBuildError("GRASS-specific hook triggered for non-GRASS easyconfig?!") - - def parse_hook_fontconfig_add_fonts(ec, eprefix): """Inject --with-add-fonts configure option for fontconfig.""" if ec.name == 'fontconfig': @@ -804,6 +784,24 @@ def pre_configure_hook_CUDA_Samples_test_remove(self, *args, **kwargs): raise EasyBuildError("CUDA-Samples-specific hook triggered for non-CUDA-Samples easyconfig?!") +def pre_configure_hook_grass(self, *args, **kwargs): + """ + Pre-configure hook for GRASS to remove filtered deps specific configopts lines for readline, zlib, and bzlib + """ + if self.name == 'GRASS': + # determine path to Prefix installation in compat layer via $EPREFIX + eprefix = get_eessi_envvar('EPREFIX') + + # Dependencies for which the configuration options need to be replaced + filtered_deps = ['readline', 'zlib', 'bzlib'] + for dep in filtered_deps: + self.cfg['configopts'] = re.sub(fr'--with-{dep}-includes=\S*', f'--with-{dep}-includes=$EPREFIX/usr/include', self.cfg['configopts']) + self.cfg['configopts'] = re.sub(fr'--with-{dep}-libs=\S*', f'--with-{dep}-libs=$EPREFIX/usr/lib64', self.cfg['configopts']) + print_msg("Using custom configure options for %s", self.name) + else: + raise EasyBuildError("GRASS-specific hook triggered for non-GRASS easyconfig?!") + + def pre_configure_hook_score_p(self, *args, **kwargs): """ Pre-configure hook for Score-p @@ -1599,7 +1597,6 @@ def post_easyblock_hook(self, *args, **kwargs): PARSE_HOOKS = { 'casacore': parse_hook_casacore_disable_vectorize, 'CGAL': parse_hook_cgal_toolchainopts_precise, - 'GRASS': parse_hook_grass, 'fontconfig': parse_hook_fontconfig_add_fonts, 'FreeImage': parse_hook_freeimage_aarch64, 'grpcio': parse_hook_grpcio_zlib, @@ -1625,6 +1622,7 @@ def post_easyblock_hook(self, *args, **kwargs): 'CUDA-Samples': pre_configure_hook_CUDA_Samples_test_remove, 'GObject-Introspection': pre_configure_hook_gobject_introspection, 'Extrae': pre_configure_hook_extrae, + 'GRASS': pre_configure_hook_grass, 'GROMACS': pre_configure_hook_gromacs, 'libfabric': pre_configure_hook_libfabric_disable_psm3_x86_64_generic, 'LLVM': pre_configure_hook_llvm,