Execute command with subprocess.
(command, verbose=False)
| 1572 | |
| 1573 | |
| 1574 | def 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 | |
| 1594 | def check_abi_compatibility(compiler, verbose=False): |