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
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
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
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
8 tinyxml2
git clone https://github.com/leethomason/tinyxml2
编译
cd tinyxml2/
cmake .
make
测试
./xmltest
安装
sudo make install
也可以直接在工程中引入 tinyxml2.h 和 tinyxml2.cpp。
9 bazel
安装 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)