1.安装boost和cmake推荐连接
2.安装 TBB
sudo apt-get install libtbb-dev
3.安装MKL官网链接
我安装的是full
sudo apt-get install intel-mkl-full
4.下载gtsam
git clone https://bitbucket.org/gtborg/gtsam.git
5.编译
cd ~/gtsam mkdir build cd build cmake .. make check #可选的,运行单元测试 sudo make install
修改cmakelist
Q1:cmake .. 编译中出现的错误
CMake Error at wrap/CMakeLists.txt:29 (target_link_libraries):
The "debug" argument must be followed by a library.
解决方法
找到gtsam/wrap/CMakeLists 文件 把以下内容注释或者删除
debug
${Boost_FILESYSTEM_LIBRARY_DEBUG}
${Boost_SYSTEM_LIBRARY_DEBUG}
${Boost_THREAD_LIBRARY_DEBUG}
Q2 cmake .. 编译中出现的错误
CMake Error at gtsam/CMakeLists.txt:105 (target_link_libraries):
The "debug" argument must be followed by a library.
解决方法
注释或删掉gtsam/CMakeLists文件中的俩处代码
debug
${Boost_SERIALIZATION_LIBRARY_DEBUG}
${Boost_SYSTEM_LIBRARY_DEBUG}
${Boost_FILESYSTEM_LIBRARY_DEBUG}
${Boost_THREAD_LIBRARY_DEBUG}
${Boost_DATE_TIME_LIBRARY_DEBUG}
${Boost_REGEX_LIBRARY_DEBUG}
debug
${Boost_TIMER_LIBRARY_DEBUG}
${Boost_CHRONO_LIBRARY_DEBUG}