@@ -422,6 +422,37 @@ def pre_fetch_hook(self, *args, **kwargs):
422422 if cpu_target == CPU_TARGET_ZEN4 :
423423 pre_fetch_hook_zen4_gcccore1220 (self , * args , ** kwargs )
424424
425+ # Always check the software installation path
426+ pre_fetch_hook_check_installation_path (self , * args , ** kwargs )
427+
428+
429+ # Check the installation path so we verify that accelerator software always gets installed into the correct location
430+ def pre_fetch_hook_check_installation_path (self , * args , ** kwargs ):
431+ # When we know the CUDA status, we will need to verify the installation path
432+ # if we are doing an EESSI or host_injections installation
433+ accelerator_deps = ['CUDA' ]
434+ strict_eessi_installation = (
435+ bool (re .search (EESSI_INSTALLATION_REGEX , self .installdir )) or
436+ self .installdir .startswith (HOST_INJECTIONS_LOCATION ))
437+ if strict_eessi_installation :
438+ dependency_names = self .cfg .dependency_names ()
439+ if self .cfg .name in accelerator_deps or any (dep in dependency_names for dep in accelerator_deps ):
440+ # Make sure the path is an accelerator location
441+ if "/accel/" not in self .installdir :
442+ raise EasyBuildError (
443+ f"It seems you are trying to install an accelerator package { self .cfg .name } into a "
444+ f"non-accelerator location { self .installdir } . You need to reconfigure your installation to target "
445+ "the correct location."
446+ )
447+ else :
448+ # If we don't have an accelerator dependency then we should be in a CPU installation path
449+ if "/accel/" in self .installdir :
450+ raise EasyBuildError (
451+ f"It seems you are trying to install a CPU-only package { self .cfg .name } into accelerator location "
452+ f"{ self .installdir } . If this is a dependency of the package you are really interested in you will "
453+ "need to first install the CPU-only dependencies of that package."
454+ )
455+
425456
426457def pre_fetch_hook_zen4_gcccore1220 (self , * args , ** kwargs ):
427458 """Use --force --module-only if building a foss-2022b-based EasyConfig for Zen4.
@@ -600,6 +631,18 @@ def pre_configure_hook_score_p(self, *args, **kwargs):
600631 raise EasyBuildError ("Score-P-specific hook triggered for non-Score-P easyconfig?!" )
601632
602633
634+ def pre_configure_hook_vsearch (self , * args , ** kwargs ):
635+ """
636+ Pre-configure hook for VSEARCH
637+ - Workaround for a Zlib macro being renamed in Gentoo, see https://bugs.gentoo.org/383179
638+ (solves "expected initializer before 'OF'" errors)
639+ """
640+ if self .name == 'VSEARCH' :
641+ self .cfg .update ('configopts' , 'CPPFLAGS="-DOF=_Z_OF ${CPPFLAGS}"' )
642+ else :
643+ raise EasyBuildError ("VSEARCH-specific hook triggered for non-VSEARCH easyconfig?!" )
644+
645+
603646def pre_configure_hook_extrae (self , * args , ** kwargs ):
604647 """
605648 Pre-configure hook for Extrae
@@ -1286,6 +1329,7 @@ def post_module_hook(self, *args, **kwargs):
12861329 'WRF' : pre_configure_hook_wrf_aarch64 ,
12871330 'LAMMPS' : pre_configure_hook_LAMMPS_zen4 ,
12881331 'Score-P' : pre_configure_hook_score_p ,
1332+ 'VSEARCH' : pre_configure_hook_vsearch ,
12891333}
12901334
12911335PRE_TEST_HOOKS = {
0 commit comments