Registered Member
|
I am trying to use Eigen 3.2.2 with OpenBLAS as a backend, but I get a fatal error during compilation when I define EIGEN_USE_BLAS before the Eigen headers are included:
This happens because the header file mkl.h cannot be found. It seems that Eigen still only provide support for Intel MKL's library, but in this thread https://forum.kde.org/viewtopic.php?f=74&t=110509, it is said that linking with OpenBLAS is possible. Can Eigen really link to OpenBLAS (or any other BLAS library)? What about LAPACKE? |
Moderator
|
Indeed, after some checks this would require some minor and quite straightforward adjustments in Eigen's MKL wrapper to remove the strict dependence to MKL. Any volunteer?
|
Registered Member
|
Where are these minor changes necessary?
|
Registered Member
|
I am interested in this topic too, and I would like to use OpenBlas with Eigen, if possible.
I am not an expert on programming. However, I have been digging the Eigen files a bit and I have noticed some references to MKL and EIGEN_USE_BLAS. As default, the EIGEN_USE_BLAS define points to MKL functionalities. The file Core at Eigen's files shows the following:
So, if I am not wrong, I guess these are the lines that need to be changed. |
Moderator
|
Basically, in src/util/Core/MklSupport.h we should not include mkl.h by default, then defines the MKL_* types, include misc/blas.h, add the "_" prefix to BLAS calls in Core/products/*MKL.h, and update the blas.h file wrt constness.
|
Registered Member
|
The coming version 3.3-beta2 seems to solve this problem:
ChangeLog: "Relax dependency on MKL for EIGEN_USE_BLAS: any BLAS library can now be used as backend." http://eigen.tuxfamily.org/index.php?ti ... _3.3-beta2 Right now I cannot find the download link for 3.3-beta2, but will try it whenever it's available. |
Registered Member
|
Anyone compared different libraries which is faster on Eigen's benchmark?
Does MKL / OpenBLAS give any improvement over Eigen? Thank You. |
Moderator
|
with multithreading MKL and OpenBLAS should be faster, for sequential use they all are close to the hardware maximal speed.
|
Registered Member
|
What about small to medium matrices (Dynamic and Static Wise)?
|
Moderator
|
please, be more specific, "medium" size does tell much. Eventually, the best way to get your answer is to bench the two options for your own problem, it is just a matter of compiling with -DEIGEN_USE_BLAS -lopenblas
|
Registered Member
|
I'd say medium is matrices with up to 2500 Elements.
Small I'd say matrices with up to 250 Elements. |
Registered users: Bing [Bot], daret, Google [Bot], sandyvee, Sogou [Bot]