From 3ead954dba96eec34885e3a5b300d9bde980ec63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Sj=C3=B6lund?= Date: Tue, 14 Nov 2017 08:41:23 +0100 Subject: [PATCH] Avoid using + for options Use -- or - for long/short options instead. --- Compiler/BackEnd/Initialization.mo | 2 +- Compiler/FrontEnd/ModelicaBuiltin.mo | 22 +++++++++++----------- Compiler/Template/CodegenFMUCpp.tpl | 2 +- Compiler/Util/Error.mo | 2 ++ 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Compiler/BackEnd/Initialization.mo b/Compiler/BackEnd/Initialization.mo index e5275a7365..4d90a34391 100644 --- a/Compiler/BackEnd/Initialization.mo +++ b/Compiler/BackEnd/Initialization.mo @@ -1391,7 +1391,7 @@ algorithm end if; //print("index-" + intString(index) + " ende\n"); end for; - Error.addCompilerError("The given system is mixed-determined. [index > " + intString(maxMixedDeterminedIndex) + "]\nPlease checkout the option \"+maxMixedDeterminedIndex\"."); + Error.addMessage(Error.MIXED_DETERMINED, {intString(maxMixedDeterminedIndex)}); fail(); end fixInitialSystem; diff --git a/Compiler/FrontEnd/ModelicaBuiltin.mo b/Compiler/FrontEnd/ModelicaBuiltin.mo index 871084ca42..b61654d8bd 100644 --- a/Compiler/FrontEnd/ModelicaBuiltin.mo +++ b/Compiler/FrontEnd/ModelicaBuiltin.mo @@ -1510,7 +1510,7 @@ function setPreOptModules "example input: removeFinalParameters,removeSimpleEqua input String modules; output Boolean success; algorithm - success := setCommandLineOptions("+preOptModules=" + modules); + success := setCommandLineOptions("--preOptModules=" + modules); annotation(__OpenModelica_EarlyInline = true, preferredView="text"); end setPreOptModules; @@ -1518,7 +1518,7 @@ function setCheapMatchingAlgorithm "example input: 3" input Integer matchingAlgorithm; output Boolean success; algorithm - success := setCommandLineOptions("+cheapmatchingAlgorithm=" + String(matchingAlgorithm)); + success := setCommandLineOptions("--cheapmatchingAlgorithm=" + String(matchingAlgorithm)); annotation(__OpenModelica_EarlyInline = true, preferredView="text"); end setCheapMatchingAlgorithm; @@ -1537,7 +1537,7 @@ function setMatchingAlgorithm "example input: omc" input String matchingAlgorithm; output Boolean success; algorithm - success := setCommandLineOptions("+matchingAlgorithm=" + matchingAlgorithm); + success := setCommandLineOptions("--matchingAlgorithm=" + matchingAlgorithm); annotation(__OpenModelica_EarlyInline = true, preferredView="text"); end setMatchingAlgorithm; @@ -1556,7 +1556,7 @@ function setIndexReductionMethod "example input: dynamicStateSelection" input String method; output Boolean success; algorithm - success := setCommandLineOptions("+indexReductionMethod=" + method); + success := setCommandLineOptions("--indexReductionMethod=" + method); annotation(__OpenModelica_EarlyInline = true, preferredView="text"); end setIndexReductionMethod; @@ -1564,7 +1564,7 @@ function setPostOptModules "example input: lateInline,inlineArrayEqn,removeSimpl input String modules; output Boolean success; algorithm - success := setCommandLineOptions("+postOptModules=" + modules); + success := setCommandLineOptions("--postOptModules=" + modules); annotation(__OpenModelica_EarlyInline = true, preferredView="text"); end setPostOptModules; @@ -1583,7 +1583,7 @@ function setTearingMethod "example input: omcTearing" input String tearingMethod; output Boolean success; algorithm - success := setCommandLineOptions("+tearingMethod=" + tearingMethod); + success := setCommandLineOptions("--tearingMethod=" + tearingMethod); annotation(__OpenModelica_EarlyInline = true, preferredView="text"); end setTearingMethod; @@ -1866,7 +1866,7 @@ function setAnnotationVersion "Sets the annotation version." input String annotationVersion; output Boolean success; algorithm - success := setCommandLineOptions("+annotationVersion=" + annotationVersion); + success := setCommandLineOptions("--annotationVersion=" + annotationVersion); annotation(__OpenModelica_EarlyInline = true, preferredView="text"); end setAnnotationVersion; @@ -1893,7 +1893,7 @@ function setVectorizationLimit input Integer vectorizationLimit; output Boolean success; algorithm - success := setCommandLineOptions("+v=" + String(vectorizationLimit)); + success := setCommandLineOptions("-v=" + String(vectorizationLimit)); annotation(__OpenModelica_EarlyInline = true, preferredView="text"); end setVectorizationLimit; @@ -1909,7 +1909,7 @@ public function setDefaultOpenCLDevice input Integer defdevid; output Boolean success; algorithm - success := setCommandLineOptions("+o=" + String(defdevid)); + success := setCommandLineOptions("-o=" + String(defdevid)); annotation(__OpenModelica_EarlyInline = true, preferredView="text"); end setDefaultOpenCLDevice; @@ -1930,7 +1930,7 @@ function setOrderConnections "Sets the orderConnection flag." input Boolean orderConnections; output Boolean success; algorithm - success := setCommandLineOptions("+orderConnections=" + String(orderConnections)); + success := setCommandLineOptions("--orderConnections=" + String(orderConnections)); annotation(__OpenModelica_EarlyInline = true, preferredView="text"); end setOrderConnections; @@ -1944,7 +1944,7 @@ function setLanguageStandard "Sets the Modelica Language Standard." input String inVersion; output Boolean success; algorithm - success := setCommandLineOptions("+std=" + inVersion); + success := setCommandLineOptions("--std=" + inVersion); annotation(__OpenModelica_EarlyInline = true, preferredView="text"); end setLanguageStandard; diff --git a/Compiler/Template/CodegenFMUCpp.tpl b/Compiler/Template/CodegenFMUCpp.tpl index 44503d4e06..c3c685f7c1 100644 --- a/Compiler/Template/CodegenFMUCpp.tpl +++ b/Compiler/Template/CodegenFMUCpp.tpl @@ -738,7 +738,7 @@ case SIMCODE(modelInfo=MODELINFO(__), makefileParams=MAKEFILE_PARAMS(__), simula # OMCompiler/SimulationRuntime/cpp/Makefile # - rebuild omc to add the new platform # - invoke the omc commands - # setCommandLineOptions("+simCodeTarget=Cpp"); + # setCommandLineOptions("--simCodeTarget=Cpp"); # buildModelFMU(MyModel, platforms={"i686-w64-mingw32"}); # - alternatively call this Makefile with # make TARGET_TRIPLET=i686-w64-mingw32 -f <%fileNamePrefix%>_FMU.makefile diff --git a/Compiler/Util/Error.mo b/Compiler/Util/Error.mo index 3785e28710..667e6e28e7 100644 --- a/Compiler/Util/Error.mo +++ b/Compiler/Util/Error.mo @@ -911,6 +911,8 @@ public constant Message VAR_NO_REMAINING_EQN = MESSAGE(582, SYMBOLIC(), WARNING( Util.gettext("Variable %s does not have any remaining equation to be solved in.\n The original equations were:%s")); public constant Message MOVING_PARAMETER_BINDING_TO_INITIAL_EQ_SECTION = MESSAGE(582, TRANSLATION(), NOTIFICATION(), Util.gettext("Moving binding to initial equation section and setting fixed attribute of %s to false.")); +public constant Message MIXED_DETERMINED = MESSAGE(583, SYMBOLIC(), ERROR(), + Util.gettext("The given system is mixed-determined. [index > %s]\nPlease checkout the option \"--maxMixedDeterminedIndex\".")); public constant Message MATCH_SHADOWING = MESSAGE(5001, TRANSLATION(), ERROR(), Util.gettext("Local variable '%s' shadows another variable."));