I have Matlab 2015b with MinGW 4.9.2 compiler (Distributor: TDM-GCC) on Win7 64bit. I have also a 'C' program, running with no warning or exception as a MEX file. Now I need to use Openmp library to parallelize its execution in the Mex file but I can't find out how to give the instructions to the compiler (it has no problem using Openmp as a 'C' program).
A similar problem I've experienced with optimization flag that I use running that program as a normal 'C' execution. I set -O3 in c = mex.getCompilerConfigurations
, Details
, OptimizationFlag
but I get the same time executing the mex file with or without that flag set in that way.
So the question is how can I give openmp and optimization flag to the mingw compiler in Matlab?
Asked
Active
Viewed 513 times
0

Franktrt
- 373
- 1
- 8
- 18
-
Based on my experience, it's almost always a good idea to use mex only to link, and use makefile to compile. In the makefile you can do whatever you want. – user3528438 Nov 24 '15 at 22:37
-
Do you have any examples on how to do it, please? – Franktrt Nov 25 '15 at 09:29