필터 지우기
필터 지우기

How to locate and link with the exact same Intel MKL that MATLAB is shipped with?

조회 수: 34 (최근 30일)
The question in the header summarizes what I aim to achieve, which is more precisely detailed as below.
The goal is to compile C++ based mex files that rely on Intel MKL function calls (e.g. matrix inverse calculation).
In order to do so, I would like to ensure that I use the exact same Intel MKL libraries which MATLAB is shipped with, so as to avoid any compatibility issues. In this particular case, this is:
>> version('-blas')
ans =
'Intel(R) Math Kernel Library Version 2018.0.3 Product Build 20180406 for Intel(R) 64 architecture applications, CNR branch AVX
'
>> version('-lapack')
ans =
'Intel(R) Math Kernel Library Version 2018.0.3 Product Build 20180406 for Intel(R) 64 architecture applications, CNR branch AVX
Linear Algebra PACKage Version 3.7.0
'
Warning: the above Intel MKL BLAS & LAPACK are not the same as the ones that are available for download from Intel’s official website. The latter ones I would prefer not to use for the above-mentioned potential compatibility reasons. I
In which MATLAB folder(s) are the above reference static/dynamic Intel MKL libraries are located?
I have extensively searched after them in the many MATLAB folders, but I unfortunately could not find them. It seems that they are ‘buried’ somewhere deep in MATLAB.
How is it possible to do this at all?
My setup: Windows 10, MATLAB R2091b, Intel MKL.
I am very grateful for any help. Thank you in advance.

답변 (2개)

Steven Lord
Steven Lord 2021년 1월 20일

James Tursa
James Tursa 2021년 1월 27일
On my Win64 machine I find them here
[matlabroot '/extern/lib/win64/microsoft']
and here
[matlabroot '/extern/lib/win64/mingw64']
The BLAS library is named libmwblas.lib, and the LAPACK library is named libmwlapack.lib
For reference, note that in R2007a and earlier, The Mathworks shipped the BLAS and LAPACK libraries as a single combined library. They weren't shipped as two separate libraries until R2007b and later.
  댓글 수: 3
James Tursa
James Tursa 2021년 1월 28일
The documentation page that Steven Lord directs you to has instructions and examples for compiling and linking with these libraries. Or you can include them explicitly on the mex command as shown here:

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Write C Functions Callable from MATLAB (MEX Files)에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by