script with compiler.build.productionServerArchive returns success in MATLAB, Production Server Compiler App Test Client, but return failed using deployed archive in MPS
Show older comments
function [ret_createCTFFunctionbyMPSLib] = createCTFFunctionByMPSLib(mFile)
% % to create a ctf service that takes a mfile and convert to a ctf
% if exist(mFile, 'file') ~= 2
if ~exist('mFile', 'var') || isempty('mFile')
mFile = '.\data\mymagic.m';
end
if ~exist(mFile, 'file')
fprintf('Source %s does not exist\n', mFile);
ret_createCTFFunctionbyMPSLib = 'Source '+mFile+'does not exist\n';
return;
end
% Define the name of the output CTF
% archiveName = 'GeneratedCTF'; % Changed to GeneratedCTF
% Define the path to the function to be included
% functionFiles = 'mymagic.m'; % Add all required function files here
appFile = which('mymagic.m');
% Create options for the production server archive
% options = compiler.build.ProductionServerArchiveOptions;
% Set options (if needed)
% options.AdditionalFiles = {'C:\A2AM ProdSrvFunctionSignatures.json'}; % Include additional files as needed
% options.OutputDir = '.\output_liboption'; % Specify output directory
% options.UseCodeGeneration = true; % Enable code generation if required
% Create the production server archive
try
% Build the archive
compiler.build.productionServerArchive(appFile);
disp('CTF created successfully.');
ret_createCTFFunctionbyMPSLib = 'success'; % Set ret val to success
catch ME
disp('Error creating CTF:');
disp(ME.message);
ret_createCTFFunctionbyMPSLib = 'Failed'; % Set ret val to failed
end
end
Accepted Answer
More Answers (0)
Categories
Find more on MATLAB Production Server 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!