From 7cc4a1b9afc68200012f11f2a8693642066036b4 Mon Sep 17 00:00:00 2001 From: TopRichard Date: Mon, 18 Sep 2023 16:11:28 +0000 Subject: [PATCH] modified the WRF-hook using LooseVersion --- eb_hooks.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/eb_hooks.py b/eb_hooks.py index 23edd32a50..db01bb9007 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -251,15 +251,14 @@ def pre_configure_hook_wrf_aarch64(self, *args, **kwargs): - patch arch/configure_new.defaults so building WRF with foss toolchain works on aarch64 """ if self.name == 'WRF': - wrfversion = int((self.version).replace(".","")) if get_cpu_architecture() == AARCH64: pattern = "Linux x86_64 ppc64le, gfortran" repl = "Linux x86_64 aarch64 ppc64le, gfortran" - if wrfversion <= 39: + if LooseVersion(self.version) <= LooseVersion('3.9.0'): self.cfg.update('preconfigopts', "sed -i 's/%s/%s/g' arch/configure_new.defaults && " % (pattern, repl)) print_msg("Using custom preconfigopts for %s: %s", self.name, self.cfg['preconfigopts']) - if 400 <= wrfversion <= 421: + if LooseVersion('4.0.0') <= LooseVersion(self.version) <= LooseVersion('4.2.1'): self.cfg.update('preconfigopts', "sed -i 's/%s/%s/g' arch/configure.defaults && " % (pattern, repl)) print_msg("Using custom preconfigopts for %s: %s", self.name, self.cfg['preconfigopts']) else: