Skip to content

Commit

Permalink
add pre-configure hook for Extrae to fix build of Extrae v4.0.6 in EESSI
Browse files Browse the repository at this point in the history
  • Loading branch information
boegel committed May 12, 2024
1 parent ad8d708 commit 41149ac
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions eb_hooks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Hooks to customize how EasyBuild installs software in EESSI
# see https://docs.easybuild.io/en/latest/Hooks.html
import glob
import os
import re

Expand Down Expand Up @@ -335,6 +336,33 @@ def pre_configure_hook(self, *args, **kwargs):
PRE_CONFIGURE_HOOKS[self.name](self, *args, **kwargs)


def pre_configure_hook_extrae(self, *args, **kwargs):
"""
Pre-configure hook for Extrae
- avoid use of 'which' in configure script
- specify correct path to binutils (in compat layer)
"""
if self.name == 'Extrae':

# determine path to Prefix installation in compat layer via $EPREFIX
eprefix = get_eessi_envvar('EPREFIX')

binutils_lib_path_glob_pattern = os.path.join(eprefix, 'usr', 'lib*', 'binutils', '*-pc-linux-gnu', '2.*')
binutils_lib_path = glob.glob(binutils_lib_path_glob_pattern)
if len(binutils_lib_path) == 1:
self.cfg.update('configopts', '--with-binutils=' + binutils_lib_path[0])
else:
raise EasyBuildError("Failed to isolate path for binutils libraries using %s, got %s",
binutils_lib_path_glob_pattern, binutils_lib_path)

# replace use of 'which' with 'command -v', since 'which' is broken in EESSI build container;
# this must be done *after* running configure script, because initial configuration re-writes configure script,
# and problem due to use of which only pops up when running make ?!
self.cfg.update('prebuildopts', "cp config/mpi-macros.m4 config/mpi-macros.m4.orig && sed -i 's/`which /`command -v /g' config/mpi-macros.m4 && ")
else:
raise EasyBuildError("Extrae-specific hook triggered for non-Extrae easyconfig?!")


def pre_configure_hook_gromacs(self, *args, **kwargs):
"""
Pre-configure hook for GROMACS:
Expand Down Expand Up @@ -680,6 +708,7 @@ def inject_gpu_property(ec):
}

PRE_CONFIGURE_HOOKS = {
'Extrae': pre_configure_hook_extrae,
'GROMACS': pre_configure_hook_gromacs,
'libfabric': pre_configure_hook_libfabric_disable_psm3_x86_64_generic,
'MetaBAT': pre_configure_hook_metabat_filtered_zlib_dep,
Expand Down

0 comments on commit 41149ac

Please sign in to comment.