How to deploy large library as multiple executables?

7 views (last 30 days)
We have a large library of "core" MATLAB code as well as multiple "top level" MATLAB functions that make use of the core. I have been tasked with making these top level MATLAB functions available as executables. I started using mcc to generate the required executable files and they work, but the generated executable files are very large and take a very long time to build. Each of the top level functions uses a large part of the core library (and the core is huge) so most of the core is being included in each executable. Eventually we will have dozens of executables and I would like to avoid an hour long build process.
I experimented with using mcc to create shared libraries of the core and then using those DLLs in the top level functions. I stopped because I could not get the libraries to load using loadlibrary. Assuming I can get loadlibrary to work, is this even the right approach to this problem? I want the developers to be able to work in pure MATLAB (rather than using the DLLs) so they can work faster. To do this, would I wrap the calls to loadlibrary in a check of isdeployed?
  5 Comments
Stuart
Stuart on 8 Jan 2018
Edited: Stuart on 8 Jan 2018
We need to make the functionality available to third parties without making the code available to them. Using pcode is an option, but the Mathworks documentation states It is not recommended that you P-code files to protect your intellectual property.
Thanks for pointing out the limitation in loadlibrary. Is there a better overall solution to this problem?
Walter Roberson
Walter Roberson on 8 Jan 2018
One approach to achieve separation would be a client-server architecture.
Possibly using MATLAB Coder to generate C code might help speed the process, in that at least in theory the makefile could detect the C was already compiled to object.

Sign in to comment.

Answers (0)

Categories

Find more on C Shared Library Integration in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!