Skip to content

Commit

Permalink
- some fixes for successful compilation on rasberry pi (arm) or other…
Browse files Browse the repository at this point in the history
… slow machines

- fix some typos


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@23525 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Henning Kiel committed Nov 24, 2014
1 parent 1adcd21 commit a61b477
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 28 deletions.
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/Expression.mo
Expand Up @@ -994,7 +994,7 @@ public function subscriptExp

Takes an expression and a list of subscripts and subscripts
the given expression.
If a component refernce is given the subs are appled to it.
If a component reference is given the subs are applied to it.
If an array(DAE.ARRAY) is given the element at the specified
subscripts is returned.
e.g. subscriptExp on ({{1,2},{3,4}}) with sub [2,1] gives 3
Expand Down
2 changes: 1 addition & 1 deletion Compiler/SimCode/HpcOmSimCodeMain.mo
Expand Up @@ -361,7 +361,7 @@ algorithm
print("HpcOm is still under construction.\n");
then simCode;
else equation
Error.addMessage(Error.INTERNAL_ERROR, {"./Compiler/BackEnd/HpcOmSimCode.mo: function createSimCode failed."});
Error.addMessage(Error.INTERNAL_ERROR, {"function createSimCode failed."});
then fail();
end matchcontinue;
end createSimCode;
Expand Down
48 changes: 24 additions & 24 deletions Compiler/SimCode/SimCodeUtil.mo
Expand Up @@ -2557,7 +2557,7 @@ algorithm
// detailed error message
else
equation
message = "./Compiler/BackEnd/SimCodeUtil.mo: function createEquationsForSystem1 failed for component " + BackendDump.strongComponentString(comp);
message = "function createEquationsForSystem1 failed for component " + BackendDump.strongComponentString(comp);
Error.addMessage(Error.INTERNAL_ERROR, {message});
then fail();

Expand Down Expand Up @@ -3183,7 +3183,7 @@ algorithm
then listReverse(simWhenClauses);

else equation
Error.addMessage(Error.INTERNAL_ERROR, {"./Compiler/BackEnd/SimCodeUtil.mo: function createSimWhenClauses failed"});
Error.addMessage(Error.INTERNAL_ERROR, {"function createSimWhenClauses failed"});
then fail();
end matchcontinue;
end createSimWhenClauses;
Expand Down Expand Up @@ -3429,7 +3429,7 @@ algorithm
else equation
s1 = ExpressionDump.printExpStr(inExp);
s2 = ExpressionDump.printExpStr(inExp1);
s = stringAppendList({"./Compiler/BackEnd/SimCodeUtil.mo: function createNonlinearResidualEquationsComplex failed for: ", s1, " = " , s2 });
s = stringAppendList({"function createNonlinearResidualEquationsComplex failed for: ", s1, " = " , s2 });
Error.addMessage(Error.INTERNAL_ERROR, {s});
then fail();
end matchcontinue;
Expand Down Expand Up @@ -3639,7 +3639,7 @@ algorithm
then (eqSystemsRest, uniqueEqIndex, tempvars);

case (eq::_) equation
errorMessage = "./Compiler/BackEnd/SimCodeUtil.mo: function createNonlinearResidualEquations failed for equation: " + BackendDump.equationString(eq);
errorMessage = "function createNonlinearResidualEquations failed for equation: " + BackendDump.equationString(eq);
Error.addSourceMessage(Error.INTERNAL_ERROR, {errorMessage}, BackendEquation.equationInfo(eq));
then fail();
end matchcontinue;
Expand Down Expand Up @@ -3826,7 +3826,7 @@ algorithm
comp as BackendDAE.EQUATIONSYSTEM(eqns=eqIdcs,jac=jacobian,jacType=jac_tp, mixedSystem=mixedSystem))
equation
if Flags.isSet(Flags.FAILTRACE) then
Debug.trace("./Compiler/BackEnd/SimCodeUtil.mo: function createOdeSystem create continuous system.\n");
Debug.trace("function createOdeSystem create continuous system.\n");
end if;
// print("\ncreateOdeSystem -> Cont sys: ...\n");
// extract the variables and equations of the block.
Expand Down Expand Up @@ -3855,7 +3855,7 @@ algorithm

