How to install pardiso on matlab with `pthread` on windows?

7 次查看(过去 30 天)
I am trying to use PARDISO in Matlab on windows. I notice that some compile options may not availible for windows system. This is my building script for pardisofree.mexw64 as an example.
mex -largeArrayDims -lpardiso -lmwlapack -lmwblas ...
-LD:\IntelSWTools\parallel_studio_xe_2019.0.045\compilers_and_libraries_2019\windows\compiler\lib\intel64_win -lifcoremt ...
-LD:\zw\matlab\PARDISO\pthreads-w32-2-9-1-release\Pre-built.2\lib\x64 -lpthread ...
-lm -output pardisofree ...
common.cpp matlabmatrix.cpp sparsematrix.cpp pardisoinfo.cpp pardisofree.cpp
I have installed the intel parallel XE to get the windows version of gfortran, as lifcoremt.lib.
I also download pthread for windows version from sourceforge https://sourceforge.net/projects/pthreads4w/
So the command above runs ok for me. But I still have any way to activate the multithreads. I got no examples for that. How to build a matlab file to check it? Do I need to compile OPENMP into it? Any suggestion would be appreciated. I am really confused in this process.
  14 个评论
Jeremy Hu
Jeremy Hu 2021-8-11
Hi Rylan, I wasn't able to get PARDISO to work using MEX, but I did get it working using:
addpath('C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2020.1.216\windows\mkl\include'); % header files
addpath('C:\Program Files (x86)\IntelSWTools\parallel_studio_xe_2020.1.086\compilers_and_libraries_2020\windows\redist\intel64_win\mkl'); % dll
dllname = 'mkl_rt.dll';
global libraryname
libraryname = 'pardiso_mkl';
headername = 'mkl_pardiso.h';
headername2 = 'mkl_dss.h';
if ~libisloaded(libraryname)
[notfound, warnings] = loadlibrary(dllname, headername, 'addheader', headername2, 'alias', libraryname);
end
After loading the library, you can call pardiso using, for example
[pt_ , ~, iparm_] = calllib(libraryname, 'pardisoinit', pt, mtype, iparm);
Hope this helps!

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB Compiler 的更多信息

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by