How to check the version number of Eigen C++ template library?
Asked Answered
K

4

41

I added several different versions of Eigen to default including directory of Visual C++. But I got collapse problem when using LDLT (Cholesky decomposition) for some of the testing numerical examples.

So I want to determine which version is actually active when debugging the code.

Is there any function which can indicate the current active Eigen version number?

Kinsler answered 1/2, 2014 at 10:47 Comment(4)
At compile-time you have EIGEN_WORLD_VERSION, EIGEN_MAJOR_VERSION and EIGEN_MINOR_VERSION, you can easily embed this information in your application.Recombination
Thank you very much. One more question, if they are 3, 1 and 91 respectively, does this mean the most latest 3.20 since there is no 3.191 release?Kinsler
3.1.91 sounds like a beta version of 3.2 to me, but I don't know for sure.Recombination
It is not the desired 3.2.0 release. The version number macros are defined in Macros.h located at \Eigen\src\Core\util\. thank you.Kinsler
K
48

This answer is only a summary from the comments above:

  • At compile-time you have EIGEN_WORLD_VERSION, EIGEN_MAJOR_VERSION and EIGEN_MINOR_VERSION, you can easily embed this information in your application.

  • 3.1.91 sounds like a beta version of 3.2.

  • The version number macros are defined in Macros.h located at \Eigen\src\Core\util\.

Kinsler answered 30/3, 2014 at 0:31 Comment(1)
On Debian or similar: cat /usr/include/eigen3/Eigen/src/Core/util/Macros.h | grep VERSION will show you the version.Disafforest
Y
21

In order to check the version number of Eigen C++ template library, just type

dpkg -p libeigen3-dev

in the terminal. Or just type

pkg-config --modversion eigen3

you will get the Eigen version.

Yearbook answered 3/2, 2018 at 13:44 Comment(1)
Kinda funny, first command gives "3.2.0-8" and second one "3.2.92".Disafforest
E
5

Although it is not the goal of the OP, people finding this question may be interested in checking if the version is equal to are newer than a specific release for compatibility reasons with different versions of Eigen. This can be done more easily using the EIGEN_VERSION_AT_LEAST(x, y, z) macro as follows:

#if EIGEN_VERSION_AT_LEAST(3,3,0)
    // Implementation for Eigen 3.3.0 and newer
#else
    // Implementation for older Eigen versions
#endif 

This macro is also defined in Eigen/src/Core/util/Macros.h and uses EIGEN_WORLD_VERSION, EIGEN_MAJOR_VERSION and EIGEN_MINOR_VERSION internally.

Epistaxis answered 27/6, 2017 at 11:34 Comment(0)
P
5

On Linux:

grep "#define EIGEN_[^_]*_VERSION" /usr/local/include/eigen3/Eigen/src/Core/util/Macros.h

You'll get something like:

#define EIGEN_WORLD_VERSION 3
#define EIGEN_MAJOR_VERSION 3
#define EIGEN_MINOR_VERSION 7

It means version 3.3.7

Peafowl answered 28/5, 2020 at 7:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.