else
equation
msg = "./Compiler/BackEnd/SimCodeUtil.mo: function createOdeSystem failed for component " + BackendDump.strongComponentString(inComp);
msg = "function createOdeSystem failed for component " + BackendDump.strongComponentString(inComp);
Error.addMessage(Error.INTERNAL_ERROR, {msg});
then fail();
end matchcontinue;
Expand Down Expand Up @@ -3903,7 +3903,7 @@ algorithm
// here. Currently uses dgesv as for next case
case (BackendDAE.FULL_JACOBIAN(SOME(jac)), BackendDAE.JAC_CONSTANT()) equation
if Flags.isSet(Flags.FAILTRACE) then
Debug.trace("./Compiler/BackEnd/SimCodeUtil.mo: function createOdeSystem2 create linear system(const jacobian).\n");
Debug.trace("function createOdeSystem2 create linear system(const jacobian).\n");
end if;
((simVars, _)) = BackendVariable.traverseBackendDAEVars(inVars, traversingdlowvarToSimvar, ({}, inKnVars));
simVars = listReverse(simVars);
Expand All @@ -3922,7 +3922,7 @@ algorithm
// Time varying linear jacobian. Linear system of equations that needs to be solved during runtime.
case (BackendDAE.FULL_JACOBIAN(SOME(jac)), BackendDAE.JAC_LINEAR()) equation
if Flags.isSet(Flags.FAILTRACE) then
Debug.trace("./Compiler/BackEnd/SimCodeUtil.mo: function createOdeSystem2 create linear system with jacobian.\n");
Debug.trace("function createOdeSystem2 create linear system with jacobian.\n");
end if;
((simVars, _)) = BackendVariable.traverseBackendDAEVars(inVars, traversingdlowvarToSimvar, ({}, inKnVars));
simVars = listReverse(simVars);
Expand All @@ -3934,7 +3934,7 @@ algorithm
// Time varying nonlinear jacobian. Non-linear system of equations.
case (_, BackendDAE.JAC_GENERIC()) equation
if Flags.isSet(Flags.FAILTRACE) then
Debug.trace("./Compiler/BackEnd/SimCodeUtil.mo: function createOdeSystem2 create non-linear system with jacobian.");
Debug.trace("function createOdeSystem2 create non-linear system with jacobian.");
end if;
eqn_lst = BackendEquation.equationList(inEquationArray);
crefs = BackendVariable.getAllCrefFromVariables(inVars);
Expand All @@ -3947,7 +3947,7 @@ algorithm
// No analytic jacobian available. Generate non-linear system.
case (_, _) equation
if Flags.isSet(Flags.FAILTRACE) then
Debug.trace("./Compiler/BackEnd/SimCodeUtil.mo: functioncreateOdeSystem2 create non-linear system without jacobian.");
Debug.trace("function createOdeSystem2 create non-linear system without jacobian.");
end if;
eqn_lst = BackendEquation.equationList(inEquationArray);
crefs = BackendVariable.getAllCrefFromVariables(inVars);
Expand Down Expand Up @@ -4452,7 +4452,7 @@ algorithm
(vars, simequations, uniqueEqIndex, tempvars, numStateSets);
else
equation
errorMessage = "./Compiler/BackEnd/SimCodeUtil.mo: function createStateSetsSets failed.";
errorMessage = "function createStateSetsSets failed.";
Error.addMessage(Error.INTERNAL_ERROR, {errorMessage});
then
fail();
Expand Down Expand Up @@ -4602,7 +4602,7 @@ algorithm
case(_, _, _)
equation
true = Flags.isSet(Flags.JAC_DUMP);
errorMessage = "./Compiler/BackEnd/SimCodeUtil.mo: function createSymbolicSimulationJacobian failed.";
errorMessage = "function createSymbolicSimulationJacobian failed.";
Error.addMessage(Error.INTERNAL_ERROR, {errorMessage});
then (NONE(), iuniqueEqIndex, itempvars);

Expand Down Expand Up @@ -4900,7 +4900,7 @@ algorithm

