FMU generated by Matlab 2024b shows Matlab shared library dependencies

조회 수: 17 (최근 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 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