Is it possible to build Eigen lib for C++ instead of using pre-built files?

时间:2015-07-29 00:15:48

标签: c++ eigen

I am using pre-built 3.2.5 Eigen lib files, downloaded from website: http://eigen.tuxfamily.org/index.php?title=Main_Page

I heard if I built the files by myself on my PC I could achieve higher compatibility with my processor what would lead to slight increase of lib's performance. Currently I am struggling with eigensolver calculation time being too long.

I use Visual Studio 2005 and I just add Eigen files location to my projects properties linker.

Is there any way to build those files myself on my platform? I am a bit confused how could I do it. Is it related to CMake?

1 个答案:

答案 0 :(得分:2)

没有要构建的库,因为Eigen是一个纯粹的模板头库"。来自主site

  

要求

     

Eigen除了C ++标准之外没有任何依赖关系   库。

     

我们使用CMake构建系统,但仅用于构建文档和   单元测试,以及自动化安装。如果你只是想使用   Eigen,您可以立即使用头文件。没有二进制文件   要链接到的库,没有配置的头文件。 Eigen是纯粹的   标题中定义的模板库。

您不需要将文件位置添加到链接器,而是添加到项目中的(附加)目录或属性表中。

关于计算时间,请确保您在Release中运行而不是在Debug中运行。速度差异大约为100。此外,请确保打开优化(/ O2或/ Ox)。