Problem with compiling SimulinkCompiler example

9 views (last 30 days)
Andreas Bernatzky
Andreas Bernatzky on 11 May 2020
Hi everyone I am trying to compile the Simulinkcompiler example:
If I am trying to run the .mlapp I get the following error:
### Building the rapid accelerator target for model: MassSpringDamperModel
### Build procedure for MassSpringDamperModel aborted due to an error.
Error using MassSpringDamperApp/SimulateButtonPushed (line 115)
Unable to build a standalone executable to simulate the model 'MassSpringDamperModel' in rapid accelerator mode.
Caused by:
Error using Simulink.BlockDiagram.buildRapidAcceleratorTarget (line 37)
Aktive Codepage: 1252.
"C:\TDM-GC~1\bin/gcc" -c -fwrapv -m64 -O0 -DCLASSIC_INTERFACE=1 -DALLOCATIONFCN=0 -DONESTEPFCN=0 -DTERMFCN=1
-DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DEXT_MODE -DIS_RAPID_ACCEL -DTGTCONN -DNRT -DRSIM_PARAMETER_LOADING
-DRSIM_WITH_SL_SOLVER -DENABLE_SLEXEC_SSBRIDGE=1 -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -DON_TARGET_WAIT_FOR_START=0 -DTID01EQ=0
-DMODEL=MassSpringDamperModel -DNUMST=1 -DNCSTATES=2 -DHAVESTDIO @MassSpringDamperModel_comp.rsp -o "rt_logging.obj"
"C:/PROGRA~1/MATLAB/R2020a/rtw/c/src/rt_logging.c"
"C:\TDM-GC~1\bin/gcc" -c -fwrapv -m64 -O0 -DCLASSIC_INTERFACE=1 -DALLOCATIONFCN=0 -DONESTEPFCN=0 -DTERMFCN=1
-DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DEXT_MODE -DIS_RAPID_ACCEL -DTGTCONN -DNRT -DRSIM_PARAMETER_LOADING
-DRSIM_WITH_SL_SOLVER -DENABLE_SLEXEC_SSBRIDGE=1 -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -DON_TARGET_WAIT_FOR_START=0 -DTID01EQ=0
-DMODEL=MassSpringDamperModel -DNUMST=1 -DNCSTATES=2 -DHAVESTDIO @MassSpringDamperModel_comp.rsp -o "MassSpringDamperModel.obj"
"C:/Users/bean657/Documents/MATLAB/Examples/R2020a/simulinkcompiler/DeployingASimulationAppUsingSimulinkCompilerExample/slprj/raccel/MassSpringDamperModel/MassSpringDamperModel.c"
"C:\TDM-GC~1\bin/gcc" -c -fwrapv -m64 -O0 -DCLASSIC_INTERFACE=1 -DALLOCATIONFCN=0 -DONESTEPFCN=0 -DTERMFCN=1
-DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DEXT_MODE -DIS_RAPID_ACCEL -DTGTCONN -DNRT -DRSIM_PARAMETER_LOADING
-DRSIM_WITH_SL_SOLVER -DENABLE_SLEXEC_SSBRIDGE=1 -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -DON_TARGET_WAIT_FOR_START=0 -DTID01EQ=0
-DMODEL=MassSpringDamperModel -DNUMST=1 -DNCSTATES=2 -DHAVESTDIO @MassSpringDamperModel_comp.rsp -o
"MassSpringDamperModel_capi.obj"
"C:/Users/bean657/Documents/MATLAB/Examples/R2020a/simulinkcompiler/DeployingASimulationAppUsingSimulinkCompilerExample/slprj/raccel/MassSpringDamperModel/MassSpringDamperModel_capi.c"
"C:\TDM-GC~1\bin/gcc" -c -fwrapv -m64 -O0 -DCLASSIC_INTERFACE=1 -DALLOCATIONFCN=0 -DONESTEPFCN=0 -DTERMFCN=1
-DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DEXT_MODE -DIS_RAPID_ACCEL -DTGTCONN -DNRT -DRSIM_PARAMETER_LOADING
-DRSIM_WITH_SL_SOLVER -DENABLE_SLEXEC_SSBRIDGE=1 -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -DON_TARGET_WAIT_FOR_START=0 -DTID01EQ=0
-DMODEL=MassSpringDamperModel -DNUMST=1 -DNCSTATES=2 -DHAVESTDIO @MassSpringDamperModel_comp.rsp -o
"MassSpringDamperModel_data.obj"
"C:/Users/bean657/Documents/MATLAB/Examples/R2020a/simulinkcompiler/DeployingASimulationAppUsingSimulinkCompilerExample/slprj/raccel/MassSpringDamperModel/MassSpringDamperModel_data.c"
"C:\TDM-GC~1\bin/gcc" -c -fwrapv -m64 -O0 -DCLASSIC_INTERFACE=1 -DALLOCATIONFCN=0 -DONESTEPFCN=0 -DTERMFCN=1
-DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DEXT_MODE -DIS_RAPID_ACCEL -DTGTCONN -DNRT -DRSIM_PARAMETER_LOADING
-DRSIM_WITH_SL_SOLVER -DENABLE_SLEXEC_SSBRIDGE=1 -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -DON_TARGET_WAIT_FOR_START=0 -DTID01EQ=0
-DMODEL=MassSpringDamperModel -DNUMST=1 -DNCSTATES=2 -DHAVESTDIO @MassSpringDamperModel_comp.rsp -o
"MassSpringDamperModel_tgtconn.obj"
"C:/Users/bean657/Documents/MATLAB/Examples/R2020a/simulinkcompiler/DeployingASimulationAppUsingSimulinkCompilerExample/slprj/raccel/MassSpringDamperModel/MassSpringDamperModel_tgtconn.c"
"C:\TDM-GC~1\bin/gcc" -c -fwrapv -m64 -O0 -DCLASSIC_INTERFACE=1 -DALLOCATIONFCN=0 -DONESTEPFCN=0 -DTERMFCN=1
-DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DEXT_MODE -DIS_RAPID_ACCEL -DTGTCONN -DNRT -DRSIM_PARAMETER_LOADING
-DRSIM_WITH_SL_SOLVER -DENABLE_SLEXEC_SSBRIDGE=1 -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -DON_TARGET_WAIT_FOR_START=0 -DTID01EQ=0
-DMODEL=MassSpringDamperModel -DNUMST=1 -DNCSTATES=2 -DHAVESTDIO @MassSpringDamperModel_comp.rsp -o "rtGetInf.obj"
"C:/Users/bean657/Documents/MATLAB/Examples/R2020a/simulinkcompiler/DeployingASimulationAppUsingSimulinkCompilerExample/slprj/raccel/MassSpringDamperModel/rtGetInf.c"
"C:\TDM-GC~1\bin/gcc" -c -fwrapv -m64 -O0 -DCLASSIC_INTERFACE=1 -DALLOCATIONFCN=0 -DONESTEPFCN=0 -DTERMFCN=1
-DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DEXT_MODE -DIS_RAPID_ACCEL -DTGTCONN -DNRT -DRSIM_PARAMETER_LOADING
-DRSIM_WITH_SL_SOLVER -DENABLE_SLEXEC_SSBRIDGE=1 -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -DON_TARGET_WAIT_FOR_START=0 -DTID01EQ=0
-DMODEL=MassSpringDamperModel -DNUMST=1 -DNCSTATES=2 -DHAVESTDIO @MassSpringDamperModel_comp.rsp -o "rtGetNaN.obj"
"C:/Users/bean657/Documents/MATLAB/Examples/R2020a/simulinkcompiler/DeployingASimulationAppUsingSimulinkCompilerExample/slprj/raccel/MassSpringDamperModel/rtGetNaN.c"
"C:\TDM-GC~1\bin/gcc" -c -fwrapv -m64 -O0 -DCLASSIC_INTERFACE=1 -DALLOCATIONFCN=0 -DONESTEPFCN=0 -DTERMFCN=1
-DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DEXT_MODE -DIS_RAPID_ACCEL -DTGTCONN -DNRT -DRSIM_PARAMETER_LOADING
-DRSIM_WITH_SL_SOLVER -DENABLE_SLEXEC_SSBRIDGE=1 -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -DON_TARGET_WAIT_FOR_START=0 -DTID01EQ=0
-DMODEL=MassSpringDamperModel -DNUMST=1 -DNCSTATES=2 -DHAVESTDIO @MassSpringDamperModel_comp.rsp -o "rt_nonfinite.obj"
"C:/Users/bean657/Documents/MATLAB/Examples/R2020a/simulinkcompiler/DeployingASimulationAppUsingSimulinkCompilerExample/slprj/raccel/MassSpringDamperModel/rt_nonfinite.c"
"C:\TDM-GC~1\bin/gcc" -c -fwrapv -m64 -O0 -DCLASSIC_INTERFACE=1 -DALLOCATIONFCN=0 -DONESTEPFCN=0 -DTERMFCN=1
-DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DEXT_MODE -DIS_RAPID_ACCEL -DTGTCONN -DNRT -DRSIM_PARAMETER_LOADING
-DRSIM_WITH_SL_SOLVER -DENABLE_SLEXEC_SSBRIDGE=1 -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -DON_TARGET_WAIT_FOR_START=0 -DTID01EQ=0
-DMODEL=MassSpringDamperModel -DNUMST=1 -DNCSTATES=2 -DHAVESTDIO @MassSpringDamperModel_comp.rsp -o "rt_logging_mmi.obj"
"C:/PROGRA~1/MATLAB/R2020a/rtw/c/src/rt_logging_mmi.c"
"C:\TDM-GC~1\bin/gcc" -c -fwrapv -m64 -O0 -DCLASSIC_INTERFACE=1 -DALLOCATIONFCN=0 -DONESTEPFCN=0 -DTERMFCN=1
-DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DEXT_MODE -DIS_RAPID_ACCEL -DTGTCONN -DNRT -DRSIM_PARAMETER_LOADING
-DRSIM_WITH_SL_SOLVER -DENABLE_SLEXEC_SSBRIDGE=1 -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -DON_TARGET_WAIT_FOR_START=0 -DTID01EQ=0
-DMODEL=MassSpringDamperModel -DNUMST=1 -DNCSTATES=2 -DHAVESTDIO @MassSpringDamperModel_comp.rsp -o "rtw_modelmap_utils.obj"
"C:/PROGRA~1/MATLAB/R2020a/rtw/c/src/rtw_modelmap_utils.c"
"C:\TDM-GC~1\bin/gcc" -c -fwrapv -m64 -O0 -DCLASSIC_INTERFACE=1 -DALLOCATIONFCN=0 -DONESTEPFCN=0 -DTERMFCN=1
-DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DEXT_MODE -DIS_RAPID_ACCEL -DTGTCONN -DNRT -DRSIM_PARAMETER_LOADING
-DRSIM_WITH_SL_SOLVER -DENABLE_SLEXEC_SSBRIDGE=1 -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -DON_TARGET_WAIT_FOR_START=0 -DTID01EQ=0
-DMODEL=MassSpringDamperModel -DNUMST=1 -DNCSTATES=2 -DHAVESTDIO @MassSpringDamperModel_comp.rsp -o "raccel_main_new.obj"
"C:/PROGRA~1/MATLAB/R2020a/rtw/c/raccel/raccel_main_new.c"
"C:\TDM-GC~1\bin/gcc" -c -fwrapv -m64 -O0 -DCLASSIC_INTERFACE=1 -DALLOCATIONFCN=0 -DONESTEPFCN=0 -DTERMFCN=1
-DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DEXT_MODE -DIS_RAPID_ACCEL -DTGTCONN -DNRT -DRSIM_PARAMETER_LOADING
-DRSIM_WITH_SL_SOLVER -DENABLE_SLEXEC_SSBRIDGE=1 -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -DON_TARGET_WAIT_FOR_START=0 -DTID01EQ=0
-DMODEL=MassSpringDamperModel -DNUMST=1 -DNCSTATES=2 -DHAVESTDIO @MassSpringDamperModel_comp.rsp -o "raccel_sup.obj"
"C:/PROGRA~1/MATLAB/R2020a/rtw/c/raccel/raccel_sup.c"
C:/PROGRA~1/MATLAB/R2020a/rtw/c/raccel/raccel_sup.c: In function 'getRootInputSize':
C:/PROGRA~1/MATLAB/R2020a/rtw/c/raccel/raccel_sup.c:1184:5: error: 'for' loop initial declarations are only allowed in C99 or C11
mode
for (int loopIdx = 0; loopIdx < numDims; ++loopIdx) {
^
C:/PROGRA~1/MATLAB/R2020a/rtw/c/raccel/raccel_sup.c:1184:5: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to
compile your code
gmake: *** [raccel_sup.obj] Error 1
The make command returned an error of 2
Error(s) encountered while building "MassSpringDamperModel":
### Failed to generate all binary outputs.
Error using matlab.ui.control.internal.controller.ComponentController/executeUserCallback (line 382)
Error while evaluating Button PrivateButtonPushedFcn.
As the stack trace shows there is a probleme with the initial declaration in the for-loop:
C:/PROGRA~1/MATLAB/R2020a/rtw/c/raccel/raccel_sup.c:1184:5: error: 'for' loop initial declarations are only allowed in C99 or C11
mode
for (int loopIdx = 0; loopIdx < numDims; ++loopIdx) {
^
C:/PROGRA~1/MATLAB/R2020a/rtw/c/raccel/raccel_sup.c:1184:5: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to
compile your code
gmake: *** [raccel_sup.obj] Error 1
The make command returned an error of 2
Does anyone know how and where I have to set the compiler options with -std=c99... ?
I am using Matlab R2020a and I have Simulink and SimulinkCompiler installed.
Thanks!

Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by