From d4fd6bc5b81d91c62125679b3208c559a7aa6fa1 Mon Sep 17 00:00:00 2001 From: lara Date: Thu, 15 Feb 2024 11:15:19 +0100 Subject: [PATCH 1/2] add parse hook for LAMMPS CI + remove pre_configure_hook_LAMMPS_aarch64 see: https://github.com/easybuilders/easybuild-easyblocks/pull/3036 --- eb_hooks.py | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/eb_hooks.py b/eb_hooks.py index e24e80f395..0d6d894979 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -291,6 +291,19 @@ def parse_hook_ucx_eprefix(ec, eprefix): raise EasyBuildError("UCX-specific hook triggered for non-UCX easyconfig?!") +def parse_hook_lammps_remove_deps_for_CI_aarch64(ec, *args, **kwargs): + """ + Remove x86_64 specific dependencies for the CI to pass on aarch64 + """ + if ec.name == 'LAMMPS': + if ec.version == '2Aug2023_update2': + if os.getenv('EESSI_CPU_FAMILY') == 'aarch64': + ec['dependencies'].remove(('ScaFaCoS', '1.0.4')) + ec['dependencies'].remove(('tbb', '2021.11.0')) + else: + raise EasyBuildError("LAMMPS-specific hook triggered for non-LAMMPS easyconfig?!") + + def pre_configure_hook(self, *args, **kwargs): """Main pre-configure hook: trigger custom functions based on software name.""" if self.name in PRE_CONFIGURE_HOOKS: @@ -363,24 +376,6 @@ def pre_configure_hook_wrf_aarch64(self, *args, **kwargs): raise EasyBuildError("WRF-specific hook triggered for non-WRF easyconfig?!") -def pre_configure_hook_LAMMPS_aarch64(self, *args, **kwargs): - """ - pre-configure hook for LAMMPS: - - set kokkos_arch on Aarch64 - """ - - cpu_target = get_eessi_envvar('EESSI_SOFTWARE_SUBDIR') - if self.name == 'LAMMPS': - if self.version == '23Jun2022': - if get_cpu_architecture() == AARCH64: - if cpu_target == CPU_TARGET_AARCH64_GENERIC: - self.cfg['kokkos_arch'] = 'ARM80' - else: - self.cfg['kokkos_arch'] = 'ARM81' - else: - raise EasyBuildError("LAMMPS-specific hook triggered for non-LAMMPS easyconfig?!") - - def pre_configure_hook_atspi2core_filter_ld_library_path(self, *args, **kwargs): """ pre-configure hook for at-spi2-core: @@ -634,6 +629,7 @@ def inject_gpu_property(ec): 'pybind11': parse_hook_pybind11_replace_catch2, 'Qt5': parse_hook_qt5_check_qtwebengine_disable, 'UCX': parse_hook_ucx_eprefix, + 'LAMMPS': parse_hook_lammps_remove_deps_for_CI_aarch64, } POST_PREPARE_HOOKS = { @@ -645,7 +641,6 @@ def inject_gpu_property(ec): 'MetaBAT': pre_configure_hook_metabat_filtered_zlib_dep, 'OpenBLAS': pre_configure_hook_openblas_optarch_generic, 'WRF': pre_configure_hook_wrf_aarch64, - 'LAMMPS': pre_configure_hook_LAMMPS_aarch64, 'at-spi2-core': pre_configure_hook_atspi2core_filter_ld_library_path, } From 404ded595e0faa66e9500890fb8aca1b7ae3cbb4 Mon Sep 17 00:00:00 2001 From: Kenneth Hoste Date: Fri, 16 Feb 2024 07:29:00 +0100 Subject: [PATCH 2/2] fix hook for LAMMPS to filter out ScaFaCoS and tbb dependencies on aarch64/* --- eb_hooks.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/eb_hooks.py b/eb_hooks.py index 0d6d894979..ec86f988c3 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -295,11 +295,15 @@ def parse_hook_lammps_remove_deps_for_CI_aarch64(ec, *args, **kwargs): """ Remove x86_64 specific dependencies for the CI to pass on aarch64 """ - if ec.name == 'LAMMPS': - if ec.version == '2Aug2023_update2': - if os.getenv('EESSI_CPU_FAMILY') == 'aarch64': - ec['dependencies'].remove(('ScaFaCoS', '1.0.4')) - ec['dependencies'].remove(('tbb', '2021.11.0')) + if ec.name == 'LAMMPS' and ec.version in ('2Aug2023_update2',): + if os.getenv('EESSI_CPU_FAMILY') == 'aarch64': + # ScaFaCoS and tbb are not compatible with aarch64/* CPU targets, + # so remove them as dependencies for LAMMPS (they're optional); + # see also https://github.com/easybuilders/easybuild-easyconfigs/pull/19164 + + # https://github.com/easybuilders/easybuild-easyconfigs/pull/19000; + # we need this hook because we check for missing installations for all CPU targets + # on an x86_64 VM in GitHub Actions (so condition based on ARCH in LAMMPS easyconfig is always true) + ec['dependencies'] = [dep for dep in ec['dependencies'] if dep[0] not in ('ScaFaCoS', 'tbb')] else: raise EasyBuildError("LAMMPS-specific hook triggered for non-LAMMPS easyconfig?!")