How to install pardiso on matlab with `pthread` on windows?
조회 수: 8 (최근 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
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 Center 및 File Exchange에서 MATLAB Compiler에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!