This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Can I use openblas as blas backend in Eigen

Tags: None
(comma "," separated)
chunkaowang
Registered Member
Posts
5
Karma
0
I want to use openblas as backend of blas in Eigen. Is it possible? Thank you!
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
Yes, this should be possible: just compile with -DEIGEN_USE_BLAS and link to openblas.

See http://eigen.tuxfamily.org/dox-devel/To ... elMKL.html for the details.
allanmulin
Registered Member
Posts
14
Karma
0
Well, this does not seem to work with Eigen 3.2.2. First of all, the CMakeFiles.txt file would have to be changed to add the -DEIGEN_USE_BLAS definition:
Code: Select all
add_definitions(-DEIGEN_USE_BLAS -DEIGEN_USE_LAPACKE)

Anyway, when I define EIGEN_USE_BLAS before the Eigen headers are included:
Code: Select all
#define EIGEN_USE_BLAS
#include <Eigen/Dense>

I get a fatal error during compilation because the header file mkl.h could not be found. But I don't want to use Intel MKL's library, but OpenBLAS.

Can Eigen really link to OpenBLAS (or any other BLAS library)?
zhanxw
Registered Member
Posts
17
Karma
0
It's not possible yet in Eigen (version 3.2.8).
You can refer to this post: viewtopic.php?f=74&t=123117
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
indeed, you really need to grab the devel branch, not even 3.3-beta1 !
Royi
Registered Member
Posts
34
Karma
0
Does OpenBlas makes things faster when in used?

Which functions of Eigen will use OpenBlas instead of the built in functions?

Thank You.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
All "large enough" matrix-matrix and matrix-vector products (including triangular and symmetric matrices) will call the underlying BLAS implementation, that might be faster than Eigen's built-in ones with multi-threading. For sequential uses, speed should be in par.


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]