Can I use production server to create ctf file and do I need to install matlab compiler sdk along with production server to achieve this?

4 views (last 30 days)
I wrote a matlab script which contains command 'mcc' and the options to create the ctf in my local machine. The script runs correctly with the ctf created. However, when I deployed the codes on the production server, the command mcc cannot be executed. My local computer has both matlab compiler and matlab compiler sdk installed. It looks like the production server has matlab runtime running, maybe matlab compiler. But definitely no matlab compiler sdk. So should I install matlab compiler sdk on the same server as the production server? After installation, how do I tell the production server where to find the matlab compiler sdk and the command of "mcc"?

Accepted Answer

Aniket
Aniket on 7 Oct 2024
Edited: Aniket on 7 Oct 2024
To answer your first question regarding requirements for running the "mcc" command, consider the following points:
  1. mccis part of the MATLAB Compiler, which is required to compile MATLAB code into standalone applications or shared libraries and should be installed on the production server.
  2. The MATLAB Compiler SDK is used for creating components that can be integrated into other applications but is not necessary just for using "mcc".
  3. The MATLAB Runtime/ MATLAB Compiler Runtime (MCR) is used only for running the compiled applications and thus alone it is not sufficient for compiling code.
For the second question regarding on how to tell the production server where to find the MATLAB Compiler and the command of "mcc", kindly follow the below steps:
  1. Add the MATLAB installation directory (C:\Program Files\MATLAB\R2024a\bin) to your system's PATH environment variable. This directory typically contains the "mcc" executable.
  2. Ensure MATLAB Runtime path is also set. Please follow the steps mentioned in the below link to set the path: https://www.mathworks.com/help/compiler/mcr-path-settings-for-run-time-deployment.html
  3. Once the MATLAB Compiler is installed and the environment variables are set, verify that "mcc" can be executed by running mcc from the command line.
Refer to the following MATLAB Answer for more information on MATLAB Production Server and Compiler:
Hope this helps to resolve the issue!

More Answers (1)

Sanjana
Sanjana on 8 Oct 2024
Hi,
The deployed code runs using MATLAB Runtime on server machine where MATLAB Production server is installed.To compile and generate a CTF file using the mcc command, you would require to MATLAB Compiler and MATLAB Compiler SDK.
The purpose of the MATLAB Production Server is to run MATLAB code on a dedicated server, serving as a backend for other applications. This allows clients to interact with running instances at various endpoints.There by, MATLAB Compiler and MATLAB Compiler SDK is not advisable to be installed in MPS.
If you wish to compile MATLAB Code and deploy the ctf file on the fly outside of your local machine, you can use a MATLAB instance on cloud to generate ctf in a folder montiored by MPS. Both MPS and MATLAB can be installed on the same machine.
Hope this helps!
  1 Comment
Biyan Li
Biyan Li on 8 Oct 2024
Using mcc and its corresponding ctf options might not be an elegant way or even a feasible way to create ctf on production server. However I think there might still be a better programmatically way to do it, for example: compiler.build.productionServerArchive. This might be my next experiment. If you or anyone in this forum happen to have experience with using this compiler.build.productionServerArchive to create the depolyable archive for MPS, and could share the experience, lesson learned and insight, that would be most appreciated.

Sign in to comment.

Categories

Find more on Get Started with MATLAB Compiler SDK 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!