麻烦用Bazel建立Drake

问题描述

我一直试图在Ubuntu 18.04上使用Bazel从源代码构建Drake,但是当我运行时会发生以下错误

bazel build ...

从Drake根目录:

ERROR: /home/username/dir/drake/bindings/pydrake/BUILD.bazel:56:37: Action bindings/pydrake/documentation_pybind.h Failed (Exit 1) mkdoc Failed: error executing command bazel-out/host/bin/tools/workspace/pybind11/mkdoc -DDRAKE_COMMON_SYMBOLIC_DETAIL_HEADER -DEIGEN_MPL2_ONLY -DHAVE_CSTDDEF '-DFMT_HEADER_ONLY=1' '-DFMT_NO_FMT_STRING_ALIAS=1' -DHAVE_SPDLOG ... (remaining 1096 argument(s) skipped)

Use --sandBox_debug to see verbose messages from the sandBox
external/eigen/include/_usr_include_eigen3/Eigen/Core:66:12: Fatal error: 'new' file not found
Traceback (most recent call last):
  File "/home/username/.cache/bazel/_bazel_username/6e98757561df7a931d098ab985a3e673/sandBox/linux-sandBox/1371/execroot/drake/bazel-out/host/bin/tools/workspace/pybind11/mkdoc.runfiles/drake/tools/workspace/pybind11/mkdoc.py",line 841,in <module>
    main()
  File "/home/username/.cache/bazel/_bazel_username/6e98757561df7a931d098ab985a3e673/sandBox/linux-sandBox/1371/execroot/drake/bazel-out/host/bin/tools/workspace/pybind11/mkdoc.runfiles/drake/tools/workspace/pybind11/mkdoc.py",line 805,in main
    severities.count(cindex.Diagnostic.Fatal)))
RuntimeError: Parsing headers using the clang library Failed with 0 error(s) and 1 Fatal error(s)
----------------
Note: The failure of target //tools/workspace/pybind11:mkdoc (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.
----------------
INFO: Elapsed time: 2345.311s,Critical Path: 321.76s
INFO: 1378 processes: 1378 linux-sandBox.
Failed: Build did NOT complete successfully

在建筑之前,我跑过

sudo ./setup/ubuntu/install_prereqs.sh

如安装说明中所述。

我还将c和c ++编译器的环境变量设置为$ CC = / usr / bin / gcc和$ CXX = / usr / bin / gcc,因为我怀疑编译器问题是问题所在。为了对此进行比较,我还尝试使用$ CC = / usr / bin / clang-9和$ CXX = / usr / bin / clang ++-9进行构建,但产生的错误有所不同:

ERROR: /home/username/dir/drake/systems/framework/BUILD.bazel:213:17: C++ compilation of rule '//systems/framework:cache_and_dependency_tracker' Failed (Exit 1) clang-9 Failed: error executing command /usr/bin/clang-9 -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -fcolor-diagnostics -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 77 argument(s) skipped)
Use --sandBox_debug to see verbose messages from the sandBox
In file included from systems/framework/cache.cc:1:
bazel-out/k8-opt/bin/systems/framework/_virtual_includes/cache_and_dependency_tracker/drake/systems/framework/cache.h:7:10: Fatal error: 'cstdint' file not found
#include <cstdint>
         ^~~~~~~~~

我怀疑由于两个编译器都找不到标准文件,因此在构建过程中使用的包含路径存在一些问题,但是我不确定下一步该怎么做或如何解决。任何建议或意见将不胜感激!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...