Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
mex options

Subject: mex options

From: Mateusz Gos

Date: 13 Apr, 2010 16:20:26

Message: 1 of 3

i am compiling a set of *.for (Fortran) files to create a mex file but encountered a problem to which a solution would be to modify some mex options. exactly what i am after is as follows:

the /assume:backslash option is on and tries to interpret backslashes in character strings as C escape sequences. this should be removed. alternatively, if "mex" won't allow me to do that, could try adding "/assume:nobackslash".

problem is do not know where to change it and how. I have Visial Fortran Compiler 11.1 tested and working on Matlab 2010a.


cheers

Subject: mex options

From: James Tursa

Date: 13 Apr, 2010 17:18:07

Message: 2 of 3

"Mateusz Gos" <webmaster24@wp.pl> wrote in message <hq25ka$qas$1@fred.mathworks.com>...
> i am compiling a set of *.for (Fortran) files to create a mex file but encountered a problem to which a solution would be to modify some mex options. exactly what i am after is as follows:
>
> the /assume:backslash option is on and tries to interpret backslashes in character strings as C escape sequences. this should be removed. alternatively, if "mex" won't allow me to do that, could try adding "/assume:nobackslash".
>
> problem is do not know where to change it and how. I have Visial Fortran Compiler 11.1 tested and working on Matlab 2010a.

mex options files are in the following directory (modify as appropriate for your system):

[matlabroot '\bin\win32\mexopts']

The file name to look for should be something like:

intelf11msvs2005opts.bat (for mex functions)

or

intelf11msvs2005engmatopts.bat (for engine applications)

Inside this file, modify the COMPFLAGS line. In addition to your problem, I would advise deleting the /fixed option from this line. That will allow you to compile .f90 files as free format.

James Tursa

Subject: mex options

From: Kelvin

Date: 22 Jan, 2012 19:36:33

Message: 3 of 3

"Mateusz Gos" <webmaster24@wp.pl> wrote in message <hq25ka$qas$1@fred.mathworks.com>...
> i am compiling a set of *.for (Fortran) files to create a mex file but encountered a problem to which a solution would be to modify some mex options. exactly what i am after is as follows:
>
> the /assume:backslash option is on and tries to interpret backslashes in character strings as C escape sequences. this should be removed. alternatively, if "mex" won't allow me to do that, could try adding "/assume:nobackslash".
>
> problem is do not know where to change it and how. I have Visial Fortran Compiler 11.1 tested and working on Matlab 2010a.
>
>
> cheers

I'm not sure Steve Lionel <http://software.intel.com/en-us/forums/showthread.php?t=73523> gave you the right advice. I think the compiler command you need is /assume:nobscc and if you look into the mexopts.bat file you'll see /assume:bscc which is causing the problem.
I think you need to modify intelf12msvs2008opts.bat BEFORE you do mex -setup or modify the mexopts.bat file if you've already done the mex-setup.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us