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
Walter Roberson 2018-2-6
  2 个评论
Zhe Shen
Zhe Shen 2018-2-7
编辑:Zhe Shen 2018-2-7
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 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!

Translated by