matlab - Is it possible to compile 'c-mex' with openMP by the free compiler? -


i'm learning how use mex file in matlab.

i using matlab r2016a on windows 10.

i tried use openmp this

#include "mex.h" #include <omp.h>  void mexfunction ( int nlhs, mxarray *plhs[], int nrhs, const mxarray *prhs[] ) {     int nthreads,tid;     #pragma omp parallel private(nthreads, tid)     {         tid = omp_get_thread_num();         if(tid==0){             nthreads = omp_get_num_threads();             mexprintf("number of threads : %d\n",nthreads);         }         mexprintf("echo %d\n",tid);      }     return; } 

it works if use visual studio professional 2015.

however, if use mingw64 compiler, not work.

then found there compiler not provide openmp feature.

is there free compiler supports mex , omp??


Comments