在编译过程中遇到如下问题:
Could NOT find CSPARSE (missing: CSPARSE_INCLUDE_DIR CSPARSE_LIBRARY)
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CSPARSE_INCLUDE_DIR
解决方案:
运行 sudo apt-get install libsuitesparse-dev 安装相关依赖包。
二、错误如下
required from here
/usr/local/include/g2o/core/block_solver.hpp:182:5: error: request for member ‘resize’ in ‘schurMatrixLookup->g2o::SparseBlockMatrixHashMap<MatrixType>::blockCols<Eigen::Matrix<double, 6, 6, 0> >()’, which is of non-class type ‘int’
schurMatrixLookup->blockCols().resize(_Hschur->blockCols().size());
解决方案:
产生这个错误的原因是g2o版本的问题,按照如下顺序进行安装即可。
git clone https://github.com/RainerKuemmerle/g2o.git
cd g2o
mkdir build
cd build
cmake ..
make
sudo make install