How to install eigen 3.3 in Ubuntu 14.04?
Mia Lopez
I am using Ubuntu 14.04 and I want to install eigen 3.3 in the Ubuntu. I tried to download newest version of Eigen 3 (3.3) and install as following
mkdir build
cd build
cmake ..
make
sudo make install The output likes
-- Installing: /usr/local/include/eigen3/unsupported/Eigen/src/Skyline/SkylineStorage.h
-- Installing: /usr/local/include/eigen3/unsupported/Eigen/src/SparseExtra/RandomSetter.h
-- Installing: /usr/local/include/eigen3/unsupported/Eigen/src/SparseExtra/MarketIO.h
-- Installing: /usr/local/include/eigen3/unsupported/Eigen/src/SparseExtra/BlockOfDynamicSparseMatrix.h
-- Installing: /usr/local/include/eigen3/unsupported/Eigen/src/SparseExtra/DynamicSparseMatrix.h
-- Installing: /usr/local/include/eigen3/unsupported/Eigen/src/SparseExtra/MatrixMarketIterator.h
-- Installing: /usr/local/include/eigen3/unsupported/Eigen/src/Splines/SplineFwd.h
-- Installing: /usr/local/include/eigen3/unsupported/Eigen/src/Splines/SplineFitting.h
-- Installing: /usr/local/include/eigen3/unsupported/Eigen/src/Splines/Spline.hHowever, when I check the my current eigen version with dpkg -p libeigen3-dev, the output is
Package: libeigen3-dev
Priority: extra
Section: libdevel
Installed-Size: 3729
Maintainer: Ubuntu Developers <>
Architecture: all
Source: eigen3
Version: 3.2.0-8
Provides: libeigen2-dev
Depends: pkg-config
Suggests: libeigen3-doc, libmrpt-dev
Size: 494158It shown my setup does not finish. How can I install the eigen version in my Ubuntu? Thank all
This is error when I compile with CmakeList.txt at source code
-- ===============================================================
-- ============ Configuring CompileSettings =====================
-- ===============================================================
-- ============= Look for required libraries =====================
-- Looking for Eigen Library with minimum version 3.2.90
-- Looking for Eigen via User Provided (or Cached) location
-- Eigen version 3.2.0 found in /usr/include/eigen3
CMake Warning at cmake/FindEigen.cmake:62 (message): Eigen version is less than requred version 3.2.90
Call Stack (most recent call first): cmake/FindEigen.cmake:73 (Eigen_Check_Version) CMakeLists.txt:23 (FIND_PACKAGE)
CMake Error at /usr/local/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message): Could NOT find Eigen (missing: EIGEN_VERSION_OK) (Required is at least version "3.2.90")
Call Stack (most recent call first): /usr/local/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE) cmake/FindEigen.cmake:74 (find_package_handle_standard_args) CMakeLists.txt:23 (FIND_PACKAGE) 4 4 Answers
For those simply requiring a reasonably recent version of Eigen 3 on Ubuntu and similar Debian-based distros (...which is the common case), installing the existing libeigen3-dev package suffices: e.g.,
sudo apt install libeigen3-devManually downloading and installing Eigen 3 is probably overkill for most use cases.
3Eigen c++ is a header only library: you don't have to install it, you just download it, unzip it and link your code against it.
For example, if your code is in my_favorite_cpp_folder, you do:
cd my_favorite_cpp_folderand, assuming your compiler is gcc and the eigen headers are in /usr/local/include/eigen3/unsupported/ and the name of your source file
is my_favorite_cpp_source_file.cpp, you compile and code and link it to the eigen headers by doing:
g++ -I /usr/local/include/eigen3/ my_favorite_cpp_source_file.cpp -o my_favorite_cpp_source_file(from your code output posted above, the eigen headers are in /usr/local/include/eigen3/ in your computer)
dpkg only knows about software that you have installed by Ubuntu's standard package management tools. But that's not how you installed eigen.
You have installed from the source code, and as such dpkg doesn't know it. The output of dpkg -p libeigen3-dev is not about the eigen that you installed, but about a different version of eigen, installed using the standard package management tools.
Based on your output of sudo make install,
the version of eigen that you installed from source is ready to use,
its files are available in /usr/local/include/eigen3/unsupported/Eigen/src.
After extracting the compressed folder check the INSTALL file. I used the second option of installing using cmake. After which "eigen3" folder with the header files was created in /usr/local/include/ folder.
In your project you can include eigen headers like this:
#include <eigen3/Eigen/Dense>I forgot to mention this. Since the header files are in /usr/local/include/ folder you don't need to compile your source-code files against them using "g++ -I .... ."
Good luck!