Skip to content

Commit

Permalink
fix boostrapping
Browse files Browse the repository at this point in the history
- patch Absyn C sources
- fix QT api generation
- fix MatlabTranslator test
- fix testsuite
  • Loading branch information
adrpo committed Jul 2, 2019
1 parent d506d8d commit 212bdd7
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion OMCompiler/Compiler/Template/GenerateAPIFunctionsTpl.tpl
Expand Up @@ -8,6 +8,7 @@ template getCevalScriptInterface(list<DAE.Type> tys)
let funcs = tys |> ty as T_FUNCTION(__) => '<%getCevalScriptInterfaceFunc(pathLastIdent(path), ty.funcArg, ty.funcResultType)%><%\n%>'
<<
import Absyn;
import AbsynUtil;
import CevalScript;
import Parser;
import SymbolTable;
Expand Down Expand Up @@ -62,7 +63,7 @@ template getOutValue(Text name, DAE.Type ty, Text &varDecl, Text &postMatch)

case T_CODE(ty=C_TYPENAME(__)) then
let &varDecl += 'Absyn.Path <%name%>_path;<%\n%>'
let &postMatch += '<%name%> := Absyn.pathString(<%name%>_path);<%\n%>'
let &postMatch += '<%name%> := AbsynUtil.pathString(<%name%>_path);<%\n%>'
'Values.CODE(Absyn.C_TYPENAME(path=<%name%>_path))'
else error(sourceInfo(), 'getOutValue failed for <%unparseType(ty)%>')
end getOutValue;
Expand Down
2 changes: 2 additions & 0 deletions OMCompiler/Compiler/boot/Makefile.common
Expand Up @@ -52,6 +52,8 @@ bootstrap-from-tarball:
# Patch _main.c to avoid a new tarball
$(MAKE) -f $(defaultMakefileTarget) patch-files
$(PATCH_SOURCES)
cd build && patch -i ../patches/Absyn.h.1.patch Absyn.h
cd build && patch -i ../patches/Absyn.c.1.patch Absyn.c
cd build && patch -i ../patches/CevalScript.c.1.patch CevalScript.c
cd build && patch -i ../patches/System_includes.h.patch System_includes.h
# We have not compiled OpenModelicaScriptingAPI.mo yet
Expand Down
Binary file added OMCompiler/Compiler/boot/patches/Absyn.c.1.patch.xz
Binary file not shown.
Binary file added OMCompiler/Compiler/boot/patches/Absyn.h.1.patch.xz
Binary file not shown.
2 changes: 1 addition & 1 deletion testsuite/openmodelica/bootstrapping/DumpTest.mos
Expand Up @@ -9,7 +9,7 @@ setCommandLineOptions("-d=rml,noevalfunc,gen");
echo(false);
body:=Absyn.PARTS({},{},{},{},NONE());
restr:=Absyn.R_FUNCTION(Absyn.FR_NORMAL_FUNCTION(Absyn.PURE()));
prog:=Absyn.PROGRAM({Absyn.CLASS("dummyClass",true,true,true,restr,body,Absyn.dummyInfo)},Absyn.TOP());
prog:=Absyn.PROGRAM({Absyn.CLASS("dummyClass",true,true,true,restr,body,AbsynUtil.dummyInfo)},Absyn.TOP());
echo(true);
"DumpGraphviz.dump";
DumpGraphviz.dump(prog);
Expand Down
Expand Up @@ -6,6 +6,7 @@ if true then /* Suppress output */
setCommandLineOptions("+g=MetaModelica");
files := {
prefixPath + "FrontEnd/Absyn.mo",
prefixPath + "FrontEnd/AbsynUtil.mo",
prefixPath + "FrontEnd/Algorithm.mo",
prefixPath + "FrontEnd/Builtin.mo",
prefixPath + "FrontEnd/Ceval.mo",
Expand Down
2 changes: 1 addition & 1 deletion testsuite/simulation/modelica/others/TestSolve18.mos
Expand Up @@ -40,7 +40,7 @@ val(z,1.0);
// Warning: There are iteration variables with default zero start attribute. For more information set -d=initialization. In OMEdit Tools->Options->Simulation->OMCFlags, in OMNotebook call setCommandLineOptions("-d=initialization").
// [BackEnd/ExpressionSolve.mo:0:0-0:0:writable] Error: Internal error Failed to solve "(-exp(if y > 0.0 then time else 2.0 * time)) * y = -1.0 - time" w.r.t. "y"
// [BackEnd/ExpressionSolve.mo:0:0-0:0:writable] Error: Internal error Failed to solve "/*Real*/(sign(1.0 + 2.0 * x)) = log(1.0 - (-0.2) * time)" w.r.t. "x"
// [BackEnd/Differentiate.mo:198:7-198:147:writable] Error: Derivative of expression "der(z) - (x - y)" w.r.t. "z" is non-existent.
// [BackEnd/Differentiate.mo:199:7-199:147:writable] Error: Derivative of expression "der(z) - (x - y)" w.r.t. "z" is non-existent.
// [BackEnd/ExpressionSolve.mo:0:0-0:0:writable] Error: Internal error Failed to solve "der(z) = x - y" w.r.t. "z"
// "
//
Expand Down
1 change: 1 addition & 0 deletions testsuite/special/MatlabTranslator/LoadCompilerSources.mos
Expand Up @@ -6,6 +6,7 @@ if true then /* Suppress output */
setCommandLineOptions("+g=MetaModelica");
files := {
prefixPath + "FrontEnd/Absyn.mo",
prefixPath + "FrontEnd/AbsynUtil.mo",
prefixPath + "FrontEnd/Algorithm.mo",
prefixPath + "FrontEnd/Builtin.mo",
prefixPath + "FrontEnd/CevalFunction.mo",
Expand Down
1 change: 1 addition & 0 deletions testsuite/special/MatlabTranslator/SCRIPT.mos
Expand Up @@ -12,6 +12,7 @@ files := {
//"Absyn.mo",
"AbsynMat.mo",
"../../../OMCompiler/Compiler/FrontEnd/Absyn.mo",
"../../../OMCompiler/Compiler/FrontEnd/AbsynUtil.mo",
"../../../OMCompiler/Compiler/Util/Autoconf.mo",
"../../../OMCompiler/Compiler/Util/Error.mo",
"../../../OMCompiler/Compiler/Util/ErrorExt.mo",
Expand Down

0 comments on commit 212bdd7

Please sign in to comment.