The stdcall requirement normally needed for dlls to work in VBA only applies to 32bit dlls. In 64bit dlls there is only one calling convention, I think.
So, for example, With 64-bits OpenBLAS I am able to do declare a call to a fortran BLAS function (not cblas) and it works fine:
Public Declare PtrSafe Sub dgemm Lib "libopenblas.dll" (ByVal transa As String, _ ByVal transb As String, _ ByRef m As Long, _ ByRef n As Long, _ ByRef k As Long, _ ByRef alpha As Double, _ ByRef a As Double, _ ByRef lda As Long, _ ByRef b As Double, _ ByRef ldb As Long, _ ByRef beta As Double, _ ByRef c As Double, _ ByRef ldc As Long)
But whichever way I tried the same does not work with 64bit mkl_rt.dll. Excel just quietly quits.
Do I have to compile a BLAS-only 64bit dll to be used with VBA Excel? If yes, how exaclty (I urge you to explain in detail)?
MKL headers are slightly different from OpenBLAS, not sure if its somehow related to this:
void __stdcall DGEMM(const char *transa, int transa_len, const char *transb, int transb_len, const MKL_INT *m, const MKL_INT *n, const MKL_INT *k, const double *alpha, const double *a, const MKL_INT *lda, const double *b, const MKL_INT *ldb, const double *beta, double *c, const MKL_INT *ldc);
void BLASFUNC(dgemm)(char *, char *, blasint *, blasint *, blasint *, double *, double *, blasint *, double *, blasint *, double *, double *, blasint *);
I have the same problem, my excel is crashed when the call is made too.
I have posted the question: https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Cannot-Invert-Matrix-using-Lapack-DG...
Could you review and give the instruction?
Thank you a lot.
one notes regarding the single dynamic library - this mode, by default provides support of LP64 and Intel threading mode. Please refer to the MKL's Developer Guide follow this link:https://software.intel.com/content/www/us/en/develop/documentation/mkl-linux-developer-guide/top/lin...
Could you help me to provide the documents which show how we declare the function in mkl_rt for window and excel 32bit? I used ByRel for all variables used for DGETRF/DGETR which work in Window and Excel 64bit but 32 bit.
Thank you for giving instructions.