Skip to content

Commit b59f044

Browse files
committed
add pre-configure hook to adjust configure options for Zoltan when ParMETIS is not a dependency
1 parent 1e810da commit b59f044

1 file changed

Lines changed: 24 additions & 6 deletions

File tree

eb_hooks.py

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
from easybuild.tools.build_log import EasyBuildError, print_msg, print_warning
1717
from easybuild.tools.config import build_option, install_path, update_build_option
1818
from easybuild.tools.filetools import apply_regex_substitutions, copy_dir, copy_file, remove_file, symlink, which
19+
from easybuild.tools.modules import get_software_root, get_software_root_env_var_name
1920
from easybuild.tools.run import run_cmd
2021
from easybuild.tools.systemtools import AARCH64, POWER, X86_64, det_parallelism, get_cpu_architecture, get_cpu_features
2122
from easybuild.tools.toolchain.compiler import OPTARCH_GENERIC
2223
from easybuild.tools.toolchain.toolchain import is_system_toolchain
2324
from easybuild.tools.version import VERSION as EASYBUILD_VERSION
24-
from easybuild.tools.modules import get_software_root_env_var_name
2525

2626
# prefer importing LooseVersion from easybuild.tools, but fall back to distuils in case EasyBuild <= 4.7.0 is used
2727
try:
@@ -1403,6 +1403,23 @@ def pre_configure_hook_cmake_system(self, *args, **kwargs):
14031403
raise EasyBuildError("CMake-specific hook triggered for non-CMake easyconfig?!")
14041404

14051405

1406+
def pre_configure_hook_Zoltan(self, *args, **kwargs):
1407+
"""
1408+
Pre-configure hook for Zoltan to filter out ParMETIS configure options,
1409+
since we filter out ParMETIS as a dependency
1410+
"""
1411+
if self.name == 'Zoltan':
1412+
if get_software_root('ParMETIS') is None:
1413+
configopts = self.cfg['configopts']
1414+
# get rid of all --with-parmetis configure options, and inject --without-parmetis
1415+
configopts = re.sub('--with-parmetis[^ ]*', '', configopts)
1416+
configopts += " --without-parmetis"
1417+
self.cfg['configopts'] = configopts
1418+
self.log.info("Removed --with-parmetis* configure options for {self.name}, ParMETIS is not a dependency")
1419+
else:
1420+
raise EasyBuildError("Zoltan-specific hook triggered for non-Zoltan easyconfig?!")
1421+
1422+
14061423
def pre_test_hook(self, *args, **kwargs):
14071424
"""Main pre-test hook: trigger custom functions based on software name."""
14081425
if self.name in PRE_TEST_HOOKS:
@@ -1959,23 +1976,24 @@ def post_easyblock_hook(self, *args, **kwargs):
19591976

19601977
PRE_CONFIGURE_HOOKS = {
19611978
'BLIS': pre_configure_hook_BLIS,
1979+
'CMake': pre_configure_hook_cmake_system,
19621980
'CUDA-Samples': pre_configure_hook_CUDA_Samples_test_remove,
1963-
'GObject-Introspection': pre_configure_hook_gobject_introspection,
19641981
'Extrae': pre_configure_hook_extrae,
1982+
'GObject-Introspection': pre_configure_hook_gobject_introspection,
19651983
'Graphviz': pre_configure_hook_graphviz,
19661984
'GRASS': pre_configure_hook_grass,
1985+
'LAMMPS': pre_configure_hook_LAMMPS_zen4_and_aarch64_cuda,
19671986
'libfabric': pre_configure_hook_libfabric_disable_psm3_x86_64_generic,
19681987
'LLVM': pre_configure_hook_llvm,
1969-
'ROCm-LLVM': pre_configure_hook_llvm,
19701988
'MetaBAT': pre_configure_hook_metabat_filtered_zlib_dep,
19711989
'OpenBLAS': pre_configure_hook_openblas_optarch_generic,
19721990
'OpenMPI': pre_configure_hook_openmpi_ipv6,
19731991
'PMIx': pre_configure_hook_pmix_ipv6,
19741992
'PRRTE': pre_configure_hook_prrte_ipv6,
1975-
'WRF': pre_configure_hook_wrf_aarch64,
1976-
'LAMMPS': pre_configure_hook_LAMMPS_zen4_and_aarch64_cuda,
1993+
'ROCm-LLVM': pre_configure_hook_llvm,
19771994
'Score-P': pre_configure_hook_score_p,
1978-
'CMake': pre_configure_hook_cmake_system,
1995+
'WRF': pre_configure_hook_wrf_aarch64,
1996+
'Zoltan': pre_configure_hook_Zoltan,
19791997
}
19801998

19811999
PRE_TEST_HOOKS = {

0 commit comments

Comments
 (0)