how to invoke IMKL functions from Eigen

2019-09-05 02:51发布

问题:

#include<iostream>    
#define EIGEN_USE_MKL_ALL    
#include"mkl.h"    
#include<Eigen/Dense>    

using Eigen::MatrixXd;    

int main() 
{    
    MatrixXd m1,m2,m3;    
    m1<<1,2,3,4;    
    m2<<5,6,7,8;    
    m3=m1*m2.Transpose();    
    std::cout<<m3;    
}

i used IMKL11.2 Eigen 3.2.0 ubuntu 14.04 LTS intel core duo processor 64bit os g++ compiler

http://eigen.tuxfamily.org/dox/TopicUsingIntelMKL.html the link says that we can use IMKL from Eigen by defining the macro. But the following error pope up

in file included from Eigen/Core from Eigen/Dense from test.cpp MKL_BLAS was not decleared in this scope

回答1:

This issue has been fixed in changeset 0cc8ceeb7dd1 which is part of the latest stable release, namely Eigen 3.2.6.