Namely, you can set up Eigen in three ways:
- download
eigenusing a package manager (for Mac and Ubuntu) - download the repository and configure.
- clone the repository and configure
Below, we discuss these options in detail
for Mac, install eigen using package manager brew as
$ brew install eigenFor ubuntu, install eigen using apt-get as
$ sudo apt-get install libeigen3-devUnfortunately, for windows, there is not a easyway to install eigen with commands.
Download the repository from here
http://eigen.tuxfamily.org/index.php?title=Main_Page#Download
- Download the compressed file (e.g.,
eigen-3.*.*.zip) and extract it. This result in a directoryeigen-3.*.* - Put the extracted file under the
3rd_partydirectory asdelfem2/3rd_party/eigen-3.*.*.
Then type the commands below
cd delfem2/3rd_party/eigen-3.*.* # move to the directory
mkdir build # make a new directory for "out-of-source build"
cd build # move to the new directory
cmake .. # configure (this may take one or two minutes)
cmake --install . --prefix ../../Eigen_Lib # copy configured files to "Eigen_Lib"Make sure you have a header file Dense at
delfem2/3rd_party/Eigen_Lib/include/eigen3/Eigen/Dense
Basically it is similar to the "Download & Configure" approach. The only difference is that instead of download we use submodule to clone the Eigen repository.
$ git submodule update --init 3rd_party/eigen # clone the "eigen" repository
$ cd 3rd_party/eigen # move to the eigen repository
$ mkdir build # make a directory for "out-of-source build"
$ cd build # move to the new directory
$ cmake .. # configure (this may take one or two minutes)
$ cmake --install . --prefix ../../Eigen_Lib # copy files into the "Eigen_Lib" folderMake sure you have a header file Dense at
delfem2/3rd_party/Eigen_Lib/include/eigen3/Eigen/Dense