(cmd, raise_error=False, error_msg='')
| 72 | |
| 73 | |
| 74 | def silent_call(cmd, raise_error=False, error_msg=''): |
| 75 | try: |
| 76 | output = subprocess.check_output(cmd, stderr=subprocess.STDOUT) |
| 77 | with open(LOG_PATH, "ab") as log: |
| 78 | log.write(output) |
| 79 | return 0 |
| 80 | except Exception as err: |
| 81 | if isinstance(err, subprocess.CalledProcessError): |
| 82 | with open(LOG_PATH, "ab") as log: |
| 83 | log.write(err.output) |
| 84 | if raise_error: |
| 85 | raise Exception("\n".join((error_msg, LOG_NOTICE))) |
| 86 | return 1 |
| 87 | |
| 88 | |
| 89 | def compile_cpp(use_mingw=False, use_gpu=False, use_mpi=False, |
no test coverage detected