Effacer les filtres
Effacer les filtres

MSVC2017 32-bit compiler considered as not supporting OpenMP library

4 vues (au cours des 30 derniers jours)
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.

Réponse acceptée

Anakin Zheng
Anakin Zheng le 13 Avr 2020
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);

Plus de réponses (0)

Catégories

En savoir plus sur Code Generation dans Help Center et File Exchange

Produits


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by