FMU generated by Matlab 2024b shows Matlab shared library dependencies

11 ビュー (過去 30 日間)
Jose
Jose 2025 年 6 月 30 日
回答済み: Kautuk Raj 2025 年 7 月 3 日
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?

回答 (1 件)

Kautuk Raj
Kautuk Raj 2025 年 7 月 3 日
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

カテゴリ

Help Center および File ExchangeDeploy Standalone Applications についてさらに検索

タグ

製品


リリース

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by