LAPACK / CBLAS without Intel Compiler within Visual Studio

Post here if you have a question about linking your program with LAPACK or ScaLAPACK library

LAPACK / CBLAS without Intel Compiler within Visual Studio

Postby rhahne » Tue Oct 21, 2014 7:31 am

Hello Everybody,

I am having a visual studio project which requires the Intel C++ compiler. I took a deeper look at the code and found out that the Intel C++ compiler is needed because of a numerical library. This numerical library includes the following files:
Code: Select all
#include "mkl_types.h"
#include "mkl_cblas.h"
#include "mkl_lapack.h"


Now I tried to replace LAPACK / CBLAS from Intel with the MinGW based implementation as described in:
http://icl.cs.utk.edu/lapack-for-windows/lapack/index.html

For LAPACK, this works fine but for CBLAS not. I have compiled CBLAS from there:
http://www.netlib.org/blas/
I have included cblas.h and added the compiled library to the Additional Dependencies within the Visual Studio Project.

Anyway I get the following linking error:
1><replaced>.obj : error LNK2019: unresolved external symbol "double __cdecl cblas_ddot(int,double const *,int,double const *,int)" (?cblas_ddot@@YANHPBNH0H@Z) referenced in function "double __cdecl <replaced>(class Matrix<double> const &,class Matrix<double> const &)" (?<replaced>@@YANABV?$Matrix@N@@0@Z)
1><replaced>.obj : error LNK2019: unresolved external symbol "void __cdecl cblas_dgemv(enum CBLAS_ORDER,enum CBLAS_TRANSPOSE,int,int,double,double const *,int,double const *,int,double,double *,int)" (?cblas_dgemv@@YAXW4CBLAS_ORDER@@W4CBLAS_TRANSPOSE@@HHNPBNH2HNPANH@Z) referenced in function "void __cdecl <replaced>(double,class Matrix<double> const &,class Matrix<double> const &,double,class Matrix<double> &,enum CBLAS_TRANSPOSE,enum CBLAS_ORDER)" (?<replaced>@@YAXNABV?$Matrix@N@@0NAAV1@W4CBLAS_TRANSPOSE@@W4CBLAS_ORDER@@@Z)
1><replaced>.obj : error LNK2019: unresolved external symbol "void __cdecl cblas_dgemm(enum CBLAS_ORDER,enum CBLAS_TRANSPOSE,enum CBLAS_TRANSPOSE,int,int,int,double,double const *,int,double const *,int,double,double *,int)" (?cblas_dgemm@@YAXW4CBLAS_ORDER@@W4CBLAS_TRANSPOSE@@1HHHNPBNH2HNPANH@Z) referenced in function "void __cdecl <replaced>(double,class Matrix<double> const &,class Matrix<double> const &,double,class Matrix<double> &,enum CBLAS_TRANSPOSE,enum CBLAS_TRANSPOSE,enum CBLAS_ORDER)" (?<replaced>@@YAXNABV?$Matrix@N@@0NAAV1@W4CBLAS_TRANSPOSE@@2W4CBLAS_ORDER@@@Z)
1>


Does anybody know how to replace mkl_cblas? Or any hints what could be wrong here?

Thanks a lot!
rhahne
 
Posts: 3
Joined: Tue Oct 21, 2014 5:51 am

Re: LAPACK / CBLAS without Intel Compiler within Visual Stud

Postby admin » Tue Oct 21, 2014 11:39 am

Hey,
Thank you for your post.
Indeed, CBLAS is not included in the LAPACK package and there is no CMAKE available for this package.
For the next coming LAPACK release, we are planning to add CBLAS integration to the package, and the CMAKE build.
We are currently still testing and improving the library, but CBLAS is already included inside.
If you want, you can download our latest working version and try it out.
Code: Select all
svn co https://icl.cs.utk.edu/svn/lapack-dev/lapack/trunk


We would welcome your feedback.
Otherwise, an easier path is just to get the INTEL MKL library for Windows..
Hope it helps
admin
Site Admin
 
Posts: 608
Joined: Wed Dec 08, 2004 7:07 pm

Re: LAPACK / CBLAS without Intel Compiler within Visual Stud

Postby rhahne » Thu Oct 23, 2014 10:10 am

Hey,
thank you for your answer. That sounds great. We do have the Intel Compiler and it works fine. But we want to port the code to an embedded platform where we will not have the Intel Compiler available. Now the question is, do we need to rewrite the numerical library or can we find a compiler which supports the embedded platform + LAPACK / CBLAS.

So I will try the latest working version. Can you already say when the next release version will be available?

Thanks, I will give you feedback about this!
rhahne
 
Posts: 3
Joined: Tue Oct 21, 2014 5:51 am

Re: LAPACK / CBLAS without Intel Compiler within Visual Stud

Postby admin » Thu Oct 23, 2014 11:29 am

The next coming LAPACK should be available before the end of November.
admin
Site Admin
 
Posts: 608
Joined: Wed Dec 08, 2004 7:07 pm

Re: LAPACK / CBLAS without Intel Compiler within Visual Stud

Postby rhahne » Thu Oct 23, 2014 11:59 am

I tried it out now and everything compiled out of the box now.

In one case I got an runtime error within the function cblas_dgemv. But in this case the parameters A and Y were null pointers. I am not sure if it is intended to break if you pass the function a null pointer. Anyway it does not crash with the Intel Compiler. If you catch the Nullpointer beforehand, it works fine.

Thanks!
rhahne
 
Posts: 3
Joined: Tue Oct 21, 2014 5:51 am

Re: LAPACK / CBLAS without Intel Compiler within Visual Stud

Postby admin » Thu Oct 23, 2014 12:18 pm

Great job! Thank you for letting us know!
Please do not hesitate if you have any issue.
admin
Site Admin
 
Posts: 608
Joined: Wed Dec 08, 2004 7:07 pm


Return to Linking Problem

Who is online

Users browsing this forum: No registered users and 1 guest