I've implemented a piece of code with Eigen and I would like Eigen to use BLAS and LAPACK .
I've seen here, that is possible but I don't know how or where to put those values/directives in the code.
I have to expecify somewhere the value EIGEN_USE_BLAS
but I have no idea where.
I've seen that Eigen's source includes the code of BLAS and LAPACK, but I completelly ignore if it uses it by default or what. I'm using Eigen 3.3.3.
You don't put those directives in the code, you compile your code with these macros. For example:
LAPACK_FLAGS=('-D EIGEN_USE_LAPACKE=1 -lm -lblas -llapack -llapacke')
g++ --std=c++11 eigenSVD.cpp -o eigenSVD.cpp ${LAPACK_FLAGS[@]}
Take a look at Eigen/SVD
, if your code is compiled with EIGEN_USE_LAPACKE
, you see Eigen-lapacke interface and lapacke header files will be included.
#if defined(EIGEN_USE_LAPACKE) && !defined(EIGEN_USE_LAPACKE_STRICT)
#ifdef EIGEN_USE_MKL
#include "mkl_lapacke.h"
#else
#include "src/misc/lapacke.h"
#endif
#include "src/SVD/JacobiSVD_LAPACKE.h"
#endif
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With