最近在学习LIO_SAM,编译都没问题,但是运行
roslaunch lio_sam run.launch
会遇到莫名其妙的进程死亡[2]:
[lio_sam_imuPreintegration-2] process has died [pid 5700, exit code -11,。。。。
这意味着在gtsam编译时就出现了问题,起初降低了boost版本即可,以为是gtsam不支持太高的boost版本,但发现可能主要原因是cmake无法编译高版本的boost原因。
本人用的cmake是3.19,boost1.76,编译时会输出
New Boost version may have incorrect or missing dependencies and imported targets
原因是cmake版本比boost版本旧,如果想使用特定版本的boost,就得使用在该boost发布后发布的cmake版本。
These warnings simply mean that your CMake version is older than your Boost version. The CMake devs can update their dependency lists only after a new Boost release, so you need to update to a CMake version that was released after boost 1.75.
详见:
https://stackoverflow.com/questions/65560775/cmake-new-boost-version-may-have-incorrect-or-missing-dependencies-and-importe
本人是将boost1.76的版本换成了1.66版本,其中1.66地址:
https://nchc.dl.sourceforge.net/project/boost/boost/1.66.0/boost_1_66_0.tar.bz2
解压后,在解压文件夹中打开中断,运行bootstrap.sh
./bootstrap.sh
生成bjam,上述命令可以带有各种选项,具体可参考帮助文档: ./bootstrap.sh --help。其中--prefix参数,可以指定安装路径,如果不带--prefix参数的话(推荐),默认路径是 /usr/local/include 和 /usr/local/lib,分别存放头文件和各种库。下一步安装(会覆盖原来版本):
sudo ./b2 install
如果安装时没注意,但又希望该库可以在/usr/lib中找到,可以将/usr/local/lib添加到默认库:
sudo echo “/usr/local/lib” >>/etc/ld.so.conf
也可以直接手动复制:
sudo cp /usr/local/lib/libboost*1.66.0 /usr/lib
可能遇到1.76在usr/lib/camke和usr/lib/中残留问题:
Could NOT find Boost: missing: serialization filesystem program_options timer regex (found /usr/lib/cmake/Boost-1.76.0/BoostConfig.cmake (found suitable version "1.76.0", minimum required is "1.58"))
手动删除:
sudo rm /usr/lib/libboost*1.76.0 sudo rm -r /usr/lib/cmake/*oost*1.76.0* sudo rm /usr/lib/cmake/*oost*1.76.0*
最后重新编译安装gtsam。
希望可以帮助到您~
相关索引: 1.New Boost version may have incorrect or missing dependencies and imported targets
2.[lio_sam_imuPreintegration-2] process has died [pid 5700, exit code -11