MATLAB Answers

0

Why am I receiving an error when I try to use MAKE_RTW in Real-Time Workshop with compiler options specified?

Why am I receiving an error when I try to use MAKE_RTW in Real-Time Workshop with compiler options specified?
I have specified -DREAL_T=float as a compiler option as described in the documentation.
I receive one of the following errors:
NMAKE : fatal error U1065: invalid option '_'
Stop.
??? Error using ==> make_rtw
Error using ==> rtw_c
Error(s) encountered while building model "mymodel"
make_rtw -DREAL_T=float
make_rtw -D REAL_T=float
T:\1432753\myf14_grt_rtw>"D:\MATLAB6p5p1\rtw\bin\win32\gmake" -f mymodel.mk -DREAL_T=float ADD_MDL_NAME_TO_GLOBALS=1
D:\MATLAB6p5p1\rtw\bin\win32\gmake: illegal option -- D
D:\MATLAB6p5p1\rtw\bin\win32\gmake: illegal option -- R
D:\MATLAB6p5p1\rtw\bin\win32\gmake: illegal option -- E
D:\MATLAB6p5p1\rtw\bin\win32\gmake: illegal option -- A
D:\MATLAB6p5p1\rtw\bin\win32\gmake: illegal option -- L
D:\MATLAB6p5p1\rtw\bin\win32\gmake: illegal option -- _
D:\MATLAB6p5p1\rtw\bin\win32\gmake: illegal option -- T
D:\MATLAB6p5p1\rtw\bin\win32\gmake: illegal option -- =
??? Error using ==> make_rtw
Error using ==> rtw_c
Error(s) encountered while building model "mymodel"

1 Answer

Answer by MathWorks Support Team on 27 Jun 2009
 Accepted Answer

This has been verified as an error within the documentation for Real-Time Workshop within the Compiler Options section.
Redefining doubles as floats with the "-DREAL_T=float" option is not reliable.
Under Compiler Options on page 9-45 of the Real-Time Workshop Users Guide for Version 5, the following tip is given:
If you do not require double precision for your application, define real_T as float in your template
make file, or you can simply specify -DREAL_T=float after make_rtw in the Make command field.
This documentation is not correct. Various circumstances (such as the presence of literal constants) can cause this strategy to fail to remove all doubles from the generated code.
The only reliable way to be sure that doubles are absent is to formally propagate single-precision signals in the Simulink model.

  0 Comments

Sign in to comment.