how to compile a FMU on windows to be used in Mac?

602 views Asked by At

I have generated one FMU on Windows, and imported the FMU on Mac using Matlab Simulink, and got the following error. I searched for the problem and get some clues from the answer here https://tomlankhorst.nl/quick-fix-matlab-fmu-import-error/, it seems like FMU will be stored as different form when generated on Windows and Mac.

the question is: is it possible to generate a FMU on windows that still works on Mac.

enter image description here

1

There are 1 answers

2
sjoelund.se On BEST ANSWER

In order to compile for MacOS, you need the C headers for the MacOS platform. These are only available in XCode which only runs on MacOS and the headers themselves are not allowed to be redistributed.

As such, it's pretty hard to cross-compile for MacOS. You can install XCode on your Mac, move the required headers to your system and compile a Darwin toolchain on your Windows machine (I believe), but it's very error-prone and annoying to update for newer MacOS versions.

The easiest way would be to run MacOS and cross-compile Windows+Linux binaries since these platforms are less closed.

Or like @matth commented, generate a source-code FMU and compile that using the native toolchain on any platform you need.