当前位置:   article > 正文

slam必备库安装_locate package libeigen3-dev

locate package libeigen3-dev

一般库标准安装
进入库根目录
mkdir build
cd build
cmake ..
make
sudo make install

ubuntu安装eigen3.3.7
提示 不要使用:

sudo apt-get install libeigen3-dev
  • 1

进行安装,其无法指定安装版本,默认安装的是eigen3.3.2的。

查看已安装版本:

gedit /usr/include/eigen3/Eigen/src/Core/util/Macros.h
  • 1

gedit /usr/local/include/eigen3/Eigen/src/Core/util/Macros.h
  • 1

卸载先前版本:
sudo updatedb
locate eigen3
得到eigen库的位置

卸载:

sudo rm -rf /usr/include/eigen3 /usr/lib/cmake/eigen3 /usr/share/doc/libeigen3-dev /usr/share/pkgconfig/eigen3.pc /var/lib/dpkg/info/libeigen3-dev.list /var/lib/dpkg/info/libeigen3-dev.md5sums
  • 1

安装下载压缩包链接:

https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.tar.gz
  • 1

安装步骤:

解压

sudo tar -xzvf eigen-3.3.7.tar.gz

安装

cd eigen-3.3.7
mkdir build
cd build
sudo cmake ..
sudo make install
  • 1
  • 2
  • 3
  • 4
  • 5

#安装后,头文件安装在/usr/local/include/eigen3/

移动头文件:

sudo cp -r /usr/local/include/eigen3/Eigen /usr/local/include

  • 在很多程序中include时经常使用#include <Eigen/Dense>;否则系统无法默认搜索到,build时会找不到;
  • 或者直接修改CmakeLists.txt中eigen3库的路径,include_directories( “/usr/local/include/eigen3” ),但太麻烦!

高翔slambook2https://github.com/gaoxiang12/slambook2/使用的库版本。最新的会报错。
g2o:g2o-20201223_git
ceres:ceres-solver-1.14.0
Pangolin:不用最新的,用v0.5
fmt:fmt-7.1.1
cmake:cmake-3.19.8 ----版本不限
eigen:eigen-3.3.7 ----版本不限

g2o install dependencies

sudo apt install libdc1394-22-dev libjpeg-dev libftdi-dev freeglut3-dev libwxgtk3.0-dev zlib1g-dev libusb-1.0-0-dev libudev-dev libfreenect-dev libavformat-dev libswscale-dev libassimp-dev libgtest-dev libpcap-dev
  • 1
第一次运行slam十四讲13章Could NOT find GTest (missing: GTEST_LIBRARY GTEST_MAIN_LIBRARY)

安装GTest

 sudo apt-get install libgoogle-glog-dev  
sudo apt-get install libgtest-dev
sudo apt-get install cmake
cd /usr/src/gtest
sudo cmake CMakeLists.txt
sudo make
sudo cp *.a /usr/lib
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

报错:

/usr/bin/ld: ../../bin/run_kitti_stereo: hidden symbol `_ZNK3fmt2v86detail10locale_ref3getISt6localeEET_v' in //usr/local/lib/libfmt.a(format.cc.o) is referenced by DSO
/usr/bin/ld: 最后的链结失败: 错误的值
collect2: error: ld returned 1 exit status
app/CMakeFiles/run_kitti_stereo.dir/build.make:131: recipe for target '../bin/run_kitti_stereo' failed
make[2]: *** [../bin/run_kitti_stereo] Error 1
CMakeFiles/Makefile2:185: recipe for target 'app/CMakeFiles/run_kitti_stereo.dir/all' failed
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

fmt 版本使用了v8,使用fmt-7.1.1解决
遇到libgflags.a(gflags.cc.o): relocation R_X86_64_32 against `.rodata.str1.1’ ca时
glfag编译成动态库
gflags 正确的安装方法是这样的:

mkdir build 
cd build 
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=ON -DGFLAGS_NAMESPACE=google -G "Unix Makefiles" ../ 
make
sudo make install 
sudo ldconfig 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

cd boost_1_66_0

构建符合环境的脚本

./bootstrap.sh

编译你懂得

./b2 install

ubuntu18.04安装Ceres

1、软件包下载:

下载地址: https://github.com/ceres-solver/ceres-solver/releases 如果Github下载速度慢可在百度云盘下载

2、安装编译Ceres库所需依赖项:
$ sudo apt-get install liblapack-dev libsuitesparse-dev libcxsparse3.1.2 libgflags-dev libgoogle-glog-dev libgtest-dev

可能会出现无法定位libcxsoarse3.1.2的问题

解决方法:
//第一步,打开sources.list
$ sudo gedit /etc/apt/sources.list
//第二步,将下面的源粘贴到最上方sources.list
$ deb http://cz.archive.ubuntu.com/ubuntu trusty main universe
//第三步,更新源
$ sudo apt-get update
//第四步,重新输入依赖项安装命令安装依赖项
$ sudo apt-get install liblapack-dev libsuitesparse-dev libcxsparse3.1.2 libgflags-dev libgoogle-glog-dev libgtest-dev

3、然后解压ceres,打开终端进入解压后的文件,编译安装:
$ mkdir build
$ cd build
$ cmake …
$make -j8 //可用nproc这个命令查看cpu核心数,我的cpu核心数是8

4、安装

$ sudo make install

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/555974
推荐阅读
相关标签
  

闽ICP备14008679号