Matlab runtime should provide static libraries instead of shared libraries

조회 수: 4 (최근 30일)
Jason
Jason 2017년 8월 20일
답변: Jan 2017년 8월 20일
Currently Matlab runtime packages it's libraries as shared libraries and dump it inside MATLAB_Runtime/vXX/bin/glnxa64/ along with other shared libraries it depends with. This is a big problem because the shared libraries it depends with often exist in the system already in /usr/lib, just to name a few, libtiff.so.5, libtbb.so.2. Therefore, when I compile my application that intends to use matlab runtime, I had to add MATLAB_Runtime/vXX/bin/glnxa64/ into RPATH in order to link to them. However, this causes compilation error when I am linking to another external library (in my case OpenCV) that was compiled with the libtiff.so.5, libtbb.so.2 in /usr/lib, because my application is now linking to libtiff.so.5, libtbb.so.2 in MATLAB_Runtime/vXX/bin/glnxa64/.
Making a copy of the shared libraries that you depend with and distribute it is always a bad idea. I see two ways to solve this.
1. distribute matlab runtime as static libraries instead of shared libraries, this is probably the most effortless way for mathworks to make it happen.
2. create a matlab runtime deb file that has the build-depends section that is dependent on the libraries from the ubuntu distros, this is probably the most ideal way but will require more effort from mathworks.
Please consider to make these changes, I will appreciate it. Thanks.

답변 (1개)

Jan
Jan 2017년 8월 20일
This is the public Matlab forum, where other Matlab users post answers in general. We cannot change the way Matlab produces libraries. If you want to contact MathWorks officially, please use the "Contact Us" button on this page.

카테고리

Help CenterFile Exchange에서 C Shared Library Integration에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by