apollo 规划使用到的工具

0 g++

sudo apt-get update
sudo apt-get install gcc-9 g++-9 -y
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9

1 protobuf

sudo apt-get install autoconf automake libtool curl make g++ unzip
git clone https://github.com/protocolbuffers/protobuf.git
cd protobuf
git submodule update --init --recursive
./autogen.sh
./configure
make
make check
sudo make install
sudo ldconfig # refresh shared library cache.

1.1 CMakeLists文件


2 gflags

github
教程

sudo apt-get install libgflags-dev

cd gflags-$version
mkdir build && cd build
cmake .. -DBUILD_SHARED_LIBS=ON -DGFLAGS_NAMESPACE=google -DCMAKE_CXX_FLAGS=-fPIC ..
make
make test #optional
sudo make install #optional

2.1 CMakeLists文件

add_library(xxx yy.cc)
target_link_libraries(xxx gflags)

3 glog

源码

git clone https://github.com/google/glog.git
cd glog
cmake -S . -B build -G "Unix Makefiles"
cmake --build build
cmake --build build --target test
sudo cmake --build build --target install

3.1 CMakeLists文件

add_library(xxx yy.cc)
target_link_libraries(xxx glog::glog)

4 eigen3

官网

sudo apt-get install libeigen3-dev
sudo cp -r /usr/include/eigen3 /usr/local/include

以上方法有些库会漏装,如果需要,去官网下载完成源程序包,然后将缺失的包拷到/usr/local/include目录下

sudo cp -r unsupported /usr/local/include

5 osqp

官网文档
github

git clone --recursive https://github.com/osqp/osqp
cd osqp
mkdir build
cd build
cmake -G "Unix Makefiles" ..
cmake --build .
sudo cmake --build . --target install

卸载

cmake --build . --target uninstall

5.1 CMakeLists文件

# Find OSQP library and headers
find_package(osqp REQUIRED)

# Link the OSQP shared library
target_link_libraries(yourTarget PRIVATE osqp::osqp)

# or...
# Link the OSQP static library
target_link_libraries(yourTarget PRIVATE osqp::osqpstatic)

6 abseil

官方安装教程
GitHub

git clone https://github.com/abseil/abseil-cpp.git
cd abseil-cpp
mkdir build && cd build
cmake -DBUILD_TESTING=ON -DABSL_USE_GOOGLETEST_HEAD=ON -DCMAKE_CXX_STANDARD=11 ..
cmake --build . --target all
ctest

7 PROJ

PROJ官方文档
proj的安装与使用

8 tinyxml2

github
引用
获取

git clone https://github.com/leethomason/tinyxml2

编译

cd tinyxml2/ 
cmake . 
make

测试

./xmltest

安装

sudo make install

也可以直接在工程中引入 tinyxml2.h 和 tinyxml2.cpp。

9 bazel

官方安装教程
c++构建教程

安装 GraphViz 和 xdot Dot Viewer 在本地查看图形:

sudo apt update && sudo apt install graphviz xdot

生成依赖图的文本表示(在工作区根目录运行命令):

xdot <(bazel query --notool_deps --noimplicit_deps "deps(//main:hello-world)" \
  --output graph)

在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值