这样的问题可以赛义德如何使用mingw编译器来编译cpp项目openmp到墨西哥人文件
openmp mingw墨西哥人对matlab错误
1视图(30天)
显示旧的评论
我使用代码块和mingw 6.30编译器环境。开始时,我创建了以下OpenMP代码在代码块
没有错误
#包括< iostream >
#包括< omp.h >
#包括< stdio . h >
#包括< mex.h >
使用名称空间性病;
intmain ()
{
int = 100;
#编译指示omp平行为lastprivate (A) firstprivate (A)
为(int i = 0;我+ +)< 10;
{
= + i;
}
printf (“% d \ n”,);
cout < < omp_get_active_level () < <“\ n”;/ /这函数omp_get_active_level ()在cpp兼容
返回0;
}
代码像这样,我相信mingw6.30 gcc是兼容openmp函数像omp_get_active_level ()
下一个设置,我想改变这段代码为matlab mexfunction,所以代码改变这样的
#包括< iostream >
#包括< omp.h >
#包括< stdio . h >
#包括< mex.h >
使用名称空间性病;
int测试()
{
int = 100;
#编译指示omp平行为lastprivate (A) firstprivate (A)
为(int i = 0;我+ +)< 10;
{
= + i;
}
printf (“% d \ n”,);
cout < < omp_get_active_level () < <“\ n”;/ /这函数omp_get_active_level ()在cpp兼容
返回0;
}
无效mexFunction (int nlhs mxArray * plhs [], int nrhs, const mxArray * prhs [])
{
测试();
}
在matlab2020b,我选择我的matlab编译器mingw6.30墨西哥人而不是vc++,但是当我编译cpp墨西哥人(我输入
墨西哥人
- v
COMPFLAGS = " COMPFLAGS美元
openmp”
main.cpp
),matlab这样的警告
这让我困惑,因为在代码块中,纯cpp项目是兼容与omp_get_active_level运行,而在墨西哥人编译器,matlab警告这个函数定义,我删除omp_get_active_level之后,墨西哥人编译器没有错误,为什么?matlab mexfunction支持omp_get万博1manbetx_active_level与否