From: Hugo on 19 Jul 2010 13:08 Hello, I'm trying to compile a C file that was paralelized with OpenMP. I know that I have to edit some lines of mexopts.bat, could somebody please tell me which ones? is that the only file I have to edit? I'm using Windows 32 and Matlab 2007b Thank you very much in advance.
From: James Tursa on 19 Jul 2010 14:30 "Hugo " <hugo(a)tsc.upc.edu> wrote in message <i220pk$m1p$1(a)fred.mathworks.com>... > Hello, > > I'm trying to compile a C file that was paralelized with OpenMP. I know that I have to edit some lines of mexopts.bat, could somebody please tell me which ones? is that the only file I have to edit? > > I'm using Windows 32 and Matlab 2007b > > Thank you very much in advance. Go to the following directory (or similar for your particular installation): C:\Program Files\MATLAB\R2007b\bin\win32\mexopts There you will see the original mex opts files. e.g., for VC you will see msvc80engmatopts.bat msvc80opts.bat The first one is for engine applications and the second one is for mex routines. Inside these files you will find the compilation options line: set COMPFLAGS=/c /Zp8 /GR /W3 /EHs /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /nologo /MD Try adding your OpenMP options to this line. My advice would be to copy this line into a new line, REM the old line and modify the new line, so you have a record of the original line in the file. (Or you could create a brand new copy of the options file and modify that and use that downstream). Then run mex -setup again and select the compiler (that copies the appropriate options file to the [prefdir '\mexopts.bat'] file, which is what is actually used during a mex compilation command (not an engine build). For an engine build you need to specify the appropriate engmatopts.bat file directly in the mex command. James Tursa
From: Hugo on 20 Jul 2010 13:09 Dear Mr. Tursa, Thank you for your answer. I'm not very much into OpenMP, so I don't actually know which lines must be added to the files you said, could you please help me with it? In the file msvc80engmatopts.bat, the line you said is: COMPFLAGS=/c /Zp8 /GR /W3 /EHs /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /nologoset And in the file msvc80opts.bat, the line is: OMPFLAGS=/c /Zp8 /GR /W3 /EHs /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /nologoset Thank you very much!
From: James Tursa on 20 Jul 2010 16:22 "Hugo " <hugo(a)tsc.upc.edu> wrote in message <i24l7g$689$1(a)fred.mathworks.com>... > > I'm not very much into OpenMP, so I don't actually know which lines must be added to the files you said, could you please help me with it? What compiler are you using? There should be documentation with the compiler that specifies what options need to be used to enable OpenMP. James Tursa
From: Hugo on 21 Jul 2010 06:26
I'm using the one that comes with Matlab 2007b: Lcc-win32 C 2.4.1. Thank you! |