重装系统记录环境配置
以下是在ubuntu20.04.5的镜像安装的系统中配置的
- 安装cmake
sudo apt update
sudo apt install cmake
cmake --version
- 安装eigen3.3.0
sudo apt install mlocate
wget https://gitlab.com/libeigen/eigen/-/archive/3.3.0/eigen-3.3.0.zip
unzip eigen-3.3.0.zip
cd eigen-3.3.0
mkdir build
cd build
cmake ..
sudo make install
sudo cp -r /usr/include/eigen3/Eigen/ /usr/include/
cd ..
cd ..
rm -rf eigen-3.3.0
rm -rf eigen-3.3.0.zip
# 检测当前版本
pkg-config --modversion eigen3
- 安装OpenCV3.4.1
下载并解压opencv-3.4.1和opencv_contrib-3.4.1
sudo apt-get install libgtk2.0-dev pkg-config
sudo apt install libopenmpi-dev
sudo apt install lam4-dev
sudo apt-get install libhdf5-dev
cd opencv-3.4.1/
mkdir build
cd build
cmake \
-DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_INSTALL_PREFIX=/usr/local/opencv/opencv-3.4.1 \
-DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-3.4.1/modules \
-DWITH_CUDA=OFF \
-DBUILD_DOCS=OFF \
-DBUILD_EXAMPLES=OFF \
-DBUILD_TESTS=OFF \
-DBUILD_PERF_TESTS=OFF \
..
make -j14
sudo make install
- 安装pcl1.9.1
需要eigen依赖的
sudo apt-get update
sudo apt-get install libqhull*
sudo apt-get install git build-essential linux-libc-dev
sudo apt-get install cmake cmake-gui
sudo apt-get install libusb-1.0-0-dev libusb-dev libudev-dev
sudo apt-get install mpi-default-dev openmpi-bin openmpi-common
sudo apt-get install libflann1.9 libflann-dev
sudo apt-get install libboost-all-dev
sudo apt-get install libqhull* libgtest-dev
sudo apt-get install freeglut3-dev pkg-config
sudo apt-get install libxmu-dev libxi-dev
sudo apt-get install mono-complete
sudo apt-get install libopenni-dev
sudo apt-get install libopenni2-dev
sudo apt-get install libvtk7-dev libvtk6-dev
sudo apt-get install qt5-default
git clone https://github.com/PointCloudLibrary/pcl.git
cd pcl/
git checkout tags/pcl-1.9.1
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/local/pcl/pcl-1.9.1 \
..
make -j14
sudo make install
5.安装pangolin0.6
需要eigen依赖的
sudo apt-get install libglew-dev libboost-dev libboost-thread-dev libboost-filesystem-dev -y
wget https://github.com/stevenlovegrove/Pangolin/archive/refs/tags/v0.6.zip
unzip v0.6.zip
mv Pangolin-0.6 Pangolin
cd Pangolin
mkdir build
cd build
cmake ..
make -j14
sudo make install
配置.bashrc
环境
~/.bashrc
中添加eigen3、opencv、pcl路径
#eigen3
export Eigen3_DIR=/usr/local/include/eigen3/Eigen
#opencv
export OpenCV_DIR=/usr/local/opencv/opencv-3.4.1
#pcl
export PCL_DIR=/usr/local/pcl/pcl-1.9.1
补充一些依赖
一键安装
sudo apt-get install libssl-dev
sudo apt-get install libcanberra-gtk-module
sudo apt-get install pcl-tools
编译安装
- fmt
Sophus的库会用的这个fmt依赖git clone https://github.com/fmtlib/fmt.git cd fmt mkdir build cd build cmake .. make sudo make install