When learning slam, we need to install eigen, but some commands are easy to install but the version is not enough, so we need to upgrade them.
Table of contents
1. Check the version and uninstall the old version of eigen
1. Download the installation package
1. Check the version and uninstall the old version of eigen
1. Check version
Open a terminal and enter:
cat /usr/include/eigen3/Eigen/src/Core/util/Macros.h
You can find the version by searching:
At this time I have upgraded to 3.4.0.
2. Uninstall the old version
First check the eigen location:
sudo updatedb
locate eigen3
At this time, a bunch of eigen component locations appear, which are distributed in local var include and other folders under /usr. You can try the following command:
sudo rm -rf /usr/include/eigen3
sudo rm -rf /usr/lib/cmake/eigen3
sudo rm -rf /usr/local/include/eigen3
sudo rm -rf /usr/share/doc/libeigen3-dev
sudo rm -rf /usr/local/share/pkgconfig/eigen3.pc /usr/share/pkgconfig/eigen3.pc /var/lib/dpkg/info/libeigen3-dev.list /var/lib/dpkg/info/libeigen3-dev.md5sums
Then take a look at the location. If there are still some that have not been deleted, just continue to use the rm command to delete them:
sudo rm -rf /位置
2. eigen-3.4.0 installation
1. Download the installation package
You can download it with the command. I went directly to the official website Eigen to download the tar.gz file:
Eigenhttp://eigen.tuxfamily.org/index.php?title=Main_Page
By default, it should be downloaded to the /home/user/ folder.
2.Installation
1. Decompress directly:
sudo tar -xvzf eigen-3.4.0.tar.gz
The result is:
2. Enter the folder, create the build folder and enter
cd eigen-3.4.0
sudo mkdir build
cd build
3.Compile
sudo cmake ..
The result is:
4.Installation
sudo make install
The result is:
5. Copy the eigen file to the local calling folder /usr/include
sudo cp -r /usr/local/include/eigen3 /usr/include
Now that the installation is complete, you can check the version and try it out.