Skip to content

Load FMI 1.0/2.0 binaries from FMI 3.0 platform-tuple directories - #884

Open
topolarity wants to merge 1 commit into
CATIA-Systems:mainfrom
topolarity:ct/fmi2-aarch64
Open

Load FMI 1.0/2.0 binaries from FMI 3.0 platform-tuple directories#884
topolarity wants to merge 1 commit into
CATIA-Systems:mainfrom
topolarity:ct/fmi2-aarch64

Conversation

@topolarity

@topolarity topolarity commented Jul 14, 2026

Copy link
Copy Markdown

Resolves #395.

From the FMI 2.0.5 spec:

The following names are standardized: for Windows: “win32”, “win64”, for Linux: “linux32”, “linux64”, for Macintosh: “darwin32”, “darwin64”, where "32" stands for "32-bit x86" and "64" for "64-bit x86" respectively.

For any other platforms the "platform tuples" defined in the FMI 3.0 Specification, 2.5.1.4.1. Platform Tuple Definition, or any updated "platform tuples" published by MAP FMI on fmi-standard.org, should be used.

This extends the work done in #636 which applied to FMIv3 and fmi_info()/dump()/validate_fmu() but not the FMI 1.0 / 2.0 loader. As a bonus, add support for Windows AArch64 and Linux AArch64.

Note that the supported_platforms() returns e.g. darwin64 even for aarch64-darwin which can cause platform checks to incorrectly pass on these platforms (e.g. when trying to run an x86-64 FMU on AArch64). However #636 has the same problem and fixing it touches quite a few more lines, so I left it as future work for now.

The patch set was generated with Claude Fable 5, after which I reviewed the changes in full.

FMI 2.0 only defines platform names for x86 and x86-64 (win32/win64,
linux32/linux64, darwin32/darwin64). On other architectures - notably
Apple Silicon - exporters follow the FMI project's recommendation and
place the binaries under the FMI 3.0 platform tuple instead (e.g.
binaries/aarch64-darwin). fmi_info()/dump()/validate_fmu() already
recognize these directories since CATIA-Systems#636, but the FMI 1.0/2.0 loader
still resolved the shared library exclusively via the legacy platform
name, so such FMUs failed to instantiate with "Cannot find shared
library ... binaries/darwin64/...".

Also teach supported_platforms() about aarch64-linux and
aarch64-windows binaries, mirroring what CATIA-Systems#636 did for aarch64-darwin,
so simulate_fmu()'s platform check accepts such FMUs on matching hosts.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for ARM platforms

1 participant