FMU stands for Functional Mockup Unit and FMI for Functional Mockup Interface. The latter is an industry standard for simulation model runtime coupling, and basically defines an API and a meta data description file and directory structure: see FMI-Standard webpage for details.
When you want an efficient/fast FMU slave, there's probably no way around a native C/C++ implementation. However, implementing the C interface functions, the data handling, input/output variable handling and advanced features like saving and restoring the FMU state is not so simple and straight-forward.
However, the process of setting up the FMU (core files, modelDescription.xml, directory structure) is pretty similar for most projects and can be automated with a configurable code generator - hence this project.
This is not a Software Development Library/Toolkit for accessing/supporting the FMI interface. Look at the FMU SDK or other projects on fmi-tools if you need something like that.
Actually, the code generated by FMI Code Generator hides most of the messy FMI C function interface (including most of the memory management related to instantiating/deleting slave instances, and the state storage stuff) from the typical (engineering) user. Also, the generated code is pretty small, easy to read and comprehend and works cross-platform without any library setup issues.
I'm working with FMI since 2009, and also authored the co-simulation master tool MasterSim. I'm doing quite a lot of other stuff as well, see my blog page Schneggenport.
FMUs generated with the FMI Code Generator and run with MasterSim allow for very efficient simulation coupling (even real-time applications), so give it a try!
See description of Test scenario: Stateless P-controller for a step-by-step tutorial.
A general description of the software, the installation and and how to use it, can be found on the project's webpage.
The FMICodeGenerator is provided under a BSD 3-Clause License.
See AGENTS.md for a summary.

