lio_sam_6axis编译需要现安装gtsam4.0.2
wget -O ~/Downloads/gtsam.zip https://github.com/borglab/gtsam/archive/4.0.2.zip
cd ~/Downloads/ && unzip gtsam.zip -d ~/Downloads/
cd ~/Downloads/gtsam-4.0.2/
mkdir build && cd build
cmake -DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF ..
make -j8
sudo make install
安装完如果还报错:
/home/ant/work/autoware.ai/install/lio_sam_6axis/lib/lio_sam_6axis/lio_sam_6axis_mapOptmization: symbol lookup error: /home/ant/work/autoware.ai/install/lio_sam_6axis/lib/lio_sam_6axis/lio_sam_6axis_mapOptmization: undefined symbol: _ZNK5gtsam16NoiseModelFactor5printERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKN5boost8functionIFS6_mEEE
原因可能是多次版一gtsam的源文件,导致共享文件出问题了,可以尝试删除/usr/lib下的共享文件,从/usr/local/lib拷贝过去。
cd /usr/lib
sudo rm -rf libgtsam.so.4
sudo rm -rf libmetis.so
cd /usr/local/lib
sudo cp libgtsam.so.4 /usr/lib
sudo cp libmetis.so /usr/lib
再重新安装gtsam即可。
cd ~/work/tools/gtsam/build
sudo make install
还报错的话尝试降低gtsam的版本,用4.0.1试试。
conflicting declaration ‘typedef struct LZ4_stream_t LZ4_stream_t’解决
终端输入:
sudo mv /usr/include/flann/ext/lz4.h /usr/include/flann/ext/lz4.h.bak
sudo mv /usr/include/flann/ext/lz4hc.h /usr/include/flann/ext/lz4.h.bak
sudo ln -s /usr/include/lz4.h /usr/include/flann/ext/lz4.h
sudo ln -s /usr/include/lz4hc.h /usr/include/flann/ext/lz4hc.h