MSVC2017 32-bit compiler considered as not supporting OpenMP library

1 visualización (últimos 30 días)
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.

Respuesta aceptada

Anakin Zheng
Anakin Zheng el 13 de Abr. de 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);

Más respuestas (0)

Categorías

Más información sobre MATLAB Coder en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by