xdspacelab / openvslam

OpenVSLAM: A Versatile Visual SLAM Framework
https://openvslam.readthedocs.io/
2.97k stars 870 forks source link

G2O_SOLVER_CHOLMOD problem solved, faulty build instructions for g2o #241

Open EnjoyRobotics opened 4 years ago

EnjoyRobotics commented 4 years ago

When installing the prerequisite packages the installation page specifies the g2o cmake as:

cmake \ 
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr/local \
    -DCMAKE_CXX_FLAGS=-std=c++11 \
    -DBUILD_SHARED_LIBS=ON \
    -DBUILD_UNITTESTS=OFF \
    -DBUILD_WITH_MARCH_NATIVE=ON \
    -DG2O_USE_CHOLMOD=OFF \
    -DG2O_USE_CSPARSE=ON \
    -DG2O_USE_OPENGL=OFF \
    -DG2O_USE_OPENMP=ON \
    ..

In this case when trying to build OpenVSLAM an error occurs which says that G2O_SOLVER_CHOLMOD is NOTSET. This is understandable as I used the instructions above which specify DG2O_USE_CHOLMOD=OFF. Change it to ON and OpenVSLAM will compile assuming you had the same problem.

The complete and fixed build instructions for g2o:

cd /path/to/working/dir
git clone https://github.com/RainerKuemmerle/g2o.git
cd g2o
git checkout 9b41a4ea5ade8e1250b9c1b279f3a9c098811b5a
mkdir build && cd build
cmake \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr/local \
    -DCMAKE_CXX_FLAGS=-std=c++11 \
    -DBUILD_SHARED_LIBS=ON \
    -DBUILD_UNITTESTS=OFF \
    -DBUILD_WITH_MARCH_NATIVE=ON \
    -DG2O_USE_CHOLMOD=ON \
    -DG2O_USE_CSPARSE=ON \
    -DG2O_USE_OPENGL=OFF \
    -DG2O_USE_OPENMP=ON \
    ..
make -j4
make install

Please change the installation documentation.

Have a nice day!

PiStar commented 4 years ago

@EnjoyRobotics Thank you for your solution. You save my day.