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

7 ビュー (過去 30 日間)
wei zhang
wei zhang 2020 年 6 月 30 日
コメント済み: Rylan 2021 年 8 月 11 日
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!
Rylan
Rylan 2021 年 8 月 11 日
Thanks a lot!!

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Compiler についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by