This repository is a community continuation of NTNU-IHB/FMI4j, with a practical focus on keeping the FMI4j import runtime usable in modern JVM applications across multiple native platforms.
The original FMI4j project has been archived by its author. This fork keeps the original codebase and license intact, while adding reproducible native runtime builds, packaging notes, and examples for current Java/Spring Boot digital twin projects.
Fork maintainer:
- Generoso Lombardi - creator and technical director of the SinergIA project
Initial maintenance focus:
- macOS ARM64
- macOS x86_64
- macOS universal
darwin64runtime - Windows x86_64
- Windows ARM64
- Linux x86_64
- Linux ARM64
The first concrete goal is to make the fmi-import native JNI library available
for the architectures above without requiring each user to patch the runtime JAR
manually.
| Area | Status |
|---|---|
| Original FMI4j import API | Preserved |
| Original FMI4j model description API | Preserved |
| macOS ARM64 native runtime | Documented, script foundation added |
| macOS x86_64 native runtime | Documented, script foundation added |
| macOS universal runtime | Documented, script foundation added |
| Windows x86_64 runtime | Existing upstream support, to be repackaged |
| Windows ARM64 runtime | Verified native runtime included |
| Linux x86_64 runtime | Existing upstream support, to be repackaged |
| Linux ARM64 runtime | Verified native runtime included |
| Maven Central publication | Planned |
| Example JVM/Spring Boot FMU loader | Added |
- Native runtime build guide
- macOS universal runtime guide
- Linux ARM64 runtime guide
- Windows ARM64 runtime guide
- GitHub Packages publication guide
- Roadmap
- GitHub repository setup checklist
- Announcement and outreach text
scripts/build-macos-universal.shscripts/package-runtime-jar.shscripts/build-linux-aarch64.shscripts/build-windows-arm64.bat
The scripts are intentionally small and explicit. They are meant to make the native runtime packaging process inspectable before it is automated further with CI.
fmi
fmu
fmi4j
fmi-standard
fmi2
co-simulation
java
kotlin
jni
digital-twin
openmodelica
macos-arm64
apple-silicon
multiplatform
linux-arm64
linux-aarch64
windows-arm64
windows-aarch64
The original project description follows.
FMI4j is a software package for dealing with Functional Mock-up Units (FMUs) on the Java Virtual Machine (JVM), written in Kotlin.
FMI4j supports import of both FMI 1.0 and 2.0 for Co-simulation. For Model Exchange version 2.0 is supported.
Compared to other FMI libraries targeting the JVM, FMI4j is considerably faster due to the fact that we use JNI instead of JNA. Considering FMI-import, a significant speedup (2-5x) compared to other open-source FMI implementations for the JVM should be expected.
Maven artifacts are available through Central
class Demo {
void main(String[] args) {
Fmu fmu = Fmu.from(new File("path/to/fmu.fmu")); //URLs are also supported
FmuSlave slave = fmu.asCoSimulationFmu().newInstance();
slave.simpleSetup();
double t = 0;
double stop = 10;
double stepSize = 1.0/100;
while(t <= stop) {
if (!slave.doStep(t, stepSize)) {
break;
}
t += stepSize;
}
slave.terminate(); //or close, try with resources is also supported
fmu.close();
}
}Would you rather build FMUs using a JVM language? Check out FMU4j!
Or maybe build FMUs using Python? Check out PythonFMU!
Or would you rather simulate FMUs using C++? Check out FMI4cpp!
Need to distribute your FMUs? FMU-proxy to the rescue!
Need a complete co-simulation framework with SSP support? Check out Vico