Why is my mexopts.bat file not being used for certain targets in Real-Time Workshop 6.1 (R14SP1)?

1 view (last 30 days)
I am trying to specify some compiler options by modifying the mexopts.bat file in the directory returned by the MATLAB command
prefdir
I modify this file, and when I use certain targets like GRT, my changes are being used. However, for some targets, I see that the version of mexopts.bat is not being used, as shown in the following excerpt from the build log:
### Compiling vdp_acc.c
D:\Applications\MATLAB701\bin\win32\mex -c -O -f "D:\Applications\MATLAB701\bin\win32\mexopts\msvc70opts.bat" vdp_acc
The targets for which mexopts.bat is not being used are as follows:
1. Model Reference Simulation target
2. Simulink Accelerator
3. Real Time Workshop S-function target

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This bug has been fixed in Release 14 Service Pack 3 (R14SP3). For previous product releases, read below for any possible workarounds:
This problem has been fixed in Real-Time Workshop 6.2 (R14SP2). If you are using a previous version, read the following:
We have verified there is a bug in Real-Time Workshop 6.1 (R14SP1) in that certain targets use the -f flag incorrectly when calling MEX to compile the model. The -f flag is used to hardcode the location of the preferences file in the template make files (TMFs), and for these targets, that location is hardcoded as a file located in the following directory:
$MATLAB\bin\win32\mexopts\
(where $MATLAB is the MATLAB root directory on your machine, as returned by typing
matlabroot
at the MATLAB command prompt.)
As a workaround, edit the appropriate TMF file to add the desired compiler options. To find this file, navigate to the following directory:
$MATLAB\rtw\c
In that directory, you will see several directories named similarly to the targets they represent. Change to the directory of interest, and then edit the .tmf file representing the compiler you are using. For example, if you want to change the options for the Accelerator and you are using Visual C++, you would edit the following file:
$MATLAB\rtw\c\accel\accel_vc.tmf
In the TMF, you will see the following line:
MEX_OPTS =
This is the line you would add the desired options to.

More Answers (0)

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Products


Release

R14SP1

Community Treasure Hunt

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

Start Hunting!