apollo icon indicating copy to clipboard operation
apollo copied to clipboard

WSL2 UBUNTU2204 buildtool build failed

Open benson0308 opened this issue 1 month ago • 6 comments

(05:47:09) ERROR: /apollo_workspace/.cache/bazel/679551712d2357b63e6e0ce858ebf90e/external/com_google_protobuf/BUILD:410:11: Compiling src/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc [for host] failed: (Exit 1): crosstool_wrapper_driver_is_not_gcc failed: error executing command external/local_config_cuda/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc -MD -MF bazel-out/host/bin/external/com_google_protobuf/_objs/protoc_lib/cpp_padding_optimizer.d ... (remaining 49 arguments skipped) In file included from /usr/include/c++/11/bits/char_traits.h:39, from /usr/include/c++/11/string:40, from external/com_google_protobuf/src/google/protobuf/compiler/cpp/cpp_options.h:36, from external/com_google_protobuf/src/google/protobuf/compiler/cpp/cpp_message_layout_helper.h:38, from external/com_google_protobuf/src/google/protobuf/compiler/cpp/cpp_padding_optimizer.h:38, from external/com_google_protobuf/src/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc:31: /usr/include/c++/11/bits/stl_algobase.h: In instantiation of ‘_Iterator std::__niter_base(_Iterator) [with _Iterator = const google::protobuf::Descriptor**]’: /usr/include/c++/11/bits/stl_uninitialized.h:1046:46: required from ‘_ForwardIterator std::__relocate_a(_InputIterator, _InputIterator, _ForwardIterator, _Allocator&) [with _InputIterator = const google::protobuf::Descriptor**; _ForwardIterator = const google::protobuf::Descriptor**; _Allocator = std::allocator<const google::protobuf::Descriptor*>]’ /usr/include/c++/11/bits/stl_vector.h:456:26: required from ‘static std::vector<_Tp, _Alloc>::pointer std::vector<_Tp, _Alloc>::_S_do_relocate(std::vector<_Tp, _Alloc>::pointer, std::vector<_Tp, _Alloc>::pointer, std::vector<_Tp, _Alloc>::pointer, std::vector<_Tp, _Alloc>::_Tp_alloc_type&, std::true_type) [with _Tp = const google::protobuf::Descriptor*; _Alloc = std::allocator<const google::protobuf::Descriptor*>; std::vector<_Tp, _Alloc>::pointer = const google::protobuf::Descriptor**; std::vector<_Tp, _Alloc>::_Tp_alloc_type = std::vector<const google::protobuf::Descriptor*>::_Tp_alloc_type; std::true_type = std::integral_constant<bool, true>]’ /usr/include/c++/11/bits/stl_vector.h:469:23: required from ‘static std::vector<_Tp, _Alloc>::pointer std::vector<_Tp, _Alloc>::_S_relocate(std::vector<_Tp, _Alloc>::pointer, std::vector<_Tp, _Alloc>::pointer, std::vector<_Tp, _Alloc>::pointer, std::vector<_Tp, _Alloc>::_Tp_alloc_type&) [with _Tp = const google::protobuf::Descriptor*; _Alloc = std::allocator<const google::protobuf::Descriptor*>; std::vector<_Tp, _Alloc>::pointer = const google::protobuf::Descriptor**; std::vector<_Tp, _Alloc>::_Tp_alloc_type = std::vector<const google::protobuf::Descriptor*>::_Tp_alloc_type]’ /usr/include/c++/11/bits/vector.tcc:461:34: required from ‘void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {const google::protobuf::Descriptor*}; _Tp = const google::protobuf::Descriptor*; _Alloc = std::allocator<const google::protobuf::Descriptor*>; std::vector<_Tp, _Alloc>::iterator = std::vector<const google::protobuf::Descriptor*>::iterator]’ /usr/include/c++/11/bits/vector.tcc:121:21: required from ‘std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {const google::protobuf::Descriptor*}; _Tp = const google::protobuf::Descriptor*; _Alloc = std::allocator<const google::protobuf::Descriptor*>; std::vector<_Tp, _Alloc>::reference = const google::protobuf::Descriptor*&]’ /usr/include/c++/11/bits/stl_vector.h:1204:21: required from ‘void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = const google::protobuf::Descriptor*; _Alloc = std::allocator<const google::protobuf::Descriptor*>; std::vector<_Tp, _Alloc>::value_type = const google::protobuf::Descriptor*]’ external/com_google_protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:568:25: required from here /usr/include/c++/11/bits/stl_algobase.h:313:28: internal compiler error: Segmentation fault 313 | __niter_base(_Iterator __it) | ~~~~~~~~~~^~~~ 0x7c8e8017751f ??? ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0 0x7c8e8015ed8f __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 0x7c8e8015ee3f __libc_start_main_impl ../csu/libc-start.c:392 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See file:///usr/share/doc/gcc-11/README.Bugs for instructions. Target //dev/buildtool/mock:mock_install failed to build Use --verbose_failures to see the command lines of failed build steps. (05:47:09) INFO: Elapsed time: 35.477s, Critical Path: 8.11s (05:47:09) INFO: 28719 processes: 27929 internal, 790 local. (05:47:09) FAILED: Build did NOT complete successfully (05:47:09) FAILED: Build did NOT complete successfully [buildtool] 2025-11-23 13:47:09 ERROR Encounter ErrCode.BazelErr [buildtool] 2025-11-23 13:47:09 ERROR hint: Compiling and install failed! [buildtool] 2025-11-23 13:47:09 ERROR solution: Please checkout the build file by following bazel error hints