else
equation
Error.addMessage(Error.INTERNAL_ERROR, {"./Compiler/BackEnd/SimCodeUtil.mo: function createAllDiffedSimVars failed"});
Error.addMessage(Error.INTERNAL_ERROR, {"function createAllDiffedSimVars failed"});
then fail();
end matchcontinue;
end createAllDiffedSimVars;
Expand Down Expand Up @@ -5066,7 +5066,7 @@ algorithm
(delayedExps, maxDelayedExpIndex+1);
else
equation
Error.addMessage(Error.INTERNAL_ERROR, {"./Compiler/BackEnd/SimCodeUtil.mo: function extractDelayedExpressions failed"});
Error.addMessage(Error.INTERNAL_ERROR, {"function extractDelayedExpressions failed"});
then
fail();
end matchcontinue;
Expand Down Expand Up @@ -5388,7 +5388,7 @@ algorithm
then ((uniqueEqIndex, result));
else
equation
Error.addMessage(Error.INTERNAL_ERROR, {"./Compiler/BackEnd/SimCodeUtil.mo: function createAlgorithmAndEquationAsserts failed"});
Error.addMessage(Error.INTERNAL_ERROR, {"function createAlgorithmAndEquationAsserts failed"});
then fail();
end matchcontinue;
end createAlgorithmAndEquationAsserts;
Expand All @@ -5415,7 +5415,7 @@ algorithm
then removedEquations;
else
equation
Error.addMessage(Error.INTERNAL_ERROR, {"./Compiler/BackEnd/SimCodeUtil.mo: function createRemovedEquations failed"});
Error.addMessage(Error.INTERNAL_ERROR, {"function createRemovedEquations failed"});
then fail();
end matchcontinue;
end createRemovedEquations;
Expand Down Expand Up @@ -5463,7 +5463,7 @@ algorithm
then vLst2;
else
equation
Error.addMessage(Error.INTERNAL_ERROR, {"./Compiler/BackEnd/SimCodeUtil.mo: function extractDiscreteModelVars failed"});
Error.addMessage(Error.INTERNAL_ERROR, {"function extractDiscreteModelVars failed"});
then fail();
end matchcontinue;
end extractDiscreteModelVars;
Expand Down Expand Up @@ -5552,7 +5552,7 @@ algorithm
// failure
else
equation
Error.addMessage(Error.INTERNAL_ERROR, {"./Compiler/BackEnd/SimCodeUtil.mo: function createSingleWhenEqnCode failed. When equations currently only supported on form v = ..."});
Error.addMessage(Error.INTERNAL_ERROR, {"function createSingleWhenEqnCode failed. When equations currently only supported on form v = ..."});
then fail();
end matchcontinue;
end createSingleWhenEqnCode;
Expand Down Expand Up @@ -5971,7 +5971,7 @@ algorithm
s1 = ExpressionDump.printExpStr(e1);
s2 = ExpressionDump.printExpStr(e2);
s3 = ComponentReference.printComponentRefListStr(crefs);
s = stringAppendList({"./Compiler/BackEnd/SimCodeUtil.mo: function createSingleComplexEqnCode2 failed for: ", s1, " = " , s2, " solve for ", s3 });
s = stringAppendList({"function createSingleComplexEqnCode2 failed for: ", s1, " = " , s2, " solve for ", s3 });
Debug.traceln(s);
then
fail();
Expand Down Expand Up @@ -6187,7 +6187,7 @@ algorithm
// failure
else
equation
Error.addMessage(Error.INTERNAL_ERROR, {"./Compiler/BackEnd/SimCodeUtil.mo: function createSingleAlgorithmCode failed!"});
Error.addMessage(Error.INTERNAL_ERROR, {"function createSingleAlgorithmCode failed!"});
then
fail();
end matchcontinue;
Expand Down Expand Up @@ -6269,7 +6269,7 @@ algorithm
s1 = ExpressionDump.printExpStr(e1);
s2 = ExpressionDump.printExpStr(e2);
s3 = ComponentReference.crefStr(cr);
s = stringAppendList({"./Compiler/BackEnd/SimCodeUtil.mo: function createSingleArrayEqnCode2 failed for: ", s1, " = " , s2, " solve for ", s3 });
s = stringAppendList({"function createSingleArrayEqnCode2 failed for: ", s1, " = " , s2, " solve for ", s3 });
Error.addMessage(Error.INTERNAL_ERROR, {s});
then
fail();
Expand Down Expand Up @@ -6340,7 +6340,7 @@ algorithm
then (residual_equations, {}, {}, numberOfInitialEquations, numberOfInitialAlgorithms, uniqueEqIndex, tempvars, false);

