gpt4 book ai didi

ubuntu - 在 Ubuntu 虚拟机上构建 Drake

转载 作者:行者123 更新时间:2023-12-04 18:37:22 29 4
gpt4 key购买 nike

我一直在尝试在运行 Ubuntu 18.04.5 的虚拟机上安装 Drake。不幸的是,二进制安装和源代码安装都不起作用。在源码安装的情况下,我运行bazel build //...后一直弹出如下错误(和 install_prereqs )脚本:

username@ubuntu:~/code/drake$ bazel build //...
INFO: Analyzed 7909 targets (0 packages loaded, 0 targets configured).
INFO: Found 7909 targets...
ERROR: /home/username/code/drake/multibody/plant/BUILD.bazel:56:17: C++ compilation of rule '//multibody/plant:multibody_plant_core' failed (Exit 4): gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 309 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 309 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
gcc: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
INFO: Elapsed time: 131.608s, Critical Path: 109.56s
INFO: 81 processes: 56 internal, 25 linux-sandbox.
FAILED: Build did NOT complete successfully
我认为可以通过安装 gcc 8 来解决问题就像在 this thread 中一样.我关注了 this guide安装多个版本 og gcc ,将其设置为 8,然后执行此操作后出现此错误:
username@ubuntu:~/code/drake$ bazel build //...
INFO: Analyzed 7909 targets (0 packages loaded, 0 targets configured).
INFO: Found 7909 targets...
ERROR: /home/username/.cache/bazel/_bazel_/129b6ae6fdda880475e3f0ac2268ff1a/external/lcm/BUILD.bazel:133:10: undeclared inclusion(s) in rule '@lcm//:lcm-logplayer':
this rule is missing dependency declarations for the following files included by 'lcm/lcm-logger/lcm_logplayer.c':
'/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h'
'/usr/lib/gcc/x86_64-linux-gnu/8/include/stdarg.h'
'/usr/lib/gcc/x86_64-linux-gnu/8/include/stdint.h'
INFO: Elapsed time: 2.600s, Critical Path: 0.73s
INFO: 18 processes: 12 internal, 5 linux-sandbox, 1 worker.
FAILED: Build did NOT complete successfully
如果这些信息有帮助,我在我的主机上安装了 Mac 二进制文件,它们似乎运行正常。
任何帮助将不胜感激!

最佳答案

这不是 GCC 8 问题(您应该撤消 GCC 8 安装更改)。
错误信息“gcc: internal compiler error: Killed (program cc1plus)”表示编译器崩溃。这很可能是因为它的内存 (RAM) 用完了。
如果构建使用多个内核进行编译,那么使用较少的并发编译应该会有所帮助。试试 bazel build //... -j 1 , 也许。如果有帮助,您可以通过 https://docs.bazel.build/versions/master/guide.html#bazelrc-the-bazel-configuration-file 将其放入点文件中。因此,在该机器上构建时,工作总是受到限制。
但是,如果一次只编译一个文件并且您仍然运行内存,那么您可能需要增加虚拟机的内存分配。

关于ubuntu - 在 Ubuntu 虚拟机上构建 Drake,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65779172/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com