Ceres installation error "can not find the required version 3.3 of Eigen3" solution

problem

Can not find Eigen3.3 error prompt when you install Ceres library cmake.

Could not find a configuration file for package "Eigen3" that is compatible with requested version "3.3".

Can be seen in the corresponding CMakeLists.txt, since BA Eigen optimization may fail in less than version 3.3.4, it is required not less than Eigen version 3.3.4.

Eigen version can  /usr/include/eigen3/Eigen/src/Core/util/Macros.h  see in my version is 3.2.9, so  find_package  error may occur when 3.3.x version of Eigen.

Solution

Uninstall the original Eigen, after installing the new version 3.3.4.

First uninstall Eigen, locate the relevant documents, direct manually deleted.

sudo updatedb  
locate eigen3 
sudo rm -rf /usr/include/eigen3 /usr/lib/cmake/eigen3 /usr/share/doc/libeigen3-dev /usr/share/pkgconfig/eigen3.pc /var/lib/dpkg/info/libeigen3-dev.list /var/lib/dpkg/info/libeigen3-dev.md5sums

Then download and install Eigen after 3.3.4 version, apt-get not specify Eigen version, manual installation is recommended.

Download   https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.tar.gz  . I got the latest version 3.3.7.

Install dependencies

 1 sudo apt-get install libopenblas-dev
 2 sudo apt-get install --no-install-recommends libboost1.58-all-dev
 3 sudo apt-get install libx11-dev
 4 sudo apt-get install libgl1-mesa-dev 
 5 sudo apt-get install libglu1-mesa-dev 
 6 sudo apt-get install freeglut3-dev
 7 sudo apt-get install doxygen
 8 sudo apt-get install cmake
 9 sudo wget https://nchc.dl.sourceforge.net/project/glew/glew/2.1.0/glew-2.1.0.tgz --no-check-certificate
10 sudo tar -xzvf glew-2.1.0.tgz
11 cd glew-2.1.0/
12 sudo make 
13 sudo make install
14 sudo ldconfig -v

Installation Eigen3.3.7

1 mkdir build
2 cd build
3 cmake ..
4 make
5 sudo make install
6 sudo ldconfig -v

eigen3 apt-get path is installed  / usr / include / eigen3  , here has been held; Also, use the following command is mapped to the Eigen / usr / include path, because it is often used in many programs include #include <Eigen / Dense> instead of using #include <eigen3 / Eigen / Dense> , does not map if some programs have failed to find Eigen / Dense and error at compile time.

sudo cp -r /usr/local/include/eigen3 /usr/include/eigen3 
sudo ln -s /usr/include/eigen3/Eigen /usr/include/Eigen

At this point you're done, it will not install Ceres being given.

 

Guess you like

Origin www.cnblogs.com/didada/p/12305066.html