else equation
Error.addMessage(Error.INTERNAL_ERROR, {"./Compiler/BackEnd/SimCodeUtil.mo: createInitialResiduals failed"});
Error.addMessage(Error.INTERNAL_ERROR, {"function createInitialResiduals failed"});
then fail();
end matchcontinue;
end createInitialResiduals;
Expand Down Expand Up @@ -8505,7 +8505,7 @@ algorithm
case (path, _, _, _)
equation
failure(_ = DAEUtil.getNamedFunction(path, funcs));
str = "./Compiler/BackEnd/SimCodeUtil.mo: function getCalledFunctionsInFunction2: Class " + pathstr + " not found in global scope.";
str = "function getCalledFunctionsInFunction2: Class " + pathstr + " not found in global scope.";
Error.addMessage(Error.INTERNAL_ERROR, {str});
then
fail();
Expand Down Expand Up @@ -11416,7 +11416,7 @@ algorithm

case _
equation
Error.addMessage(Error.INTERNAL_ERROR, {"./Compiler/BackEnd/SimCodeUtil.mo: function collectAllFiles failed to collect files from SimCode!"});
Error.addMessage(Error.INTERNAL_ERROR, {"function collectAllFiles failed to collect files from SimCode!"});
then
inSimCode;
end matchcontinue;
Expand Down
5 changes: 5 additions & 0 deletions Makefile.in
Expand Up @@ -135,6 +135,11 @@ omc-bootstrapped:
$(MAKE) -C Compiler/boot
$(MAKE) omlibrary

fake_modelica3d:
# create fake files for debian package
mkdir -p $(DESTDIR)/usr/lib/omc $(DESTDIR)/usr/lib/omlibrary-modelica3d
touch $(DESTDIR)/usr/lib/libhuhu.so $(DESTDIR)/usr/lib/omc/libmodbus.a $(DESTDIR)/usr/lib/omc/libmodcount.a $(DESTDIR)/usr/lib/omlibrary-modelica3d/.empty-dir

modelica3d:
ifeq (@MODELICA3D@,)
@echo Skipping Modelica3D
Expand Down
2 changes: 1 addition & 1 deletion Parser/Makefile.common
Expand Up @@ -17,7 +17,7 @@ install: libantlr3.a libomparse.a
cp libantlr3.a libomparse.a ../build/lib/omc/

$(ANTLR)/antlr3config.h: $(ANTLR)/antlr3config.h.in $(ANTLR)/configure
(cd $(ANTLR) && ./configure $(ANTLR64) CC="$(CC)" LDFLAGS="" CFLAGS="" CPPFLAGS="")
(cd $(ANTLR) && ./configure $(ANTLR64) $(ANTLRDEBUG) CC="$(CC)" LDFLAGS="" CFLAGS="" CPPFLAGS="")
libantlr3.a: $(ANTLR)/src/*.c $(ANTLR)/include/*.h $(ANTLR)/antlr3config.h
# build the library
$(CC) ${CFLAGS} ${CPPFLAGS} -c $(ANTLR)/src/*.c -I$(ANTLR)/include -I$(ANTLR)
Expand Down
5 changes: 4 additions & 1 deletion Parser/Makefile.in
@@ -1,12 +1,15 @@
CC=@CC@
CXX=@CXX@
CFLAGS=@CFLAGS@ -Wall -DANTLR3_NODEBUGGER @EXTRA_CFLAGS_GENERATED_CODE@
CFLAGS=@CFLAGS@ -Wall @EXTRA_CFLAGS_GENERATED_CODE@
CPPFLAGS=@CPPFLAGS@ -I$(COMPILERHOME) $(RMLINC) -I. -I$(ANTLR) -I$(ANTLR)/include -I../3rdParty/gc/include $(BUILDINC)
RMLHOME=@rmlhome@
OMC=../build/bin/omc
ifeq (x86_64,@target_cpu@)
ANTLR64=--enable-64bit
endif
ifeq (arm,@target_cpu@)
ANTLRDEBUG="--disable-antlrdebug --disable-abiflags"
endif

include Makefile.common

Expand Down

0 comments on commit a61b477

Please sign in to comment.