Autoware.auto常见问题及解决方案

本文档详细介绍了在Ubuntu系统中遇到的几个常见问题及其解决方案,包括:GCC版本过低导致的编译错误,解决方法是更新GCC到10.0版本;缺失libhdf5.so.101库文件的问题,通过添加库文件路径到环境变量来解决;以及处理未定义的引用错误和编译警告等。此外,还涉及了如何处理Eigen库中的编译错误。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. cc1plus: error: bad value (‘tigerlake’) for ‘-march=’ switch

原因分析:gcc版本过低,更新gcc版本至10.0版本
解决方案

  1. ade环境下更新软件源
sudo gedit /etc/apt/sources.list

在文件中输入:

deb http://mirrors.aliyun.com/ubuntu/ focal main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic main restricted
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
deb http://mirrors.aliyun.com/ubuntu/ focal universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic universe
deb http://mirrors.aliyun.com/ubuntu/ focal-updates universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-updates universe
deb http://mirrors.aliyun.com/ubuntu/ focal multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted
# deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted
deb http://mirrors.aliyun.com/ubuntu/ focal-security universe
# deb-src http://security.ubuntu.com/ubuntu bionic-security universe
deb http://mirrors.aliyun.com/ubuntu/ focal-security multiverse
# deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse
  1. ade环境下更新gcc
sudo apt install gcc-10 g++-10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10 --slave /usr/bin/gcov gcov /usr/bin/gcov-10
sudo update-alternatives --config gcc

2. /usr/bin/ld: warning: libhdf5.so.101, needed by /usr/lib/x86_64-linux-gnu/libarmadillo.so.9, not found

--- stderr: grid_map_ros
/usr/bin/ld: warning: libhdf5.so.101, needed by /usr/lib/x86_64-linux-gnu/libarmadillo.so.9, not found (try using -rpath or -rpath-link)
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libarmadillo.so.9: undefined reference to `H5Ovisit'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/grid_map_ros-test.dir/build.make:290: grid_map_ros-test] Error 1
make[1]: *** [CMakeFiles/Makefile2:103: CMakeFiles/grid_map_ros-test.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

原因分析:缺少libhdf5.so.101库文件
解决方案:先查看电脑里是否有该文件,运行locate libhdf5.so发现:
在这里插入图片描述
电脑中存在libhdf5.so.101库文件,将库文件路径添加到环境变量中即可。

 echo "export LD_LIBRARY_PATH=/home/zhangying/anaconda3/lib:$LD_LIBRARY_PATH" >> ~/.bashrc
 echo "export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH" >> ~/.bashrc
 source ~/.bashrc

3.libfontconfig.so.1: undefined reference to `uuid_generate_random@UUID_1.0’

解决方案
找到自己anaconda3目录下的lib,搜索libuuid,将搜索到的文件全部删除。
在这里插入图片描述

4. cc1plus: all warnings being treated as errors

解决方案

export CFLAGS="-Wno-error"
export CXXFLAGS="-Wno-error"

5. — stderr: mpc_controller /home/xxxxx/AutowareAuto/build/mpc_controller/single_track_dynamics/acado_integrator.c:23:27: error: unknown type name ‘real_t’

--- stderr: mpc_controller
/home/xxxxxx/AutowareAuto/build/mpc_controller/single_track_dynamics/acado_integrator.c:23:27: error: unknown type name ‘real_t’
   23 | void acado_rhs_forw(const real_t* in, real_t* out)
      |                           ^~~~~~
/home/xxxxxxx/AutowareAuto/build/mpc_controller/single_track_dynamics/acado_integrator.c:23:39: error: unknown type name ‘real_t’
   23 | void acado_rhs_forw(const real_t* in, real_t* out)
      |                                       ^~~~~~
/home/xxxxxxx/AutowareAuto/build/mpc_controller/single_track_dynamics/acado_integrator.c:95:22: error: unknown type name ‘real_t’
   95 | int acado_integrate( real_t* const rk_eta, int resetIntegrator )

解决方案

sudo apt purge -y ros-foxy-acado-vendor
sudo apt install -y ros-foxy-acado-vendor

6. /usr/include/eigen3/Eigen/src/Core/functors/AssignmentFunctors.h:24:102: error: ‘outputColor’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

 --- stderr: grid_map_filters                                                   
In file included from /usr/include/eigen3/Eigen/Core:427,
                 from /home/zhangying/AutowareAuto/src/external/grid_map/grid_map_filters/include/grid_map_filters/ColorBlendingFilter.hpp:14,
                 from /home/zhangying/AutowareAuto/src/external/grid_map/grid_map_filters/src/ColorBlendingFilter.cpp:9:
/usr/include/eigen3/Eigen/src/Core/functors/AssignmentFunctors.h: In member function ‘bool grid_map::ColorBlendingFilter<T>::update(const T&, T&) [with T = grid_map::GridMap]’:
/usr/include/eigen3/Eigen/src/Core/functors/AssignmentFunctors.h:24:102: error: ‘outputColor’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
   24 |   EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void assignCoeff(DstScalar& a, const SrcScalar& b) const { a = b; }

解决方案
找到报错程序包的cmakelists.txt文件加入:

