Cyberithub

How to Install Eigen3 on Ubuntu 20.04 LTS (Focal Fossa)

Advertisements

In this article, we will see how to install eigen3 on Ubuntu 20.04 LTS (Focal Fossa). Eigen is a free, fast and versatile C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms. It supports various metrics sizes and decompositions along with other geometrical features. More on official website. The template library is available through libeigen3-dev package. It is very easy to install the package in Windows as well as in almost all the Linux distributions. Here we will see the steps to install Eigen3 on Ubuntu 20.04 LTS based system.

 

How to Install Eigen3 on Ubuntu 20.04 LTS (Focal Fossa)

How to Install Eigen3 on Ubuntu 20.04 LTS (Focal Fossa)

Also Read: How to Install Pygame on Ubuntu 20.04 LTS (Focal Fossa)

Step 1: Prerequisites

a) You should have a running Ubuntu 20.04 LTS Server.

b) You should have sudo or root access to run privileged commands.

c) You should have apt or apt-get utility available in your Server.

d) You should have Standard C++ Library installed in your Server.

 

Step 2: Update Your Server

Before installing Eigen3 C++ template library, it is recommended to first update and sync all the installed packages with the latest available versions from default Ubuntu repo using sudo apt update && sudo apt upgrade command as shown below.

cyberithub@ubuntu:~$ sudo apt update && sudo apt upgrade
Hit:1 https://downloads.plex.tv/repo/deb public InRelease
Hit:2 https://dl.google.com/linux/chrome/deb stable InRelease
Hit:3 http://in.archive.ubuntu.com/ubuntu focal InRelease
Hit:4 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:5 http://in.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:6 http://in.archive.ubuntu.com/ubuntu focal-backports InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
30 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
libblas3 libexpat1-dev libfluidsynth2 libfwupdplugin1 libgfortran5 libinstpatch-1.0-2 liblapack3 libllvm11 libmad0 libmikmod3 libopenal-data libopenal1
libportmidi0 libpython3-dev libpython3.8-dev libsdl-image1.2 libsdl-mixer1.2 libsdl-ttf2.0-0 libsdl1.2debian libsdl2-2.0-0 libsndio7.0 libxmlb1
python-pip-whl python3-dev python3-numpy python3-wheel python3.8-dev timgm6mb-soundfont zlib1g-dev zsh-common
Use 'sudo apt autoremove' to remove them.
#
# News about significant security updates, features and services will
# appear here to raise awareness and perhaps tease /r/Linux ;)
# Use 'pro config set apt_news=false' to hide this and future APT news.
#
The following packages will be upgraded:
apport apport-gtk dnsmasq-base google-chrome-stable libfprint-2-2 libfprint-2-tod1 libmysqlclient21 libnss-systemd libpam-systemd libsmbclient
libsystemd0 libudev1 libwbclient0 linux-firmware mysql-client-8.0 mysql-client-core-8.0 mysql-server mysql-server-8.0 mysql-server-core-8.0
plexmediaserver python3-apport python3-problem-report samba-libs systemd systemd-sysv systemd-timesyncd tzdata ubuntu-advantage-tools udev
xdg-desktop-portal
30 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 352 MB of archives.
...................................................

 

Step 3: Install Eigen3

In the next step, you can install Eigen3 package from default Ubuntu repo by using sudo apt install libeigen3-dev command as shown below. This will download and install the package along with all its dependencies.

cyberithub@ubuntu:~$ sudo apt install libeigen3-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libblas3 libexpat1-dev libfluidsynth2 libfwupdplugin1 libgfortran5 libinstpatch-1.0-2 liblapack3 libllvm11 libmad0 libmikmod3 libopenal-data libopenal1
libportmidi0 libpython3-dev libpython3.8-dev libsdl-image1.2 libsdl-mixer1.2 libsdl-ttf2.0-0 libsdl1.2debian libsdl2-2.0-0 libsndio7.0 libxmlb1
python-pip-whl python3-dev python3-numpy python3-wheel python3.8-dev timgm6mb-soundfont zlib1g-dev zsh-common
Use 'sudo apt autoremove' to remove them.
Suggested packages:
libeigen3-doc libmpfrc++-dev
The following NEW packages will be installed:
libeigen3-dev
0 upgraded, 1 newly installed, 0 to remove and 30 not upgraded.
Need to get 815 kB of archives.
After this operation, 7,161 kB of additional disk space will be used.
Get:1 http://in.archive.ubuntu.com/ubuntu focal/universe amd64 libeigen3-dev all 3.3.7-2 [815 kB]
Fetched 815 kB in 2s (424 kB/s)
Selecting previously unselected package libeigen3-dev.
(Reading database ... 204934 files and directories currently installed.)
Preparing to unpack .../libeigen3-dev_3.3.7-2_all.deb ...
Unpacking libeigen3-dev (3.3.7-2) ...
Setting up libeigen3-dev (3.3.7-2) ...

 

Step 4: Verify Installation

After successful installation, you can list the installed files path by using dpkg -L libeigen3-dev command as shown below. You can now start using the template library in your C++ programs.

cyberithub@ubuntu:~$ dpkg -L libeigen3-dev
/.
/usr
/usr/include
/usr/include/eigen3
/usr/include/eigen3/Eigen
/usr/include/eigen3/Eigen/Cholesky
/usr/include/eigen3/Eigen/CholmodSupport
/usr/include/eigen3/Eigen/Core
/usr/include/eigen3/Eigen/Dense
/usr/include/eigen3/Eigen/Eigen
/usr/include/eigen3/Eigen/Eigenvalues
/usr/include/eigen3/Eigen/Geometry
/usr/include/eigen3/Eigen/Householder
/usr/include/eigen3/Eigen/IterativeLinearSolvers
/usr/include/eigen3/Eigen/Jacobi
/usr/include/eigen3/Eigen/LU
/usr/include/eigen3/Eigen/MetisSupport
/usr/include/eigen3/Eigen/OrderingMethods
/usr/include/eigen3/Eigen/PaStiXSupport
/usr/include/eigen3/Eigen/PardisoSupport
/usr/include/eigen3/Eigen/QR
.............................................

1 thought on “How to Install Eigen3 on Ubuntu 20.04 LTS (Focal Fossa)”

Leave a Comment