Skip to content

About

Modelica C Compiler implemented in C++ to develop and test novel algorithms for large scale models.

Topics

Resources

Stars

21 stars

Watchers

7 watching

Forks

Repository files navigation

ModelicaCC 5.2

ModelicaCC is a Modelica C Compiler implemented in C++, the main goal of this project is to provide an environment to develop and test novel algorithms involved in the different compilation stages of large scale Modelica models. The different stages of the compilation pipeline follows the usual order:

  • Parsing
  • Flattening
  • Index Reduction
  • Sorting
  • Code Generation
  • Model Simulation

The input/output of each stage are valid Modelica models (except for the very last stage which produce C code). Each stage converts the Modelica model fed as input into a “simpler” equivalent one. As the compiler uses the QSS Solver for the C code generation and simulation, the goal of the previous stages is to obtain a valid μ–Modelica model.

The following tools are generated:

  • parser
  • antialias
  • flatter
  • causalize
  • mmo

Related Publications

[1] Federico Bergero, Mariano Botta, Esteban Campostrini, Ernesto Kofman. Efficient Compilation of Large Scale Dynamical Systems Proceedings of the 11th International Modelica Conference 2015

[2] Pablo Zimmermann, Joaquin Fernandez, Ernesto Kofman. Set-based graph methods for fast equation sorting in large DAE systems EOOLT '19: Proceedings of the 9th International Workshop on Equation-based Object-oriented Modeling Languages and Tools 2019

[3] Denise Marzorati, Joaquín Fernández, and Ernesto Kofman. 2024. Efficient Matching in Large DAE Models. ACM Trans. Math. Softw. Just Accepted (June 2024). https://doi.org/10.1145/3674831

[4] Denise Marzorati, Joaquin Fernández, Ernesto Kofman. Connected Components in Undirected Set--Based Graphs. Applications in Object--Oriented Model Manipulation Applied Mathematics and Computation, Volume 418, 2022, 126842,ISSN 0096-3003, https://doi.org/10.1016/j.amc.2021.126842.

[5] Ernesto Kofman, Joaquín Fernández, Denise Marzorati. Compact sparse symbolic Jacobian computation in large systems of ODEs Applied Mathematics and Computation, Volume 403, 2021, 126181, ISSN 0096-3003, https://doi.org/10.1016/j.amc.2021.126181.

Installation

These are generic installation instructions.

Dependencies

In order to be able to install and compile ModelicaCC, the following dependencies must be installed:

* boost1.81
* cmake
* g++
* libginac-dev 
* make     
* SBG

Basic Installation

The simplest way to compile this package is to run the following commands from the library root directory (${MODELICACC_ROOT_DIR}):

  1. mkdir build

  2. cd build

  3. cmake ..

    Note that by default the biuld type is set to Release, to make a debug build, add -DCMAKE_BUILD_TYPE=Debug

  4. make

  5. You can remove the generated library and object files from the source code directory by typing make clean-all.

Makefile targets

The makefile script accepts the following targets:

  • doc: builds the documentation.

To list all the available targets run make help.

Changelog

[5.2] - 2026-10-16

Fixed

  • Fixed compilation of SBG legacy library version for flatter algorithms

Detailed instructions of how to run benchmark causalization tests can be found in:

{MCC_ROOT}/test/causalize/RLTest/README.md

[5.1] - 2026-10-14

Added

  • Added README to run causalization test benchmarks.

Fixed

  • Modified omc causalization scripts to use the new backend and report times from dumpBackendClocks compiler option.
  • Fixed tearing option for causalization binary.

[5.0] - 2026-07-13

Added

  • Integrate SCC SBG library algorithm for causalization.
  • Generate Modelica code to solve algebraic loops.

Licensing

Please see the file called LICENSE.

Bug Reporting

Report bugs to: fernandez@cifasis-conicet.gov.ar

About

Modelica C Compiler implemented in C++ to develop and test novel algorithms for large scale models.

Topics

Resources

Stars

21 stars

Watchers

7 watching

Forks

Releases

Packages

Used by

Contributors

Languages