How to compile matlab library with C including openmp?
9 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaire
Walter Roberson
le 6 Fév 2018
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
Réponses (1)
Walter Roberson
le 6 Fév 2018
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 commentaires
Walter Roberson
le 7 Fév 2018
For Linux I would use the same approach as on Mac:
mex -v CXXFLAGS="$CXXFLAGS -fopenmp"
Voir également
Catégories
En savoir plus sur MATLAB Support for MinGW-w64 C/C++ Compiler dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!