|
1 | 1 | # Hooks to customize how EasyBuild installs software in EESSI |
2 | 2 | # see https://docs.easybuild.io/en/latest/Hooks.html |
| 3 | +import glob |
3 | 4 | import os |
4 | 5 | import re |
5 | 6 |
|
@@ -373,6 +374,34 @@ def pre_configure_hook_BLIS_a64fx(self, *args, **kwargs): |
373 | 374 | else: |
374 | 375 | raise EasyBuildError("BLIS-specific hook triggered for non-BLIS easyconfig?!") |
375 | 376 |
|
| 377 | +def pre_configure_hook_extrae(self, *args, **kwargs): |
| 378 | + """ |
| 379 | + Pre-configure hook for Extrae |
| 380 | + - avoid use of 'which' in configure script |
| 381 | + - specify correct path to binutils/zlib (in compat layer) |
| 382 | + """ |
| 383 | + if self.name == 'Extrae': |
| 384 | + |
| 385 | + # determine path to Prefix installation in compat layer via $EPREFIX |
| 386 | + eprefix = get_eessi_envvar('EPREFIX') |
| 387 | + |
| 388 | + binutils_lib_path_glob_pattern = os.path.join(eprefix, 'usr', 'lib*', 'binutils', '*-linux-gnu', '2.*') |
| 389 | + binutils_lib_path = glob.glob(binutils_lib_path_glob_pattern) |
| 390 | + if len(binutils_lib_path) == 1: |
| 391 | + self.cfg.update('configopts', '--with-binutils=' + binutils_lib_path[0]) |
| 392 | + else: |
| 393 | + raise EasyBuildError("Failed to isolate path for binutils libraries using %s, got %s", |
| 394 | + binutils_lib_path_glob_pattern, binutils_lib_path) |
| 395 | + |
| 396 | + # zlib is a filtered dependency, so we need to manually specify it's location to avoid the host version |
| 397 | + self.cfg.update('configopts', '--with-libz=' + eprefix) |
| 398 | + |
| 399 | + # replace use of 'which' with 'command -v', since 'which' is broken in EESSI build container; |
| 400 | + # this must be done *after* running configure script, because initial configuration re-writes configure script, |
| 401 | + # and problem due to use of which only pops up when running make ?! |
| 402 | + 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 && ") |
| 403 | + else: |
| 404 | + raise EasyBuildError("Extrae-specific hook triggered for non-Extrae easyconfig?!") |
376 | 405 |
|
377 | 406 | def pre_configure_hook_gromacs(self, *args, **kwargs): |
378 | 407 | """ |
@@ -732,6 +761,7 @@ def inject_gpu_property(ec): |
732 | 761 | PRE_CONFIGURE_HOOKS = { |
733 | 762 | 'at-spi2-core': pre_configure_hook_atspi2core_filter_ld_library_path, |
734 | 763 | 'BLIS': pre_configure_hook_BLIS_a64fx, |
| 764 | + 'Extrae': pre_configure_hook_extrae, |
735 | 765 | 'GROMACS': pre_configure_hook_gromacs, |
736 | 766 | 'libfabric': pre_configure_hook_libfabric_disable_psm3_x86_64_generic, |
737 | 767 | 'MetaBAT': pre_configure_hook_metabat_filtered_zlib_dep, |
|
0 commit comments