Skip to content

Commit

Permalink
replace run_cmd with run_shell_cmd in custom easyblock for intel_…
Browse files Browse the repository at this point in the history
…compilers (`intel_compilers.py`)
  • Loading branch information
branfosj committed Jan 31, 2024
1 parent d478c3d commit e959e1d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions easybuild/easyblocks/i/intel_compilers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit e959e1d

Please sign in to comment.