c++ - Linker errors for OpenBlas (+Armadillo) -


i using armadillo blas , lapack have decided use openblas speed computations. have followed steps given in link , compiled openblas in mingw generate libopenblas.dll , libopenblas.dll.a. have tried use these in example application in vs 2012 , found linker errors related openblas. doing wrong?

the example given below:

#include <iostream> #include <armadillo>  using namespace std; using namespace arma;   int main(int argc, char** argv) {   cout << "armadillo version: " << arma_version::as_string() << endl;    mat a(2,3);  // directly specify matrix size (elements uninitialised)    cout << "a.n_rows: " << a.n_rows << endl;  // .n_rows , .n_cols read   cout << "a.n_cols: " << a.n_cols << endl;    a(1,2) = 456.0;  // directly access element (indexing starts @ 0)   a.print("a:");     = 5.0;         // scalars treated 1x1 matrix   a.print("a:");     a.set_size(4,5); // change size (data not preserved)    a.fill(5.0);     // set elements particular value   a.print("a:");    // endr indicates "end of row"   << 0.165300 << 0.454037 << 0.995795 << 0.124098 << 0.047084 << endr     << 0.688782 << 0.036549 << 0.552848 << 0.937664 << 0.866401 << endr     << 0.348740 << 0.479388 << 0.506228 << 0.145673 << 0.491547 << endr     << 0.148678 << 0.682258 << 0.571154 << 0.874724 << 0.444632 << endr     << 0.245726 << 0.595218 << 0.409327 << 0.367827 << 0.385736 << endr;     a.print("a:");    // determinant   cout << "det(a): " << det(a) << endl;    // inverse   cout << "inv(a): " << endl << inv(a) << endl;    // save matrix file   a.save("a.txt", raw_ascii);    // load file   mat b;   b.load("a.txt");    // submatrices   cout << "b( span(0,2), span(3,4) ):" << endl << b( span(0,2), span(3,4) ) << endl;    cout << "b.row(0): " << endl << b.row(0) << endl;    cout << "b.col(1): " << endl << b.col(1) << endl;   // transpose   cout << "b.t(): " << endl << b.t() << endl;    // maximum each column (traverse along rows)   cout << "max(b): " << endl << max(b) << endl;    // maximum each row (traverse along columns)   cout << "max(b,1): " << endl << max(b,1) << endl;    // maximum value in b   cout << "max(max(b)) = " << max(max(b)) << endl;    // sum of each column (traverse along rows)   cout << "sum(b): " << endl << sum(b) << endl;    // sum of each row (traverse along columns)   cout << "sum(b,1) =" << endl << sum(b,1) << endl;    // sum of elements   cout << "accu(b): " << accu(b) << endl;    // trace = sum along diagonal   cout << "trace(b): " << trace(b) << endl;    // generate identity matrix   mat c = eye<mat>(4,4);    // random matrix values uniformly distributed in [0,1] interval   mat d = randu<mat>(4,4);   d.print("d:");    // row vectors treated matrix 1 row   rowvec r;   r << 0.59119 << 0.77321 << 0.60275 << 0.35887 << 0.51683;   r.print("r:");    // column vectors treated matrix 1 column   colvec q;   q << 0.14333 << 0.59478 << 0.14481 << 0.58558 << 0.60809;   q.print("q:");    // dot or inner product   cout << "as_scalar(r*q): " << as_scalar(r*q) << endl;    // outer product   cout << "q*r: " << endl << q*r << endl;    // multiply-and-accumulate operation (no temporary matrices created)   cout << "accu(a % b) = " << accu(a % b) << endl;    // example of compound operation   b += 2.0 * a.t();   b.print("b:");    // imat specifies integer matrix   imat aa;   imat bb;    aa << 1 << 2 << 3 << endr << 4 << 5 << 6 << endr << 7 << 8 << 9;   bb << 3 << 2 << 1 << endr << 6 << 5 << 4 << endr << 9 << 8 << 7;    // comparison of matrices (element-wise); output of relational operator umat   umat zz = (aa >= bb);   zz.print("zz:");    // cubes ("3d matrices")   cube q( b.n_rows, b.n_cols, 2 );    q.slice(0) = b;   q.slice(1) = 2.0 * b;    q.print("q:");    // 2d field of arbitrary length row vectors (fields can store abitrary objects, eg. instances of std::string)   field<rowvec> xyz(3,2);    xyz(0,0) = randu(1,2);   xyz(1,0) = randu(1,3);   xyz(2,0) = randu(1,4);   xyz(0,1) = randu(1,5);   xyz(1,1) = randu(1,6);   xyz(2,1) = randu(1,7);    cout << "xyz:" << endl;   cout << xyz << endl;    return 0;  } 

the linker errors are:

 1>example1.obj : error lnk2019: unresolved external symbol ddot_ referenced in function "public: static void __cdecl arma::syrk_vec<1,1,0>::apply<double,class arma::col<double> >(class arma::mat<double> &,class arma::col<double> const &,double,double)" (??$apply@nv?$col@n@arma@@@?$syrk_vec@$00$00$0a@@arma@@saxaeav?$mat@n@1@aebv?$col@n@1@nn@z)  1>example1.obj : error lnk2019: unresolved external symbol dgemv_ referenced in function "public: static void __cdecl arma::gemv<1,1,0>::apply_blas_type<double,class arma::col<double> >(double *,class arma::col<double> const &,double const *,double,double)" (??$apply_blas_type@nv?$col@n@arma@@@?$gemv@$00$00$0a@@arma@@saxpeanaebv?$col@n@1@pebnnn@z)  1>example1.obj : error lnk2019: unresolved external symbol dgemm_ referenced in function "public: static void __cdecl arma::gemm<1,1,1,0>::apply_blas_type<double,class arma::col<double>,class arma::row<double> >(class arma::mat<double> &,class arma::col<double> const &,class arma::row<double> const &,double,double)" (??$apply_blas_type@nv?$col@n@arma@@v?$row@n@2@@?$gemm@$00$00$00$0a@@arma@@saxaeav?$mat@n@1@aebv?$col@n@1@aebv?$row@n@1@nn@z)  1>example1.obj : error lnk2019: unresolved external symbol dsyrk_ referenced in function "public: static void __cdecl arma::syrk<1,1,0>::apply_blas_type<double,class arma::col<double> >(class arma::mat<double> &,class arma::col<double> const &,double,double)" (??$apply_blas_type@nv?$col@n@arma@@@?$syrk@$00$00$0a@@arma@@saxaeav?$mat@n@1@aebv?$col@n@1@nn@z)  1>d:\iuh\research\armadillo-5.200.1\examples\x64\debug\example1_win64.exe : fatal error lnk1120: 4 unresolved externals 


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -