Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit 10081da

Browse files
AndreasOpenModelica-Hudson
authored andcommitted
Fix bug introduced by PR #3067
- Library tests could not detect errors when building FMUs - Removed introduced try-catch and new time measurement Belonging to [master]: - #3070
1 parent 67b8802 commit 10081da

File tree

1 file changed

+6
-24
lines changed

1 file changed

+6
-24
lines changed

Compiler/Script/CevalScriptBackend.mo

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3565,7 +3565,6 @@ protected
35653565
list<String> libs;
35663566
Boolean isWindows;
35673567
String FMUType = inFMUType;
3568-
Real timeCompile;
35693568
algorithm
35703569
cache := inCache;
35713570
if not FMI.checkFMIVersion(FMUVersion) then
@@ -3624,46 +3623,29 @@ algorithm
36243623
ExecStat.execStat("buildModelFMU: Generate C++ for platform " + platform);
36253624
end for;
36263625
if 0 <> System.systemCall("make -f " + filenameprefix + "_FMU.makefile clean", outFile=logfile) then
3627-
// do nothing
3628-
end if;
3626+
// do nothing
3627+
end if;
36293628
return;
36303629
end if;
36313630

3632-
System.realtimeTick(ClockIndexes.RT_CLOCK_BUILD_MODEL);
36333631
if not Config.simCodeTarget() == "omsic" then
36343632
CevalScript.compileModel(filenameprefix+"_FMU" , libs);
3635-
36363633
ExecStat.execStat("buildModelFMU: Generate the FMI files");
3637-
3638-
fmutmp := filenameprefix + ".fmutmp";
3639-
logfile := filenameprefix + ".log";
3640-
dir := fmutmp+"/sources/";
36413634
else
36423635
fmutmp := filenameprefix+".fmutmp" + Autoconf.pathDelimiter;
3643-
try
3644-
CevalScript.compileModel(filenameprefix+"_FMU" , libs, fmutmp);
3645-
timeCompile := System.realtimeTock(ClockIndexes.RT_CLOCK_BUILD_MODEL);
3646-
else
3647-
Error.addMessage(Error.SIMULATOR_BUILD_ERROR, {System.readFile(fmutmp + filenameprefix+"_FMU.log")});
3648-
end try;
3636+
CevalScript.compileModel(filenameprefix+"_FMU" , libs, fmutmp);
36493637
return;
36503638
end if;
36513639

36523640
for platform in platforms loop
3653-
try
3654-
configureFMU(platform, fmutmp, System.realpath(fmutmp)+"/resources/"+System.stringReplace(listGet(Util.stringSplitAtChar(platform," "),1),"/","-")+".log", isWindows);
3655-
ExecStat.execStat("buildModelFMU: Generate platform " + platform);
3656-
else
3657-
Error.addMessage(Error.SIMULATOR_BUILD_ERROR, {"Configure for platform:\"" + platform + "\" does not exist"});
3658-
end try;
3641+
configureFMU(platform, fmutmp, System.realpath(fmutmp)+"/resources/"+System.stringReplace(listGet(Util.stringSplitAtChar(platform," "),1),"/","-")+".log", isWindows);
3642+
ExecStat.execStat("buildModelFMU: Generate platform " + platform);
36593643
end for;
36603644

36613645
cmd := "rm -f \"" + fmuTargetName + ".fmu\" && cd \"" + fmutmp + "\" && zip -r \"../" + fmuTargetName + ".fmu\" *";
36623646
if 0 <> System.systemCall(cmd, outFile=logfile) then
36633647
Error.addMessage(Error.SIMULATOR_BUILD_ERROR, {cmd + "\n\n" + System.readFile(logfile)});
36643648
ExecStat.execStat("buildModelFMU failed");
3665-
else
3666-
timeCompile := System.realtimeTock(ClockIndexes.RT_CLOCK_BUILD_MODEL);
36673649
end if;
36683650

36693651
if not System.regularFileExists(fmuTargetName + ".fmu") then
@@ -5168,10 +5150,10 @@ algorithm
51685150
if success then
51695151
try
51705152
CevalScript.compileModel(filenameprefix, libs);
5171-
timeCompile := System.realtimeTock(ClockIndexes.RT_CLOCK_BUILD_MODEL);
51725153
else
51735154
success := false;
51745155
end try;
5156+
timeCompile := System.realtimeTock(ClockIndexes.RT_CLOCK_BUILD_MODEL);
51755157
else
51765158
timeCompile := 0.0;
51775159
end if;

0 commit comments

Comments
 (0)