安装boost
Boost >= 1.43 (Ubuntu: sudo apt-get install libboost-all-dev)
安装cmake
CMake >= 3.0 (Ubuntu: sudo apt-get install cmake)
安装TBB
sudo apt-get install libtbb-dev
安装MKL
ubuntu安装与卸载MKL_伴着音乐入梦的博客-CSDN博客按照下面网站循序安装,卸载方法也在里面Installing Intel® Performance Libraries and Intel® Distribution for...这一部只装MKL即可https://blog.csdn.net/weixin_44577224/article/details/124538678?csdn_share_tail=%7B%22type%22%3A%22blog%22%2C%22rType%22%3A%22article%22%2C%22rId%22%3A%22124538678%22%2C%22source%22%3A%22weixin_44577224%22%7D&ctrtid=lTEJd下载gtsam
git clone https://bitbucket.org/gtborg/gtsam.git #如果此方法不可行可以在github上下载,链接在下面
在github上下载gtsam源文件
GitHub - borglab/gtsam: GTSAM is a library of C++ classes that implement smoothing and mapping (SAM) in robotics and vision, using factor graphs and Bayes networks as the underlying computing paradigm rather than sparse matrices.GTSAM is a library of C++ classes that implement smoothing and mapping (SAM) in robotics and vision, using factor graphs and Bayes networks as the underlying computing paradigm rather than sparse matrices. - GitHub - borglab/gtsam: GTSAM is a library of C++ classes that implement smoothing and mapping (SAM) in robotics and vision, using factor graphs and Bayes networks as the underlying computing paradigm rather than sparse matrices.https://github.com/borglab/gtsam按照以下命令进行安装
cd gtsam/
mkdir build
cd build
cmake ..
make check
sudo make install
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}
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}
gtsam如果需要安装其他版本需要卸载旧的版本可参考github上的方法:
how can i uninstall gtsam? · Issue #562 · borglab/gtsam · GitHub
最好的办法是再次运行新安装包的构建和安装过程就会覆盖以前的版本。