FMU generated by Matlab 2024b shows Matlab shared library dependencies

17 vues (au cours des 30 derniers jours)
Jose
Jose le 30 Juin 2025
Hi there,
I have been given an FMU generated by Simulink (Matlab 2024). This is Co-Simulation.
In the past I managed to call the generated FMU from c++ in Linux.
However I received a new FMU which shows the following shared libraries needed when running "readelf -d fmu_library.so"
0x0000000000000001 (NEEDED) Shared library: [libmwsl_cosim_service_deploy.so]
0x0000000000000001 (NEEDED) Shared library: [libmwi18n.so]
0x0000000000000001 (NEEDED) Shared library: [libmwfl.so]
0x0000000000000001 (NEEDED) Shared library: [libmwfoundation_filesystem.so]
0x0000000000000001 (NEEDED) Shared library: [libmex.so]
0x0000000000000001 (NEEDED) Shared library: [libmx.so]
0x0000000000000001 (NEEDED) Shared library: [libmat.so]
0x0000000000000001 (NEEDED) Shared library: [libmwsl_services.so]
0x0000000000000001 (NEEDED) Shared library: [libmwboost_system.so.1.81.0]
0x0000000000000001 (NEEDED) Shared library: [libmwcpp11compat.so]
0x0000000000000001 (NEEDED) Shared library: [libpthread.so.0]
0x0000000000000001 (NEEDED) Shared library: [libstdc++.so.6]
0x0000000000000001 (NEEDED) Shared library: [libgcc_s.so.1]
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
It was my understanding that Matlab-generated FMUs don't require external dependencies but I can see libmex.so and libmat.so which I guess they are Matlab dependencies. Does it mean I need to install the SDK with the dependencies?

Réponses (1)

Kautuk Raj
Kautuk Raj le 3 Juil 2025
Hello @Jose,
Yes, you need the MATLAB/Simulink shared libraries available at runtime.
This is a change from older FMU exports, which often produced "standalone" binaries with all dependencies statically linked or minimal system dependencies.
In your MATLAB installation, make sure the bin/glnxa64 (or similar) directory containing these .so files is in your LD_LIBRARY_PATH.
For deployment without a full MATLAB, you can use MATLAB Runtime: https://www.mathworks.com/products/compiler/matlab-runtime.html
Please refer to the following documentation page from MathWorks from more details: https://www.mathworks.com/help/slcompiler/gs/export-simulink-models-to-functional-mock-up-units.html

Catégories

En savoir plus sur Deploy Standalone Applications dans Help Center et File Exchange

Tags

Produits


Version

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by