这里建议从这个链接下,不要从官网下,可能会有版本冲突
git clone https://bitbucket.org/gtborg/gtsam.git2.安装依赖
有必选和可选项,最后一个安装比较麻烦
// Boost >= 1.43 sudo apt-get install libboost-all-dev // CMake >= 3.0 sudo apt-get install cmake // gcc至少4.7.3 A modern compiler, i.e., at least gcc 4.7.3 on Linux. // 以下是可选项 sudo apt-get install libtbb-dev https://software.intel.com/content/www/us/en/develop/articles/installing-intel-free-libs-and-python-apt-repo.html3.编译
mkdir build cd build cmake .. // make时间非常久,建议添加 -j12 使用12个线程编译 make check -j12 // 这一步要加sudo,不然会在最后报错 sudo make install报错: 1.cd的编译器版本问题
error: invalid initialization of reference of type ‘const std::vector
124 | const std::vector
百度和google都查不到,只能知道是c++语法错误。
原因:由于是新的ubuntu系统,回想安装过程,应该是gcc/g++版本问题,因为之前庄ceres时切换到了11,而ubuntu默认的是7。
解决办法:切换回默认的gcc7和g++7,即可解决报错。
2.最后还有一个小bug最后一个测试用例为通过,影响未知:



