diff --git a/easybuild/easyblocks/i/intel_compilers.py b/easybuild/easyblocks/i/intel_compilers.py index d1839a7a7b..56cfe65f0b 100644 --- a/easybuild/easyblocks/i/intel_compilers.py +++ b/easybuild/easyblocks/i/intel_compilers.py @@ -33,7 +33,7 @@ from easybuild.easyblocks.generic.intelbase import IntelBase from easybuild.easyblocks.t.tbb import get_tbb_gccprefix from easybuild.tools.build_log import EasyBuildError, print_msg -from easybuild.tools.run import run_cmd +from easybuild.tools.run import run_shell_cmd class EB_intel_minus_compilers(IntelBase): @@ -174,12 +174,12 @@ def make_module_extra(self): # On Debian/Ubuntu, /usr/include/x86_64-linux-gnu, or whatever dir gcc uses, needs to be included # in $CPATH for Intel C compiler - multiarch_out, ec = run_cmd("gcc -print-multiarch", simple=False) - multiarch_out = multiarch_out.strip() - if ec == 0 and multiarch_out: - multiarch_inc_dir, ec = run_cmd("gcc -E -Wp,-v -xc /dev/null 2>&1 | grep %s$" % multiarch_out) - if ec == 0 and multiarch_inc_dir: - multiarch_inc_dir = multiarch_inc_dir.strip() + res = run_shell_cmd("gcc -print-multiarch") + multiarch_out = res.output.strip() + if res.exit_code == 0 and multiarch_out: + res = run_cmd("gcc -E -Wp,-v -xc /dev/null 2>&1 | grep %s$" % multiarch_out) + multiarch_inc_dir = res.output.strip() + if res.exit_code == 0 and multiarch_inc_dir: self.log.info("Adding multiarch include path %s to $CPATH in generated module file", multiarch_inc_dir) # system location must be appended at the end, so use append_paths txt += self.module_generator.append_paths('CPATH', [multiarch_inc_dir], allow_abs=True)