|
14 | 14 | from easybuild.tools.systemtools import AARCH64, POWER, X86_64, get_cpu_architecture, get_cpu_features
|
15 | 15 | from easybuild.tools.toolchain.compiler import OPTARCH_GENERIC
|
16 | 16 | from easybuild.tools.version import VERSION as EASYBUILD_VERSION
|
| 17 | +from easybuild.tools.modules import get_software_root_env_var_name |
17 | 18 |
|
18 | 19 | # prefer importing LooseVersion from easybuild.tools, but fall back to distuils in case EasyBuild <= 4.7.0 is used
|
19 | 20 | try:
|
@@ -670,6 +671,27 @@ def pre_configure_hook_gromacs(self, *args, **kwargs):
|
670 | 671 | raise EasyBuildError("GROMACS-specific hook triggered for non-GROMACS easyconfig?!")
|
671 | 672 |
|
672 | 673 |
|
| 674 | +def pre_configure_hook_llvm(self, *args, **kwargs): |
| 675 | + """Adjust internal configure options for the LLVM EasyBlock to reinstate filtered out dependencies. |
| 676 | + In the LLVM EasyBlock, most checks concerning loaded modules are performed at the configure_step. |
| 677 | + The EB uses a global `general_opts` dict to keep track of options that needs to be reused across stages. |
| 678 | + The way the EB is structured does allow to inject a CMAKE option through `self._cfgopts` which is a splitted list |
| 679 | + of the `configure_opts` passed through the EC, but does not allow to override as the `general_opts` dict will |
| 680 | + take precedence over the `self._cfgopts` list. |
| 681 | +
|
| 682 | + We can instead set the environment variable that EasyBuild uses for `get_software_root` to trick the EB into |
| 683 | + into pointing to the compat layer. |
| 684 | + """ |
| 685 | + if self.name in ['LLVM', 'ROCm-LLVM']: |
| 686 | + eprefix = get_eessi_envvar('EPREFIX') |
| 687 | + |
| 688 | + for software in ('zlib', 'ncurses'): |
| 689 | + var_name = get_software_root_env_var_name(software) |
| 690 | + env.setvar(var_name, os.path.join(eprefix, 'usr')) |
| 691 | + else: |
| 692 | + raise EasyBuildError("LLVM-specific hook triggered for non-LLVM easyconfig?!") |
| 693 | + |
| 694 | + |
673 | 695 | def pre_configure_hook_openblas_optarch_generic(self, *args, **kwargs):
|
674 | 696 | """
|
675 | 697 | Pre-configure hook for OpenBLAS: add DYNAMIC_ARCH=1 to build/test/install options when using --optarch=GENERIC
|
@@ -1257,6 +1279,8 @@ def post_module_hook(self, *args, **kwargs):
|
1257 | 1279 | 'Extrae': pre_configure_hook_extrae,
|
1258 | 1280 | 'GROMACS': pre_configure_hook_gromacs,
|
1259 | 1281 | 'libfabric': pre_configure_hook_libfabric_disable_psm3_x86_64_generic,
|
| 1282 | + 'LLVM': pre_configure_hook_llvm, |
| 1283 | + 'ROCm-LLVM': pre_configure_hook_llvm, |
1260 | 1284 | 'MetaBAT': pre_configure_hook_metabat_filtered_zlib_dep,
|
1261 | 1285 | 'OpenBLAS': pre_configure_hook_openblas_optarch_generic,
|
1262 | 1286 | 'WRF': pre_configure_hook_wrf_aarch64,
|
|
0 commit comments