构建 Drake Python 绑定时出现 Clang 格式错误
Clang-format Error When Building Drake Python Bindings
我正在尝试为 Drake 安装 Python 绑定,但遇到了问题。我已按照从 "Binary Installation for Python" 部分到 "Building the Python Bindings" 的步骤 here 进行操作。我在 运行 "make -j" 步骤中遇到以下错误:
FAILED: Build did NOT complete successfully
make[2]: *** [drake_cxx_python-prefix/src/drake_cxx_python-stamp/drake_cxx_python-build] Error 1
make[1]: *** [CMakeFiles/drake_cxx_python.dir/all] Error 2
make: *** [all] Error 2
输出错误的完整回溯是:
ERROR: /Users/samcherna/Documents/6.832/drake/examples/rimless_wheel/BUILD.bazel:18:1: Action examples/rimless_wheel/gen/rimless_wheel_continuous_state.cc failed (Exit 1) lcm_vector_gen failed: error executing command bazel-out/host/bin/tools/vector_gen/lcm_vector_gen '--src=examples/rimless_wheel/rimless_wheel_continuous_state_named_vector.yaml' '--src=examples/rimless_wheel/rimless_wheel_params_named_vector.yaml' ... (remaining 5 argument(s) skipped)
Use --sandbox_debug to see verbose messages from the sandbox
Traceback (most recent call last):
File "/Users/samcherna/Documents/6.832/drake-build/_bazel_samcherna/816e2be05e81a09f0a948f564abb1d71/sandbox/darwin-sandbox/43/execroot/drake/bazel-out/host/bin/tools/vector_gen/lcm_vector_gen.runfiles/drake/tools/vector_gen/lcm_vector_gen.py", line 656, in <module>
main()
File "/Users/samcherna/Documents/6.832/drake-build/_bazel_samcherna/816e2be05e81a09f0a948f564abb1d71/sandbox/darwin-sandbox/43/execroot/drake/bazel-out/host/bin/tools/vector_gen/lcm_vector_gen.runfiles/drake/tools/vector_gen/lcm_vector_gen.py", line 652, in main
return generate_all_code(args)
File "/Users/samcherna/Documents/6.832/drake-build/_bazel_samcherna/816e2be05e81a09f0a948f564abb1d71/sandbox/darwin-sandbox/43/execroot/drake/bazel-out/host/bin/tools/vector_gen/lcm_vector_gen.runfiles/drake/tools/vector_gen/lcm_vector_gen.py", line 632, in generate_all_code
generate_code(src, **kwargs_for_generate)
File "/Users/samcherna/Documents/6.832/drake-build/_bazel_samcherna/816e2be05e81a09f0a948f564abb1d71/sandbox/darwin-sandbox/43/execroot/drake/bazel-out/host/bin/tools/vector_gen/lcm_vector_gen.runfiles/drake/tools/vector_gen/lcm_vector_gen.py", line 591, in generate_code
[get_clang_format_path(), "--style=" + style, "-i"] + cxx_names)
File "/Users/samcherna/Documents/6.832/drake-build/_bazel_samcherna/816e2be05e81a09f0a948f564abb1d71/sandbox/darwin-sandbox/43/execroot/drake/bazel-out/host/bin/tools/vector_gen/lcm_vector_gen.runfiles/drake/tools/lint/clang_format.py", line 15, in get_clang_format_path
raise RuntimeError("Could not find required clang-format at " + path)
RuntimeError: Could not find required clang-format at /usr/local/opt/llvm@6/bin/clang-format
----------------
Note: The failure of target //tools/vector_gen:lcm_vector_gen (with exit code 1) may have been caused by the fact that it is running under Python 3 instead of Python 2. Examine the error to determine if that appears to be the problem. Since this target is built in the host configuration, the only way to change its version is to set --host_force_python=PY2, which affects the entire build.
If this error started occurring in Bazel 0.27 and later, it may be because the Python toolchain now enforces that targets analyzed as PY2 and PY3 run under a Python 2 and Python 3 interpreter, respectively. See https://github.com/bazelbuild/bazel/issues/7899 for more information.
----------------
Target //:install failed to build
Use --verbose_failures to see the command lines of failed build steps.
ERROR: /Users/samcherna/Documents/6.832/drake/BUILD.bazel:61:1 Action examples/rimless_wheel/gen/rimless_wheel_continuous_state.cc failed (Exit 1) lcm_vector_gen failed: error executing command bazel-out/host/bin/tools/vector_gen/lcm_vector_gen '--src=examples/rimless_wheel/rimless_wheel_continuous_state_named_vector.yaml' '--src=examples/rimless_wheel/rimless_wheel_params_named_vector.yaml' ... (remaining 5 argument(s) skipped)
是否有人知道可能导致此问题的原因?感谢您的帮助!
糟糕。如果你做的是二进制安装,那么你不需要运行make
。我认为您已经过了 "Binary Installation for Python" 部分,进入了 "Building the Python Bindings"?
如果您完成了二进制安装部分的结尾,那么您的状态就很好!
我正在尝试为 Drake 安装 Python 绑定,但遇到了问题。我已按照从 "Binary Installation for Python" 部分到 "Building the Python Bindings" 的步骤 here 进行操作。我在 运行 "make -j" 步骤中遇到以下错误:
FAILED: Build did NOT complete successfully
make[2]: *** [drake_cxx_python-prefix/src/drake_cxx_python-stamp/drake_cxx_python-build] Error 1
make[1]: *** [CMakeFiles/drake_cxx_python.dir/all] Error 2
make: *** [all] Error 2
输出错误的完整回溯是:
ERROR: /Users/samcherna/Documents/6.832/drake/examples/rimless_wheel/BUILD.bazel:18:1: Action examples/rimless_wheel/gen/rimless_wheel_continuous_state.cc failed (Exit 1) lcm_vector_gen failed: error executing command bazel-out/host/bin/tools/vector_gen/lcm_vector_gen '--src=examples/rimless_wheel/rimless_wheel_continuous_state_named_vector.yaml' '--src=examples/rimless_wheel/rimless_wheel_params_named_vector.yaml' ... (remaining 5 argument(s) skipped)
Use --sandbox_debug to see verbose messages from the sandbox
Traceback (most recent call last):
File "/Users/samcherna/Documents/6.832/drake-build/_bazel_samcherna/816e2be05e81a09f0a948f564abb1d71/sandbox/darwin-sandbox/43/execroot/drake/bazel-out/host/bin/tools/vector_gen/lcm_vector_gen.runfiles/drake/tools/vector_gen/lcm_vector_gen.py", line 656, in <module>
main()
File "/Users/samcherna/Documents/6.832/drake-build/_bazel_samcherna/816e2be05e81a09f0a948f564abb1d71/sandbox/darwin-sandbox/43/execroot/drake/bazel-out/host/bin/tools/vector_gen/lcm_vector_gen.runfiles/drake/tools/vector_gen/lcm_vector_gen.py", line 652, in main
return generate_all_code(args)
File "/Users/samcherna/Documents/6.832/drake-build/_bazel_samcherna/816e2be05e81a09f0a948f564abb1d71/sandbox/darwin-sandbox/43/execroot/drake/bazel-out/host/bin/tools/vector_gen/lcm_vector_gen.runfiles/drake/tools/vector_gen/lcm_vector_gen.py", line 632, in generate_all_code
generate_code(src, **kwargs_for_generate)
File "/Users/samcherna/Documents/6.832/drake-build/_bazel_samcherna/816e2be05e81a09f0a948f564abb1d71/sandbox/darwin-sandbox/43/execroot/drake/bazel-out/host/bin/tools/vector_gen/lcm_vector_gen.runfiles/drake/tools/vector_gen/lcm_vector_gen.py", line 591, in generate_code
[get_clang_format_path(), "--style=" + style, "-i"] + cxx_names)
File "/Users/samcherna/Documents/6.832/drake-build/_bazel_samcherna/816e2be05e81a09f0a948f564abb1d71/sandbox/darwin-sandbox/43/execroot/drake/bazel-out/host/bin/tools/vector_gen/lcm_vector_gen.runfiles/drake/tools/lint/clang_format.py", line 15, in get_clang_format_path
raise RuntimeError("Could not find required clang-format at " + path)
RuntimeError: Could not find required clang-format at /usr/local/opt/llvm@6/bin/clang-format
----------------
Note: The failure of target //tools/vector_gen:lcm_vector_gen (with exit code 1) may have been caused by the fact that it is running under Python 3 instead of Python 2. Examine the error to determine if that appears to be the problem. Since this target is built in the host configuration, the only way to change its version is to set --host_force_python=PY2, which affects the entire build.
If this error started occurring in Bazel 0.27 and later, it may be because the Python toolchain now enforces that targets analyzed as PY2 and PY3 run under a Python 2 and Python 3 interpreter, respectively. See https://github.com/bazelbuild/bazel/issues/7899 for more information.
----------------
Target //:install failed to build
Use --verbose_failures to see the command lines of failed build steps.
ERROR: /Users/samcherna/Documents/6.832/drake/BUILD.bazel:61:1 Action examples/rimless_wheel/gen/rimless_wheel_continuous_state.cc failed (Exit 1) lcm_vector_gen failed: error executing command bazel-out/host/bin/tools/vector_gen/lcm_vector_gen '--src=examples/rimless_wheel/rimless_wheel_continuous_state_named_vector.yaml' '--src=examples/rimless_wheel/rimless_wheel_params_named_vector.yaml' ... (remaining 5 argument(s) skipped)
是否有人知道可能导致此问题的原因?感谢您的帮助!
糟糕。如果你做的是二进制安装,那么你不需要运行make
。我认为您已经过了 "Binary Installation for Python" 部分,进入了 "Building the Python Bindings"?
如果您完成了二进制安装部分的结尾,那么您的状态就很好!