diff --git a/easybuild/easyblocks/p/petsc.py b/easybuild/easyblocks/p/petsc.py index a672b79489..53ee9c79bc 100644 --- a/easybuild/easyblocks/p/petsc.py +++ b/easybuild/easyblocks/p/petsc.py @@ -38,7 +38,7 @@ from easybuild.tools.build_log import EasyBuildError from easybuild.tools.filetools import symlink, apply_regex_substitutions from easybuild.tools.modules import get_software_root, get_software_version -from easybuild.tools.run import run_cmd +from easybuild.tools.run import run_shell_cmd from easybuild.tools.systemtools import get_shared_lib_ext NO_MPI_CXX_EXT_FLAGS = '-DOMPI_SKIP_MPICXX -DMPICH_SKIP_MPICXX' @@ -167,13 +167,13 @@ def configure_step(self): if self.with_python: # enable numpy support, but only if numpy is available - (_, ec) = run_cmd("python -c 'import numpy'", log_all=True, simple=False) - if ec == 0: + res = run_shell_cmd("python -c 'import numpy'", fail_on_error=False) + if res.exit_code == 0: self.cfg.update('configopts', '--with-numpy=1') # enable mpi4py support, but only if mpi4py is available - (_, ec) = run_cmd("python -c 'import mpi4py'", log_all=True, simple=False) - if ec == 0: + res = run_shell_cmd("python -c 'import mpi4py'", fail_on_error=False) + if res.exit_code == 0: with_mpi4py_opt = '--with-mpi4py' if self.cfg['shared_libs'] and with_mpi4py_opt not in self.cfg['configopts']: self.cfg.update('configopts', '%s=1' % with_mpi4py_opt) @@ -288,7 +288,8 @@ def configure_step(self): # run configure without --prefix (required) cmd = "%s ./configure %s" % (self.cfg['preconfigopts'], self.cfg['configopts']) - (out, _) = run_cmd(cmd, log_all=True, simple=False) + res = run_shell_cmd(cmd) + out = res.output else: out = super(EB_PETSc, self).configure_step() @@ -327,7 +328,7 @@ def configure_step(self): self.cfg.update('configopts', '%s=1 %s-dir=%s' % (withdep, withdep, deproot)) cmd = "./config/configure.py %s" % self.get_cfg('configopts') - run_cmd(cmd, log_all=True, simple=True) + run_shell_cmd(cmd) # Make sure to set test_parallel before self.cfg['parallel'] is set to None if self.cfg['test_parallel'] is None and self.cfg['parallel']: @@ -356,7 +357,8 @@ def test_step(self): if self.cfg['runtest']: cmd = "%s make %s %s %s" % (self.cfg['pretestopts'], paracmd, self.cfg['runtest'], self.cfg['testopts']) - (out, _) = run_cmd(cmd, log_all=True, simple=False) + res = run_shell_cmd(cmd) + out = res.output return out