How to compile matlab library with C including openmp?

9 vues (au cours des 30 derniers jours)
Zhe Shen
Zhe Shen le 6 Fév 2018
Commenté : Walter Roberson le 7 Fév 2018
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?

Réponses (1)

Walter Roberson
Walter Roberson le 6 Fév 2018
  2 commentaires
Zhe Shen
Zhe Shen le 7 Fév 2018
Modifié(e) : Zhe Shen le 7 Fév 2018
Thanks for your answer. Acturally I'm working on Linux and using gcc compiler. I'm trying to call matlab function in my C code integrated with openmp. It seems like matlab mbuild compiler does not support openmp. If it's not how should I compile it?
Walter Roberson
Walter Roberson le 7 Fév 2018
For Linux I would use the same approach as on Mac:
mex -v CXXFLAGS="$CXXFLAGS -fopenmp"

Connectez-vous pour commenter.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by