diff --git a/Custom_Hooks/eb_hooks.py b/Custom_Hooks/eb_hooks.py index c0f10edfeae49ecea864f6bbfbd75bc322787420..b771bf8b0cf9cae59835411c0719b98497c78fa4 100644 --- a/Custom_Hooks/eb_hooks.py +++ b/Custom_Hooks/eb_hooks.py @@ -42,6 +42,15 @@ SUPPORTED_TOOLCHAIN_FAMILIES = ( + SUPPORTED_MPI_TOOLCHAIN_FAMILIES + SUPPORTED_TOPLEVEL_TOOLCHAIN_FAMILIES ) +VETOED_INSTALLATIONS = { + 'juwelsbooster': ['impi'], + 'juwels': [], + 'jurecadc': [], + 'jurecabooster': ['OpenMPI', 'CUDA', 'nvidia-driver', 'UCX', 'NVHPC'] + 'jusuf': ['impi'], + 'hdfml': [], +} + # Also maintain a list of CUDA enabled compilers CUDA_ENABLED_TOOLCHAINS = ["pmvmklc", "gmvmklc", "gmvapich2c", "pmvapich2c"] # Use this for a heuristic to see if the easyconfig comes from the Golden Repo @@ -184,10 +193,28 @@ family("mpi") " eb --robot=$EASYBUILD_ROBOT:$EBROOTEASYBUILD/easybuild/easyconfigs --try-update-deps ...." ) +def installation_vetoer(self): + "Check whether this package is NOT supposed to be installed in this system, and abort if necessary" + ec = self.cfg + name = ec['name'] + system_name = os.getenv('SYSTEMNAME') + if name in VETOED_INSTALLATIONS[system_name]: + print_warning( + "\nYou are attempting to install software that should not be installed in this system.\n" + "\nPlease double check the list of packages that you are attempting to install. The following\n" + f"\npackages can't be installed in {system_name}:\n" + ) + for package in VETOED_INSTALLATIONS[system_name]: + print_warning(f"- {package}\n") + exit(1) def pre_ready_hook(self, *args, **kwargs): "When we are building something, do some checks for bad behaviour" ec = self.cfg + + # First of all check if this should be installed + installation_vetoer(ec) + # Grab name, path, toolchain, install path and check if we are installing # GCCcore/MPI name = ec["name"]