How to disable openMP with Matlab Coder?

조회 수: 19 (최근 30일)
Matthias Frühwirth
Matthias Frühwirth 2016년 6월 7일
편집: Joe Barrus 2024년 1월 8일
I want to use Matlab Coder to compile a function that will not profit much from multithreading. Although I use
codegen -O disable:openmp
the resulting C source includes omp.h and tries to find vcompXXX.dll when run.
How can I switch off OpenMP use completely?
System: Matlab Coder 2016a/Windows 10/Visual C++ 2013

답변 (1개)

Ryan Livingston
Ryan Livingston 2017년 3월 1일
Try:
cfg = coder.config('dll');
cfg.EnableOpenMP = false;
codegen -config cfg ...
  댓글 수: 3
Jingyang Yan
Jingyang Yan 2022년 2월 18일
In MATLABT R2021b version, even I disable the OpenMP libarart if possible, the omp.h file is still included in the header files.
Joe Barrus
Joe Barrus 2024년 1월 8일
편집: Joe Barrus 2024년 1월 8일
In MATLAB 2023b, with All Settings --> Advanced --> Enable OpenMP library if possible --> No, Coder still generates #include "omp.h" and generates omp_nest_lock_t variable.
If I generate a new Coder project file from scratch and select No to "Enable OpenMP library if possible" it seems to work, but changing that setting after initial creation does not seem to work.

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

카테고리

Help CenterFile Exchange에서 Code Generation에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by