benson0308 avatar Nov 23 '25 05:11 benson0308

为协助我们更好地排查您的问题,请提供您的 CPU 型号及其他硬件配置详情。需要说明的是,在 WSL2 环境下安装 Apollo 系统可能存在部分兼容性问题,可能导致功能无法正常使用。因此,我们建议您优先考虑使用双系统或虚拟机方案以获得更稳定的运行体验。

To help us better diagnose your issue, please provide your CPU model and other hardware specifications. Please note that installing the Apollo system under WSL2 may cause partial compatibility issues, potentially affecting normal functionality. Therefore, we recommend using either a Dual Boot or Virtual Machine setup for a more stable experience.

yuxin-2 avatar Nov 26 '25 12:11 yuxin-2

CPU 14700KF GPU 华硕5070TI 24g*2内存

WSL2安装Ubuntu22.04,application-core可以正常build,而且可以打开dreamview。buildtool install perception-common等感知部分package之后build就会失败。直接源码安装也是会失败。目前gcc g++版本是11.4.0,apollo代码是master分支最新的。

安装步骤按下方链接操作: https://apollo.baidu.com/docs/apollo/latest/md_docs_2_xE5_xAE_x89_xE8_xA3_x85_xE6_x8C_x87_xE5_x8D_x97_2_xE5_xAE_x89_xE8_xA3_x85_xE6_x8C_x87_xE5_x8D_x97.html

另外,请教下如果用VMware workstation Pro安装ubuntu系统会比wsl2更稳定的运行apollo吗? 感谢回复。

benson0308 avatar Nov 26 '25 13:11 benson0308

目前Apollo最新还没测试过50系列显卡,最新版本只测试过40系列显卡,推荐的nvidia 驱动为525以上版本,apollo内部的gcc版本为11.4.0。

yuxin-2 avatar Nov 28 '25 05:11 yuxin-2

虚拟机可能无法使用gpu。我个人使用的是ubuntu纯系统

yuxin-2 avatar Nov 28 '25 05:11 yuxin-2

虚拟机可能无法使用gpu。我个人使用的是ubuntu纯系统

目前用之前的笔记本安装了纯ubuntu系统,笔记本型号DELL G15 5510: CPU10代I5, GPU 3060labtop. 想咨询下: 1.ubuntu 24.04可以编译apollo源代码吗?我看doc文件中写的最高版本好像只支持22.04没找到关于24.04的说明。 2.3060lattop 或者3060ti labtop编译源码大概需要多久,2-5个小时可以编译完成吗? PS:laptop是笔记本阉割版显卡,我理解显存会比正式版小一些

感谢回复。

benson0308 avatar Dec 02 '25 09:12 benson0308

24.04可以正常安装,但您需要参考这个issue https://github.com/ApolloAuto/apollo/issues/15653 使用包管理方式安装,网速快的话一个小时就可以安装完毕 https://github.com/ApolloAuto/application-core

yuxin-2 avatar Dec 03 '25 03:12 yuxin-2