フィルターのクリア

MSVC2017 32-bit compiler considered as not supporting OpenMP library

4 ビュー (過去 30 日間)
Jean-Alain Geay
Jean-Alain Geay 2020 年 4 月 10 日
コメント済み: Jean-Alain Geay 2020 年 4 月 14 日
I would like to generate and build a 32-bit library to run on 64-bit Windows using Matlab Coder.
To achieve this, I registered a custom MSVC 32-bit toolchain using the example « Build 32-bit DLL on 64-bit Windows® Platform Using MSVC Toolchain ». I use version 15.0 (2017) of MSVC.
My problem is that Matlab Coder considers this compiler does not support OpenMP, and consequently doesn’t generate the #pragma omp directives it would otherwise. This prevents taking advantage of the parfor loops in Matlab code.
MSVC2017 does actually supports OpenMP, even when used in 32-bit mode on 64-bit Windows. So I was wondering if it could be possible to change this custom toolchain's definition in a way that makes Matlab Coder consider it supports OpenMP ?
Thank you.

採用された回答

Anakin Zheng
Anakin Zheng 2020 年 4 月 13 日
Hi Jean-Alain,
To support OpenMP, toolchain needs to contain an OpenMP setion.
In my_msvc_32bit_tc add something like this:
openMPCFlags = ...;
openMPLFlags = ...;
toolchainObjectHandle.addCustomBuildConfiguration('OpenMP', ...
'C Compiler', openMPCFlags, 'Linker', openMPLFlags, ...
'C++ Compiler', openMPCFlags, 'C++ Linker', openMPLFlags);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCode Generation についてさらに検索

タグ

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by