Skip to content

Commit

Permalink
modified the WRF-hook using LooseVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
TopRichard committed Sep 21, 2023
1 parent 3a123b3 commit 08231fa
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions eb_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,13 @@ def pre_configure_hook_wrf_aarch64(self, *args, **kwargs):
if get_cpu_architecture() == AARCH64:
pattern = "Linux x86_64 ppc64le, gfortran"
repl = "Linux x86_64 aarch64 ppc64le, gfortran"
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 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 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:
raise EasyBuildError("WRF-specific hook triggered for non-WRF easyconfig?!")

Expand Down

0 comments on commit 08231fa

Please sign in to comment.