How to compile matlab library with C including openmp?
2 次查看(过去 30 天)
显示 更早的评论
Using mbuild to compile my C code reports the following error: Unknown MEX argument '-fopenmp'. I'm wondering how to integrate the matlab library into my C code including openmp?
1 个评论
Walter Roberson
2018-2-6
You need to be careful with this; see https://www.mathworks.com/matlabcentral/answers/362692-is-it-possible-make-parallel-processing-using-mex-and-openmp-on-matlab#answer_287564
回答(1 个)
Walter Roberson
2018-2-6
This question was brought to an uncertain resolution in https://www.mathworks.com/matlabcentral/answers/373649-mex-file-maker-not-working-when-using-thread-header
If you are using Visual Studio then there was a Community Edition that did not support OpenMP. I remember that at some point I listed which version it was but I am not finding the posting at the moment, but see
2 个评论
Walter Roberson
2018-2-7
For Linux I would use the same approach as on Mac:
mex -v CXXFLAGS="$CXXFLAGS -fopenmp"
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!