Skip to content

Commit

Permalink
Merge pull request easybuilders#3299 from branfosj/20240407092222_new…
Browse files Browse the repository at this point in the history
…_pr_openfoam

use `run_shell_cmd` in custom easyblock for OpenFOAM
  • Loading branch information
boegel authored Apr 14, 2024
2 parents 133b683 + f9a832c commit 4547811
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions easybuild/easyblocks/o/openfoam.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
from easybuild.tools.build_log import EasyBuildError
from easybuild.tools.filetools import adjust_permissions, apply_regex_substitutions, mkdir
from easybuild.tools.modules import get_software_root, get_software_version
from easybuild.tools.run import run_cmd, run_cmd_qa
from easybuild.tools.run import run_shell_cmd
from easybuild.tools.systemtools import get_shared_lib_ext, get_cpu_architecture, AARCH64, POWER


Expand Down Expand Up @@ -317,11 +317,11 @@ def build_step(self):
'makecmd': os.path.join(self.builddir, self.openfoamdir, '%s'),
}
if self.is_extend and self.looseversion >= LooseVersion('3.0'):
qa = {
"Proceed without compiling ParaView [Y/n]": 'Y',
"Proceed without compiling cudaSolvers? [Y/n]": 'Y',
}
noqa = [
qa = [
(r"Proceed without compiling ParaView \[Y/n\]", 'Y'),
(r"Proceed without compiling cudaSolvers\? \[Y/n\]", 'Y'),
]
no_qa = [
".* -o .*",
"checking .*",
"warning.*",
Expand All @@ -332,13 +332,13 @@ def build_step(self):
r"\s*\^\s*", # warning indicator
"Cleaning .*",
]
run_cmd_qa(cmd_tmpl % 'Allwmake.firstInstall', qa, no_qa=noqa, log_all=True, simple=True, maxhits=500)
run_shell_cmd(cmd_tmpl % 'Allwmake.firstInstall', qa_patterns=qa, qa_wait_patterns=no_qa, qa_timeout=500)
else:
cmd = 'Allwmake'
if self.looseversion > LooseVersion('1606'):
# use Allwmake -log option if possible since this can be useful during builds, but also afterwards
cmd += ' -log'
run_cmd(cmd_tmpl % cmd, log_all=True, simple=True, log_output=True)
run_shell_cmd(cmd_tmpl % cmd)

def det_psubdir(self):
"""Determine the platform-specific installation directory for OpenFOAM."""
Expand Down

0 comments on commit 4547811

Please sign in to comment.