pleas install ceres firs. You can follow this website https://www.ceres-solver.org/
sudo apt-get install libboost-all-dev
sudo apt-get install libeigen3-dev
sudo apt-get install libglew-dev
please install g2o. You can follow this one https://github.com/RainerKuemmerle/g2o