FMU generated by Matlab 2024b shows Matlab shared library dependencies

17 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Deploy Standalone Applications 的更多信息

标签

产品


版本

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by