赞
踩
一般库标准安装
进入库根目录
mkdir build
cd build
cmake ..
make
sudo make install
ubuntu安装eigen3.3.7
提示 不要使用:
sudo apt-get install libeigen3-dev
进行安装,其无法指定安装版本,默认安装的是eigen3.3.2的。
查看已安装版本:
gedit /usr/include/eigen3/Eigen/src/Core/util/Macros.h
或
gedit /usr/local/include/eigen3/Eigen/src/Core/util/Macros.h
卸载先前版本:
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
安装下载压缩包链接:
https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.tar.gz
安装步骤:
sudo tar -xzvf eigen-3.3.7.tar.gz
cd eigen-3.3.7
mkdir build
cd build
sudo cmake ..
sudo make install
#安装后,头文件安装在/usr/local/include/eigen3/
sudo cp -r /usr/local/include/eigen3/Eigen /usr/local/include
高翔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 ----版本不限
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
安装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
报错:
/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
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
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
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。