필터 지우기
필터 지우기

openmp mex commands for R2010b

조회 수: 2 (최근 30일)
Jveer
Jveer 2011년 2월 16일
Hello everyone,
Can anyone please provide me with the right flags to mex .c with openmp?
The following produces the best results on mac:
mex CC="gcc-4.2" LD="gcc-4.2" COPTIMFLAGS="$COPTIMFLAGS -fopenmp -O2 -DNDEBUG" LDOPTIMFLAGS="$LDOPTIMFLAGS -fopenmp -O2" -lgomp filename.c
I would like the, windows 7 x64, windows 7 x86, linux x64, linux x86 equivalent of the above.
Regards,
Jayveer

채택된 답변

Oliver Woodford
Oliver Woodford 2011년 2월 16일
On Windows using Microsoft Visual Studio I add the /openmp option to the relevant line of my mexopts.bat file, thus:
set COMPFLAGS=... /openmp
On Windows 7 my mexopts.bat file is found in: C:\Users\$USERNAME\AppData\Roaming\MathWorks\MATLAB\R20XXx
  댓글 수: 2
Jveer
Jveer 2011년 2월 20일
thank you.
matlab support suggested: mex -v mymex.c COMPFLAGS="/openmp $COMPFLAGS"
Both solutions work. I prefer the second.
Florian Jousset
Florian Jousset 2012년 2월 23일
Thanks for your solution,
it worked perfectly!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Execution Speed에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by