Skip to content

Commit

Permalink
Merge pull request easybuilders#3331 from Crivella/feature-MetalWalls…
Browse files Browse the repository at this point in the history
…_fix

Fix for plumed genereting patch file inside module location
  • Loading branch information
ocaisa authored May 15, 2024
2 parents c208036 + 39195f9 commit 743662d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions easybuild/easyblocks/m/metalwalls.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@

import easybuild.tools.environment as env
import easybuild.tools.toolchain as toolchain
from easybuild.tools import LooseVersion
from easybuild.tools.build_log import EasyBuildError
from easybuild.tools.modules import get_software_root
from easybuild.tools.modules import get_software_root, get_software_version
from easybuild.tools.run import run_cmd

from easybuild.easyblocks.generic.makecp import MakeCp
Expand Down Expand Up @@ -77,14 +78,19 @@ def configure_step(self):
# https://gitlab.com/ampere2/metalwalls/-/wikis/install#plumed
plumed = get_software_root('PLUMED')
f90wrap = get_software_root('f90wrap')
f90wrap_version = get_software_version('f90wrap')

if LooseVersion(self.version) <= LooseVersion('21.06.1'):
if LooseVersion(f90wrap_version) > LooseVersion('0.2.13'):
raise EasyBuildError('MetalWalls version %s requires f90wrap <= 0.2.13' % self.version)

tpl_rgx = 'alltests\\.append(suite_%s)'
if plumed:
f90flags += ['-fallow-argument-mismatch'] # Code inside ifdef causes mismatch errors
fppflags += ['-DMW_USE_PLUMED']
cmd = ['plumed', 'patch', '--new', 'mw2']
cmd = ['touch', 'mw2.diff']
run_cmd(' '.join(cmd), log_all=False, log_ok=False, simple=False, regexp=False)
cmd = ['plumed', 'patch', '--patch', '--shared', '--engine', 'mw2']
cmd = ['plumed', 'patch', '-d mw2.diff', '--patch', '--shared', '--engine', 'mw2']
run_cmd(' '.join(cmd), log_all=True, simple=False)
else:
self.log.info('PLUMED not found, excluding from test-suite')
Expand Down

0 comments on commit 743662d

Please sign in to comment.