MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / run_cmd

Function run_cmd

python/paddle/utils/cpp_extension/extension_utils.py:1574–1591  ·  view source on GitHub ↗

Execute command with subprocess.

(command, verbose=False)

Source from the content-addressed store, hash-verified

1572
1573
1574def run_cmd(command, verbose=False):
1575 """
1576 Execute command with subprocess.
1577 """
1578 # logging
1579 log_v(f"execute command: {command}", verbose)
1580
1581 # execute command
1582 try:
1583 if verbose:
1584 return subprocess.check_call(
1585 command, shell=True, stderr=subprocess.STDOUT
1586 )
1587 else:
1588 return subprocess.check_call(command, shell=True, stdout=DEVNULL)
1589 except Exception:
1590 _, error, _ = sys.exc_info()
1591 raise RuntimeError(f"Failed to run command: {compile}, errors: {error}")
1592
1593
1594def check_abi_compatibility(compiler, verbose=False):

Callers 15

setUpMethod · 0.90
setUpMethod · 0.90
setUpMethod · 0.90
setUpMethod · 0.90

Calls 2

log_vFunction · 0.85
RuntimeErrorClass · 0.85

Tested by 6

setUpMethod · 0.72
setUpMethod · 0.72
setUpMethod · 0.72
setUpMethod · 0.72
setUpMethod · 0.72
setUpMethod · 0.72