openmp mex commands for R2010b

2 views (last 30 days)
Jveer
Jveer on 16 Feb 2011
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

Accepted Answer

Oliver Woodford
Oliver Woodford on 16 Feb 2011
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 Comments
Jveer
Jveer on 20 Feb 2011
thank you.
matlab support suggested: mex -v mymex.c COMPFLAGS="/openmp $COMPFLAGS"
Both solutions work. I prefer the second.
Florian Jousset
Florian Jousset on 23 Feb 2012
Thanks for your solution,
it worked perfectly!

Sign in to comment.

More Answers (0)

Categories

Find more on Execution Speed in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!