Skip to content

Commit

Permalink
Deprecate includeResources in buildModelFMU (#10874)
Browse files Browse the repository at this point in the history
* Deprecate `includeResources` in `buildModelFMU` via annotation
* Changed `‘` to `'` in Error.mo
  • Loading branch information
AnHeuermann committed Jun 21, 2023
1 parent 9166c1a commit b0c67fe
Show file tree
Hide file tree
Showing 76 changed files with 129 additions and 129 deletions.
2 changes: 1 addition & 1 deletion OMCompiler/Compiler/FrontEnd/ModelicaBuiltin.mo
Expand Up @@ -2507,7 +2507,7 @@ The only required argument is the className, while all others have some default
\"static\"=current platform, statically link everything.
\"<cpu>-<vendor>-<os>\", host tripple, e.g. \"x86_64-linux-gnu\" or \"x86_64-w64-mingw32\".
\"<cpu>-<vendor>-<os> docker run <image>\" host tripple with Docker image, e.g. \"x86_64-linux-gnu docker run --pull=never multiarch/crossbuild\"";
input Boolean includeResources = false "include Modelica based resources via loadResource or not";
input Boolean includeResources = false "Depreacted and no effect";
output String generatedFileName "Returns the full path of the generated FMU.";
external "builtin";
annotation(preferredView="text");
Expand Down
4 changes: 2 additions & 2 deletions OMCompiler/Compiler/NFFrontEnd/NFModelicaBuiltin.mo
Expand Up @@ -1444,7 +1444,7 @@ was read in binary format from a file with the same name.
"
input String data;
input String filename = "<interactive>";
input String encoding = "UTF-8";
input String encoding = "UTF-8" "Deprecated as *ALL* strings are now UTF-8 encoded";
input Boolean merge = false "if merge is true the parsed AST is merged with the existing AST, default to false which means that is replaced, not merged";
output Boolean success;
external "builtin";
Expand Down Expand Up @@ -2760,7 +2760,7 @@ The only required argument is the className, while all others have some default
\"static\"=current platform, statically link everything.
\"<cpu>-<vendor>-<os>\", host tripple, e.g. \"x86_64-linux-gnu\" or \"x86_64-w64-mingw32\".
\"<cpu>-<vendor>-<os> docker run <image>\" host tripple with Docker image, e.g. \"x86_64-linux-gnu docker run --pull=never multiarch/crossbuild\"";
input Boolean includeResources = false "include Modelica based resources via loadResource or not";
input Boolean includeResources = false "Depreacted and no effect";
output String generatedFileName "Returns the full path of the generated FMU.";
external "builtin";
annotation(preferredView="text");
Expand Down
104 changes: 52 additions & 52 deletions OMCompiler/Compiler/Util/Error.mo

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion testsuite/flattening/modelica/equations/WhenNotInitial.mo
Expand Up @@ -17,6 +17,6 @@ end WhenNotInitial;
// r = 1.0;
// end when;
// end WhenNotInitial;
// [flattening/modelica/equations/WhenNotInitial.mo:7:3-9:11:writable] Warning: initial() may only be used as a when condition (when initial() or when {..., initial(), ...}), but got condition not initial().
// [flattening/modelica/equations/WhenNotInitial.mo:7:3-9:11:writable] Warning: initial() may only be used as a when condition (when initial() or when {..., initial(), ...}), but got condition 'not initial()'.
//
// endResult
2 changes: 1 addition & 1 deletion testsuite/flattening/modelica/ffi/MissingFunction1.mos
Expand Up @@ -12,7 +12,7 @@ instantiateModel(FFITest.ErrorChecking.MissingFunction1); getErrorString();
// true
// ""
// ""
// "[flattening/modelica/ffi/FFITest/package.mo:252:5-256:25:writable] Error: External function missingFunction1_ext could not be found in any of the given shared libraries:
// "[flattening/modelica/ffi/FFITest/package.mo:252:5-256:25:writable] Error: External function 'missingFunction1_ext' could not be found in any of the given shared libraries:
// bin/../lib/x86_64-linux-gnu/omc/FFITestLib.so
// flattening/modelica/ffi/FFITest/Resources/Library/linux64/FFITestLib.so
// flattening/modelica/ffi/FFITest/Resources/Library/FFITestLib.so
Expand Down
Expand Up @@ -17,7 +17,7 @@ end ActualStreamNoStream1;

// Result:
// Error processing file: ActualStreamNoStream1.mo
// [flattening/modelica/scodeinst/ActualStreamNoStream1.mo:15:3-15:30:writable] Error: Operand c.f to operator actualStream is not a stream variable.
// [flattening/modelica/scodeinst/ActualStreamNoStream1.mo:15:3-15:30:writable] Error: Operand 'c.f' to operator 'actualStream' is not a stream variable.
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
Expand Down
Expand Up @@ -10,7 +10,7 @@ end ActualStreamNonCref1;

// Result:
// Error processing file: ActualStreamNonCref1.mo
// [flattening/modelica/scodeinst/ActualStreamNonCref1.mo:8:3-8:28:writable] Error: Operand ‘1‘ to operator actualStream is not a stream variable.
// [flattening/modelica/scodeinst/ActualStreamNonCref1.mo:8:3-8:28:writable] Error: Operand '1' to operator 'actualStream' is not a stream variable.
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
Expand Down
Expand Up @@ -18,7 +18,7 @@ end ActualStreamVariability1;

// Result:
// Error processing file: ActualStreamVariability1.mo
// [flattening/modelica/scodeinst/ActualStreamVariability1.mo:16:3-16:29:writable] Error: Connector c[n].s has non-parameter subscript ‘n‘.
// [flattening/modelica/scodeinst/ActualStreamVariability1.mo:16:3-16:29:writable] Error: Connector 'c[n].s' has non-parameter subscript 'n'.
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
Expand Down
2 changes: 1 addition & 1 deletion testsuite/flattening/modelica/scodeinst/AssignModel1.mo
Expand Up @@ -16,7 +16,7 @@ end AssignModel1;

// Result:
// Error processing file: AssignModel1.mo
// [flattening/modelica/scodeinst/AssignModel1.mo:14:3-14:11:writable] Error: Component ‘a1‘ may not be assigned to due to class specialization model.
// [flattening/modelica/scodeinst/AssignModel1.mo:14:3-14:11:writable] Error: Component 'a1' may not be assigned to due to class specialization 'model'.
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
Expand Down
2 changes: 1 addition & 1 deletion testsuite/flattening/modelica/scodeinst/AssignPackage1.mo
Expand Up @@ -16,7 +16,7 @@ end AssignPackage1;

// Result:
// Error processing file: AssignPackage1.mo
// [flattening/modelica/scodeinst/AssignPackage1.mo:14:3-14:11:writable] Error: Component ‘p1‘ may not be assigned to due to class specialization package.
// [flattening/modelica/scodeinst/AssignPackage1.mo:14:3-14:11:writable] Error: Component 'p1' may not be assigned to due to class specialization 'package'.
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
Expand Down
Expand Up @@ -10,7 +10,7 @@ end BindingInvalidType2;

// Result:
// Error processing file: BindingInvalidType2.mo
// [flattening/modelica/scodeinst/BindingInvalidType2.mo:8:3-8:21:writable] Error: Type mismatch in binding x = {1, 2, 3}, expected array dimensions [], got [3].
// [flattening/modelica/scodeinst/BindingInvalidType2.mo:8:3-8:21:writable] Error: Type mismatch in binding 'x = {1, 2, 3}', expected array dimensions [], got [3].
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
Expand Down
Expand Up @@ -10,7 +10,7 @@ end BindingInvalidType3;

// Result:
// Error processing file: BindingInvalidType3.mo
// [flattening/modelica/scodeinst/BindingInvalidType3.mo:8:3-8:21:writable] Error: Type mismatch in binding x = {1, 2}, expected array dimensions [3], got [2].
// [flattening/modelica/scodeinst/BindingInvalidType3.mo:8:3-8:21:writable] Error: Type mismatch in binding 'x = {1, 2}', expected array dimensions [3], got [2].
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
Expand Down
Expand Up @@ -10,7 +10,7 @@ end BindingInvalidType4;

// Result:
// Error processing file: BindingInvalidType4.mo
// [flattening/modelica/scodeinst/BindingInvalidType4.mo:8:3-8:16:writable] Error: Non-array modification ‘1‘ for array component ‘x‘, possibly due to missing each.
// [flattening/modelica/scodeinst/BindingInvalidType4.mo:8:3-8:16:writable] Error: Non-array modification '1' for array component 'x', possibly due to missing 'each'.
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
Expand Down
2 changes: 1 addition & 1 deletion testsuite/flattening/modelica/scodeinst/Break2.mo
Expand Up @@ -18,7 +18,7 @@ end Break2;

// Result:
// Error processing file: Break2.mo
// [flattening/modelica/scodeinst/Break2.mo:12:3-12:8:writable] Error: break' may only be used in a while- or for-loop.
// [flattening/modelica/scodeinst/Break2.mo:12:3-12:8:writable] Error: 'break' may only be used in a while- or for-loop.
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
Expand Down
2 changes: 1 addition & 1 deletion testsuite/flattening/modelica/scodeinst/Clock3.mo
Expand Up @@ -14,7 +14,7 @@ end Clock3;

// Result:
// Error processing file: Clock3.mo
// [flattening/modelica/scodeinst/Clock3.mo:12:3-12:20:writable] Error: Component ‘c‘ may not have a binding equation due to class specialization model.
// [flattening/modelica/scodeinst/Clock3.mo:12:3-12:20:writable] Error: Component 'c' may not have a binding equation due to class specialization 'model'.
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
Expand Down
Expand Up @@ -13,7 +13,7 @@ end ConditionInvalidContext1;

// Result:
// Error processing file: ConditionInvalidContext1.mo
// [flattening/modelica/scodeinst/ConditionInvalidContext1.mo:10:3-10:8:writable] Error: Conditional component ‘x‘ is used in a non-connect context.
// [flattening/modelica/scodeinst/ConditionInvalidContext1.mo:10:3-10:8:writable] Error: Conditional component 'x' is used in a non-connect context.
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
Expand Down
Expand Up @@ -12,7 +12,7 @@ end ConditionInvalidContext2;

// Result:
// Error processing file: ConditionInvalidContext2.mo
// [flattening/modelica/scodeinst/ConditionInvalidContext2.mo:9:3-9:13:writable] Error: Conditional component ‘x‘ is used in a non-connect context.
// [flattening/modelica/scodeinst/ConditionInvalidContext2.mo:9:3-9:13:writable] Error: Conditional component 'x' is used in a non-connect context.
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
Expand Down
Expand Up @@ -19,7 +19,7 @@ end ConnectArraysInvalidSubscript1;

// Result:
// Error processing file: ConnectArraysInvalidSubscript1.mo
// [flattening/modelica/scodeinst/ConnectArraysInvalidSubscript1.mo:17:3-17:24:writable] Error: Connector c1[n] has non-parameter subscript ‘n‘.
// [flattening/modelica/scodeinst/ConnectArraysInvalidSubscript1.mo:17:3-17:24:writable] Error: Connector 'c1[n]' has non-parameter subscript 'n'.
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
Expand Down
2 changes: 1 addition & 1 deletion testsuite/flattening/modelica/scodeinst/DimUnknown4.mo
Expand Up @@ -19,7 +19,7 @@ end DimUnknown4;

// Result:
// Error processing file: DimUnknown4.mo
// [flattening/modelica/scodeinst/DimUnknown4.mo:9:3-9:15:writable] Error: Dimension 1 of ‘x‘ could not be deduced from the component's binding equation 3.0.
// [flattening/modelica/scodeinst/DimUnknown4.mo:9:3-9:15:writable] Error: Dimension 1 of 'x' could not be deduced from the component's binding equation '3.0'.
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
Expand Down
2 changes: 1 addition & 1 deletion testsuite/flattening/modelica/scodeinst/Each3.mo
Expand Up @@ -15,7 +15,7 @@ end Each3;
// Result:
// Error processing file: Each3.mo
// [flattening/modelica/scodeinst/Each3.mo:12:14-12:24:writable] Notification: From here:
// [flattening/modelica/scodeinst/Each3.mo:8:3-8:12:writable] Error: Non-array modification true for array component fixed, possibly due to missing each.
// [flattening/modelica/scodeinst/Each3.mo:8:3-8:12:writable] Error: Non-array modification 'true' for array component 'fixed', possibly due to missing 'each'.
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
Expand Down
Expand Up @@ -16,7 +16,7 @@ end ExpandableConnectorFlow1;

// Result:
// Error processing file: ExpandableConnectorFlow1.mo
// [flattening/modelica/scodeinst/ExpandableConnectorFlow1.mo:10:3-10:14:writable] Error: Prefix flow on component ‘f‘ not allowed in class specialization expandable connector.
// [flattening/modelica/scodeinst/ExpandableConnectorFlow1.mo:10:3-10:14:writable] Error: Prefix 'flow' on component 'f' not allowed in class specialization 'expandable connector'.
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
Expand Down
Expand Up @@ -24,6 +24,6 @@ end ForEquationShadow1;
// x = 4.0;
// end ForEquationShadow1;
// [flattening/modelica/scodeinst/ForEquationShadow1.mo:10:3-14:10:writable] Notification: From here:
// [flattening/modelica/scodeinst/ForEquationShadow1.mo:11:5-13:12:writable] Warning: An iterator named ‘i‘ is already declared in this scope.
// [flattening/modelica/scodeinst/ForEquationShadow1.mo:11:5-13:12:writable] Warning: An iterator named 'i' is already declared in this scope.
//
// endResult
Expand Up @@ -17,7 +17,7 @@ end FuncBuiltinDerInvalid1;

// Result:
// Error processing file: FuncBuiltinDerInvalid1.mo
// [flattening/modelica/scodeinst/FuncBuiltinDerInvalid1.mo:11:3-11:18:writable] Error: Argument ‘x‘ of der is not differentiable.
// [flattening/modelica/scodeinst/FuncBuiltinDerInvalid1.mo:11:3-11:18:writable] Error: Argument 'x' of der is not differentiable.
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
Expand Down
Expand Up @@ -17,7 +17,7 @@ end FuncBuiltinDerInvalid2;

// Result:
// Error processing file: FuncBuiltinDerInvalid2.mo
// [flattening/modelica/scodeinst/FuncBuiltinDerInvalid2.mo:11:3-11:18:writable] Error: Argument ‘x‘ of der is not differentiable.
// [flattening/modelica/scodeinst/FuncBuiltinDerInvalid2.mo:11:3-11:18:writable] Error: Argument 'x' of der is not differentiable.
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
Expand Down
Expand Up @@ -13,7 +13,7 @@ end FuncBuiltinFill2;

// Result:
// Error processing file: FuncBuiltinFill2.mo
// [flattening/modelica/scodeinst/FuncBuiltinFill2.mo:11:3-11:31:writable] Error: Expression ‘n‘ that determines the size of dimension ‘2‘ of fill(0, 1, n) is not an evaluable parameter expression.
// [flattening/modelica/scodeinst/FuncBuiltinFill2.mo:11:3-11:31:writable] Error: Expression 'n' that determines the size of dimension '2' of 'fill(0, 1, n)' is not an evaluable parameter expression.
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
Expand Down
Expand Up @@ -13,7 +13,7 @@ end FuncBuiltinPromoteInvalid1;

// Result:
// Error processing file: FuncBuiltinPromoteInvalid1.mo
// [flattening/modelica/scodeinst/FuncBuiltinPromoteInvalid1.mo:11:3-11:28:writable] Error: The second argument ‘1‘ of promote may not be smaller than the number of dimensions (2) of the first argument.
// [flattening/modelica/scodeinst/FuncBuiltinPromoteInvalid1.mo:11:3-11:28:writable] Error: The second argument '1' of promote may not be smaller than the number of dimensions (2) of the first argument.
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
Expand Down
Expand Up @@ -11,7 +11,7 @@ end FuncBuiltinPure2;

// Result:
// Error processing file: FuncBuiltinPure2.mo
// [flattening/modelica/scodeinst/FuncBuiltinPure2.mo:9:3-9:21:writable] Error: The argument to pure must be a function call expression.
// [flattening/modelica/scodeinst/FuncBuiltinPure2.mo:9:3-9:21:writable] Error: The argument to 'pure' must be a function call expression.
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
Expand Down
Expand Up @@ -25,7 +25,7 @@ end FunctionDerivativeInvalidInput1;

// Result:
// Error processing file: FunctionDerivativeInvalidInput1.mo
// [flattening/modelica/scodeinst/FunctionDerivativeInvalidInput1.mo:12:14-12:49:writable] Error: ‘z‘ is not an input of function ‘f1‘.
// [flattening/modelica/scodeinst/FunctionDerivativeInvalidInput1.mo:12:14-12:49:writable] Error: 'z' is not an input of function 'f1'.
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
Expand Down
Expand Up @@ -27,6 +27,6 @@ end FunctionDerivativeMissingName1;
// class FunctionDerivativeMissingName1
// Real x = f1(time, time);
// end FunctionDerivativeMissingName1;
// [flattening/modelica/scodeinst/FunctionDerivativeMissingName1.mo:12:14-12:35:writable] Warning: Derivative annotation for function ‘f1‘ does not specify a derivative function.
// [flattening/modelica/scodeinst/FunctionDerivativeMissingName1.mo:12:14-12:35:writable] Warning: Derivative annotation for function 'f1' does not specify a derivative function.
//
// endResult
Expand Up @@ -21,6 +21,6 @@ end FunctionInverseInvalid1;
// class FunctionInverseInvalid1
// Real x = 3.0;
// end FunctionInverseInvalid1;
// [flattening/modelica/scodeinst/FunctionInverseInvalid1.mo:13:14-13:28:writable] Warning: y = z is not a valid function inverse attribute.
// [flattening/modelica/scodeinst/FunctionInverseInvalid1.mo:13:14-13:28:writable] Warning: 'y = z' is not a valid function inverse attribute.
//
// endResult
Expand Up @@ -27,7 +27,7 @@ end FunctionInverseInvalid2;

// Result:
// Error processing file: FunctionInverseInvalid2.mo
// [flattening/modelica/scodeinst/FunctionInverseInvalid2.mo:13:14-13:38:writable] Error: ‘z‘ is not an input of function ‘f‘.
// [flattening/modelica/scodeinst/FunctionInverseInvalid2.mo:13:14-13:38:writable] Error: 'z' is not an input of function 'f'.
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
Expand Down
Expand Up @@ -29,7 +29,7 @@ end FunctionInverseInvalid3;

// Result:
// Error processing file: FunctionInverseInvalid3.mo
// [flattening/modelica/scodeinst/FunctionInverseInvalid3.mo:15:14-15:43:writable] Error: Invalid inverse annotation for ‘f‘, only functions with exactly one output may have an inverse.
// [flattening/modelica/scodeinst/FunctionInverseInvalid3.mo:15:14-15:43:writable] Error: Invalid inverse annotation for 'f', only functions with exactly one output may have an inverse.
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
Expand Down
Expand Up @@ -17,7 +17,7 @@ end FunctionPartialDerivative2;

// Result:
// Error processing file: FunctionPartialDerivative2.mo
// [flattening/modelica/scodeinst/FunctionPartialDerivative2.mo:15:3-15:17:writable] Error: ‘y‘ in partial derivative of FunctionPartialDerivative2.f does not name an input parameter of the function.
// [flattening/modelica/scodeinst/FunctionPartialDerivative2.mo:15:3-15:17:writable] Error: 'y' in partial derivative of 'FunctionPartialDerivative2.f' does not name an input parameter of the function.
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
Expand Down
Expand Up @@ -17,7 +17,7 @@ end FunctionPartialDerivative3;

// Result:
// Error processing file: FunctionPartialDerivative3.mo
// [flattening/modelica/scodeinst/FunctionPartialDerivative3.mo:13:3-13:26:writable] Error: ‘x‘ in partial derivative of FunctionPartialDerivative3.f is not a scalar Real input parameter of the function.
// [flattening/modelica/scodeinst/FunctionPartialDerivative3.mo:13:3-13:26:writable] Error: 'x' in partial derivative of 'FunctionPartialDerivative3.f' is not a scalar Real input parameter of the function.
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
Expand Down
Expand Up @@ -19,7 +19,7 @@ end ImportInCompositeName1;

// Result:
// Error processing file: ImportInCompositeName1.mo
// [flattening/modelica/scodeinst/ImportInCompositeName1.mo:17:3-17:13:writable] Error: Found imported name MyType while looking up composite name B.MyType.
// [flattening/modelica/scodeinst/ImportInCompositeName1.mo:17:3-17:13:writable] Error: Found imported name 'MyType' while looking up composite name 'B.MyType'.
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
Expand Down
Expand Up @@ -19,7 +19,7 @@ end ImportInCompositeName2;

// Result:
// Error processing file: ImportInCompositeName2.mo
// [flattening/modelica/scodeinst/ImportInCompositeName2.mo:17:3-17:17:writable] Error: Found imported name ‘PI‘ while looking up composite name P2.PI.
// [flattening/modelica/scodeinst/ImportInCompositeName2.mo:17:3-17:17:writable] Error: Found imported name 'PI' while looking up composite name 'P2.PI'.
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
Expand Down
Expand Up @@ -21,7 +21,7 @@ end M;

// Result:
// Error processing file: ImportSubPackage1.mo
// [flattening/modelica/scodeinst/ImportSubPackage1.mo:19:3-19:9:writable] Error: Found imported name ‘A‘ while looking up composite name P1.A.
// [flattening/modelica/scodeinst/ImportSubPackage1.mo:19:3-19:9:writable] Error: Found imported name 'A' while looking up composite name 'P1.A'.
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
Expand Down

0 comments on commit b0c67fe

Please sign in to comment.