Up: Component summary Component

ModelicaCompiler

Compile a Modelica model into binary form using OpenModelica. First, the OpenModelica compiler translates the model into C, which is then compiled into binary using a C compiler. Static model errors are detected at this stage. The compiled model can be simulated with ModelicaSimulator. Compilation and simulation are split into different components to enable faster execution of a model with several parameter sets.

This component has been tested on Linux and OpenModelica 1.5.

Version 0.5
Bundle tools
Categories Pathway
Authors Kristian Ovaska (kristian.ovaska@helsinki.fi)
Issue tracker View/Report issues
Requires OpenModelica ; GCC ; GNU-compatible make
Source files component.xml
Usage Example with default values

Inputs

Name Type Mandatory Description
sourceModel Modelica Mandatory Modelica model in source format. The model may be split into several files: all .mo and .mof source files are compiled into a combined model. If an existing config.ini file is present, it is ignored and overwritten.

Outputs

Name Type Description
binaryModel Modelica Compiled model in binary format, along with a config.ini file. Also, all files present in the sourceModel are present in the binary model as well.
flatModel Modelica Flattened model, under the name ${modelName}.mof.

Parameters

Name Type Default Description
cFlags string "-O2" Additional command-line flags for the C compiler.
compilerCommand string "omc" Path to the OpenModelica compiler.
libraries string "" Comma-separated list of Modelica libraries that need to be loaded. For example, "Modelica,SBLTools" loads the standard Modelica library as well as SBLTools, a utility library bundled with this component. If the root directory of a library contains resources such as *.{a, dll, h, lib, so} files, these are copied to the binary model before C compilation.
makeCommand string "make" Path to the GNU make tool.
modelName string (no default) Name of the main (top level) Modelica class in the model. This determines, among other things, filenames for the makefile and compiled binary.

Test cases

Test case Parameters IN
sourceModel
OUT
binaryModel
OUT
flatModel
case1 properties sourceModel (missing) flatModel

modelName=Main

case2_error properties sourceModel (expecting failure) (expecting failure)

modelName=Main


Generated 2018-12-18 07:42:31 by Anduril 2.0.0