add_compile_options(-Wall -Werror -Wno-error=maybe-uninitialized)
wuhen@PC:~/autoware$ ./setup-dev-env.sh Setting up the build environment can take up to 1 hour. > Are you sure you want to run setup? [y/N] y /home/wuhen/.local/bin is already in PATH. ⚠️ All pipx binary directories have been appended to PATH. If you are sure you want to proceed, try again with the '--force' flag. Otherwise pipx is ready to go! ✨ 🌟 ✨ Installing to existing venv 'ansible' installed package ansible 6.7.0, installed using Python 3.10.12 These apps are now globally available - ansible - ansible-community - ansible-config - ansible-connection - ansible-console - ansible-doc - ansible-galaxy - ansible-inventory - ansible-playbook - ansible-pull - ansible-test - ansible-vault done! ✨ 🌟 ✨ ansible-galaxy collection install -f -r /home/wuhen/autoware/ansible-galaxy-requirements.yaml Starting galaxy collection install process Process install dependency map Starting collection install process Installing 'autoware.dev_env:0.1.0' to '/home/wuhen/.ansible/collections/ansible_collections/autoware/dev_env' Created collection for autoware.dev_env:0.1.0 at /home/wuhen/.ansible/collections/ansible_collections/autoware/dev_env autoware.dev_env:0.1.0 was installed successfully ansible-playbook autoware.dev_env.universe --ask-become-pass --extra-vars install_devel=y --extra-vars data_dir=/home/wuhen/autoware_data --extra-vars rosdistro=humble --extra-vars rmw_implementation=rmw_cyclonedds_cpp --extra-vars base_image=ros:humble-ros-base-jammy --extra-vars cuda_version=12.3 --extra-vars cudnn_version=8.9.5.29-1+cuda12.2 --extra-vars tensorrt_version=8.6.1.6-1+cuda12.0 --extra-vars pre_commit_clang_format_version=17.0.5 BECOME password: [WARNING]: No inventory was parsed, only implicit localhost is available [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all' [WARNING]: running playbook inside collection autoware.dev_env [Warning] Some Autoware components depend on the CUDA, cuDNN and TensorRT NVIDIA libraries which have end-user license agreements that should be reviewed before installation. Install NVIDIA libraries? [y/N]: y [Warning] Should the ONNX model files and other artifacts be downloaded alongside setting up the development environment. Download artifacts? [y/N]: y PLAY [Set up source development environments for Autoware Universe] ************ TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Verify OS] *************************************************************** skipping: [localhost] TASK [Print args] ************************************************************** ok: [localhost] => { "msg": [ { "rosdistro": "humble" }, { "rmw_implementation": "rmw_cyclonedds_cpp" }, { "cuda_version": "12.3" }, { "cudnn_version": "8.9.5.29-1+cuda12.2" }, { "tensorrt_version": "8.6.1.6-1+cuda12.0" } ] } TASK [Show a warning if the NVIDIA libraries will not be installed] ************ skipping: [localhost] TASK [autoware.dev_env.ros2 : Install dependencies for setting up apt sources] *** fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to update apt cache: W:http://mirrors.tuna.tsinghua.edu.cn/ros2/ubuntu/dists/jammy/InRelease: 密钥存储在过时的 trusted.gpg 密钥环中(/etc/apt/trusted.gpg),请参见 apt-key(8) 的 DEPRECATION 一节以了解详情。, E:仓库 “https://mirror.nju.edu.cn/nvidia-cuda/ubuntu-jammy/x86_64 Release” 没有 Release 文件。, W:无法安全地用该源进行更新,所以默认禁用该源。, W:参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。, W:目标 Packages (Packages) 在 /etc/apt/sources.list.d/archive_uri-https_developer_download_nvidia_com_compute_cuda_repos_ubuntu2204_x86_64_-jammy.list:1 和 /etc/apt/sources.list.d/cuda-ubuntu2204-x86_64.list:1 中被配置了多次, W:目标 Translations (zh_CN) 在 /etc/apt/sources.list.d/archive_uri-https_developer_download_nvidia_com_compute_cuda_repos_ubuntu2204_x86_64_-jammy.list:1 和 /etc/apt/sources.list.d/cuda-ubuntu2204-x86_64.list:1 中被配置了多次, W:目标 Translations (zh) 在 /etc/apt/sources.list.d/archive_uri-https_developer_download_nvidia_com_compute_cuda_repos_ubuntu2204_x86_64_-jammy.list:1 和 /etc/apt/sources.list.d/cuda-ubuntu2204-x86_64.list:1 中被配置了多次, W:目标 Translations (en) 在 /etc/apt/sources.list.d/archive_uri-https_developer_download_nvidia_com_compute_cuda_repos_ubuntu2204_x86_64_-jammy.list:1 和 /etc/apt/sources.list.d/cuda-ubuntu2204-x86_64.list:1 中被配置了多次, E:无法下载 https://mirror.ghproxy.com/https://raw.githubusercontent.com/autowarefoundation/autoware/ros2/dists/repos/InRelease 明文签署文件不可用,结果为‘NOSPLIT’(您的网络需要认证吗?), E:仓库 “https://mirror.ghproxy.com/https://raw.githubusercontent.com/autowarefoundation/autoware/ros2 repos InRelease” 没有数字签名。"} PLAY RECAP ********************************************************************* localhost : ok=2 changed=0 unreachable=0 failed=1 skipped=2 rescued=0 ignored=0 Failed. wuhen@PC:~/autoware$
最新发布
07-22
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值