Browse Source

Fixed an issue where compiler_cmd was undefined.

pull/158/head
motoya 3 months ago
parent
commit
f4f2802395
  1. 3
      week4/day4.ipynb

3
week4/day4.ipynb

@ -480,8 +480,9 @@
"source": [ "source": [
"def execute_cpp(code):\n", "def execute_cpp(code):\n",
" write_output(code)\n", " write_output(code)\n",
" compiler_cmd = [\"clang++\", \"-O3\", \"-std=c++17\", \"-march=armv8.3-a\", \"-o\", \"optimized\", \"optimized.cpp\"]\n",
" try:\n", " try:\n",
" compile_result = subprocess.run(compiler_cmd[2], check=True, text=True, capture_output=True)\n", " compile_result = subprocess.run(compiler_cmd, check=True, text=True, capture_output=True)\n",
" run_cmd = [\"./optimized\"]\n", " run_cmd = [\"./optimized\"]\n",
" run_result = subprocess.run(run_cmd, check=True, text=True, capture_output=True)\n", " run_result = subprocess.run(run_cmd, check=True, text=True, capture_output=True)\n",
" return run_result.stdout\n", " return run_result.stdout\n",

Loading…
Cancel
Save