The Docker image used to cross compile OpenModelica FMUs from Linux to target platforms and create multi-platform FMUs.
| Toolchain file | OS | C | Note |
|---|---|---|---|
| i686-linux-gnu | x86-64 Linux 32-bit | i686-linux-gnu-gcc | |
| x86_64-linux-gnu | x86-64 Linux 64-bit | gcc -m64 | |
| aarch64-linux-gnu | AArch64 Linux 64-bit | aarch64-linux-gnu-gcc | |
| arm-linux-gnueabi | ARM Linux 32-bit | arm-linux-gnueabi-gcc | |
| arm-linux-gnueabihf | ARM Linux 32-bit | arm-linux-gnueabihf-gcc | hard-float |
| i686-w64-mingw32 | x86-64 Windows 32-bit | i686-w64-mingw32-gcc | MINGW |
| x86_64-w64-mingw32 | x86-64 Windows 64-bit | x86_64-w64-mingw32-gcc | MINGW |
The cross compilation image is versioned together with the version number of
OpenModelica. So OpenModelica v1.26.0 expects to use this image with tag
v1.26.0 for cross compiling Linux and Windows.
export TAG=v1.26.0
docker build --pull --no-cache --tag crossbuild:$TAG .cd path/to/FMU/sources/
cmake -S . -B build_win32 -DCMAKE_TOOLCHAIN_FILE=/opt/cmake/toolchain/i686-w64-mingw32.cmake
cmake --build build_win32 --target create_fmucd path/to/FMU/sources/
cmake -S . -B build_win64 -DCMAKE_TOOLCHAIN_FILE=/opt/cmake/toolchain/x86_64-w64-mingw32.cmake
cmake --build build_win64 --target create_fmucd path/to/FMU/sources/
cmake -S . -B build_linux32 -DCMAKE_TOOLCHAIN_FILE=/opt/cmake/toolchain/i686-linux-gnu.cmake
cmake --build build_linux32 --target create_fmucd path/to/FMU/sources/
cmake -S . -B build_linux64 -DCMAKE_TOOLCHAIN_FILE=/opt/cmake/toolchain/x86_64-linux-gnu.cmake
cmake --build build_linux64 --target create_fmuThe publish.yml workflow will build, sign and upload the Docker image to GitHub container registry for each release.
The build.yml workflow uploads all tested image versions to GitHub container registry.
Caution
Only download and run images you trust.
You can use cosign to verify the keyless signature from
publish.yml:
export TAG=v1.26.0
cosign verify ghcr.io/openmodelica/crossbuild:$TAG \
--certificate-identity=https://github.com/OpenModelica/openmodelica-crossbuild/.github/workflows/publish.yml@refs/tags/$TAG \
--certificate-oidc-issuer=https://token.actions.githubusercontent.comThis repository is part of OpenModelica and licensed with
OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.8, see
./OSMC-License.txt.