MATLAB coder - compiler does not support OpenMP error (using a supported compiler)

When attempting to use codegen for a function that includes a parfor loop, I am getting the error "Warning: The selected compiler does not support the OpenMP library; this loop will not be parallelized". I am using a Mac with High Sierra; the compiler is Xcode 9.2 (which is listed as being supported for all coder features here: https://www.mathworks.com/support/compilers.html#mac_n1). How might I get this working?

 채택된 답변

Walter Roberson
Walter Roberson 2018년 1월 16일
편집: Walter Roberson 2018년 2월 6일
You cannot do that. Apple does not support openmp for xcode. It does support openmp for one of its other compilers. A common solution is to install a different compiler, but you could configure Apple's clang instead. gcc and clang are not "supported" compilers for the Mac so no promises that everything will work.
https://stackoverflow.com/questions/41979611/is-it-possible-to-run-openmp-in-xcode-8

추가 답변 (1개)

Darshan Ramakant Bhat
Darshan Ramakant Bhat 2018년 1월 16일
Please refer to the "Notes for the Mac Platform" section in the below document:
OpenMP is not supported in Mac platforms.

댓글 수: 1

In that document, I had noticed that the "This compiler does not support OpenMP" footnote is only listed for Xcode 7 and 8, which is why I thought Xcode 9 would work. I'm guessing that's not the case now? Thanks

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터 및 File Exchange에서 Execution Speed에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by