Skip to content

Commit a148354

Browse files
test: add instructions for reproducibly building SimpleAdder.fmu
1 parent c8b42eb commit a148354

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SimpleAdder.fmu is a v2 FMU built using OpenModelica. The file `SimpleAdder.mo` contains the
2+
modelica source code for the model. The file `buildFMU.mos` is the OpenModelica script used
3+
to build the FMU.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
block SimpleAdder
2+
parameter Real value = 1.0;
3+
input Real a;
4+
input Real b;
5+
Real c(start = 1.0, fixed = true);
6+
output Real out;
7+
output Real out2;
8+
equation
9+
der(c) = out;
10+
out = a + b + value;
11+
out2 = 2 * c;
12+
end SimpleAdder;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
OpenModelica.Scripting.loadFile("SimpleAdder.mo"); getErrorString();
2+
3+
installPackage(Modelica);
4+
5+
setCommandLineOptions("-d=newInst"); getErrorString();
6+
setCommandLineOptions("-d=initialization"); getErrorString();
7+
setCommandLineOptions("-d=-disableDirectionalDerivatives"); getErrorString();
8+
9+
cd("output"); getErrorString();
10+
buildModelFMU(SimpleAdder, version = "2.0", fmuType = "me_cs"); getErrorString();
11+
system("unzip -l SimpleAdder.fmu | egrep -v 'sources|files' | tail -n+3 | grep -o '[A-Za-z._0-9/]*$' > BB.log")
12+

0 commit comments

Comments
 (0)