API를 사용하여 젠킨스에서 CLI를 구성하여 아래 f_PSGen.m을 실행하였습니다. 오류가 발생하여, 오류분석 부탁드립니다. | Application Package Repository Telkom University (2024)

■■■■■■■■■■■■■■■■■■■■■ 소스 코드 ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
% f_PSGen
% Abstract: function for Polyspace for Simulink Model Only
%
%%% Syntax
% * [chrBFResult,chrCPResult]=f_SLPSGen(chrModelPath, chrProjectPath)
%
%%% Example
% [chrBFResult,chrCPResult]=f_SLPSGen(chrModelPath, chrProjectPath)
%
%%% Input
% * chrModelPath : Simulink Model Path
% * chrProjectPath : Simulink Project Path
%
%%% Output
% * chrBFResult : Bug Finder Result Path
% * chrCPResult : Code Prover Result Path
%
%%% Copyright
% ————————————————————————-
% Copyright 2023 Consulting Services, The MathWorks, Inc.
% ————————————————————————-

function [chrBFResult,chrCPResult]=f_PSGen(chrModelPath, chrProjectPath,chrLegacyCPath,chrTarget,chrCompiler)
arguments
chrModelPath (1,:) char {mustBeText}
chrProjectPath (1,:) char {mustBeText}
chrLegacyCPath (1,:) char {mustBeText}
chrTarget (1,:) char {mustBeText}
chrCompiler (1,:) char {mustBeText}
end

%Get Current Path for Code Verification
strCurrentPath = fileparts(mfilename(‘fullpath’));
fprintf(‘[PJK] Current path: %sn’, strCurrentPath);

%Incase Simulink model , then set up the code generation folder
if( exist(char(chrModelPath),’file’) && exist(char(chrProjectPath),’file’))
%% Load Simulink Project to get Cach and CodeGen Folder
hdlSimulinkProject = openProject(char(chrProjectPath));
chrCodeGenFolder = hdlSimulinkProject.SimulinkCodeGenFolder;
chrCacheFolder = hdlSimulinkProject.SimulinkCacheFolder;
fprintf(‘[PJK] Simulink project loaded. CodeGenFolder: %s, CacheFolder: %sn’, chrCodeGenFolder, chrCacheFolder);
%%Set Reference Project for Simulink Model
hdlProject = openProject(strCurrentPath);
addReference(hdlProject,fileparts(char(chrProjectPath)),"relative");
hdlProject.SimulinkCacheFolder = chrCacheFolder;
hdlProject.SimulinkCodeGenFolder = chrCodeGenFolder;
reload(hdlProject);
fprintf(‘[PJK] Reference project set. SimulinkCacheFolder: %s, SimulinkCodeGenFolder: %sn’, hdlProject.SimulinkCacheFolder, hdlProject.SimulinkCodeGenFolder);
%Check CodeGen Folder Existing
if( ~exist(chrCodeGenFolder,’dir’) )
chrModelPath = [];
end
else
chrModelPath = [];
end

%% Checking Legacy C Code Path Existing
if( ~exist(char(chrLegacyCPath),’dir’) )
chrLegacyCPath = [];
end

%%Create Polyspace Project & Run
hPSProject = Polyspace.PSProject(chrModelPath,chrLegacyCPath,chrTarget,chrCompiler);
fprintf(‘[PJK] Polyspace project created. ModelPath: %s, LegacyCPath: %s, Target: %s, Compiler: %sn’, chrModelPath, chrLegacyCPath, chrTarget, chrCompiler);
%%Run Polyspace for Bug Finder
[chrBFResult,chrCPResult] = hPSProject.run(Polyspace.PSMode.AllMode);
fprintf(‘[PJK] Polyspace project run. BFResult: %s, CPResult: %sn’, chrBFResult, chrCPResult);
%delete handle
hPSProject.delete();
fprintf(‘[PJK] Polyspace project deleted.n’);
if( exist(char(chrModelPath),’file’) && exist(char(chrProjectPath),’file’))
removeReference(hdlProject,fileparts(char(chrProjectPath)));
hdlProject.SimulinkCacheFolder = ”;
hdlProject.SimulinkCodeGenFolder = ”;
fprintf(‘[PJK] Reference removed. SimulinkCacheFolder: %s, SimulinkCodeGenFolder: %sn’, hdlProject.SimulinkCacheFolder, hdlProject.SimulinkCodeGenFolder);
end

end

■■■■■■■■■■■■■■■■■■■■■ Error Log ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
Generating MATLAB script with content:
cd ‘D:t2-master-work-ModelworkModel’;runAll;

#################### Starting command output ####################
[PolySpace_ICU_SU2idL_FL-ICU-HMID-23-07] $ cmd.exe /C .matlabYJKDTKesrun_matlab_command.bat "cd(‘D:JenkinsworkspacePolySpace_ICU_SU2idL_FL-ICU-HMID-23-07/.matlab/YJKDTKes’);command_lKfQMwWL"
———This MATLAB R2021a Version Supported ————-
[PJK] Current path: D:t2-master-work-ModelworkModelUtilitiesM08
[PJK] Polyspace project created. ModelPath: , LegacyCPath: D:t2-master-work-ModelworkModelLegacyCProjectSU2idL_FL-ICU-HMID-23-07, Target: powerpc, Compiler: greenhills
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
{���� ��� �� ������ �߻���: rmdir
���͸��� ���ŵ��� �ʾҽ��ϴ�.

���� �߻�: Polyspace.PSProject/saveLegacy (45�� ����)
rmdir(chrFolderPath,’s’);

���� �߻�: Polyspace.PSProject/run (63�� ����)
obj.saveLegacy(true);

���� �߻�: f_PSGen (68�� ����)
[chrBFResult,chrCPResult] = hPSProject.run(Polyspace.PSMode.AllMode);

���� �߻�: PSGen (53�� ����)
f_PSGen(tblPSList.ModelPath{index},
tblPSList.ProjectPath{index},tblPSList.LegacyCPath{index},tblPSList.Target{index},tblPSList.Compiler{index}
);

���� �߻�: runAll (8�� ����)
PSGen;

���� �߻�: command_lKfQMwWL (2�� ����)
cd ‘D:t2-master-work-ModelworkModel’;runAll;
}
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
ERROR: MATLAB error Exit Status: 0x00000001
Build step ‘Run MATLAB Command’ changed build result to FAILURE
[PolySpace_ICU_SU2idL_FL-ICU-HMID-23-07] $ cmd /c call C:UsersADMINI~1AppDataLocalTempjenkins10177263456194605002.bat■■■■■■■■■■■■■■■■■■■■■ 소스 코드 ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
% f_PSGen
% Abstract: function for Polyspace for Simulink Model Only
%
%%% Syntax
% * [chrBFResult,chrCPResult]=f_SLPSGen(chrModelPath, chrProjectPath)
%
%%% Example
% [chrBFResult,chrCPResult]=f_SLPSGen(chrModelPath, chrProjectPath)
%
%%% Input
% * chrModelPath : Simulink Model Path
% * chrProjectPath : Simulink Project Path
%
%%% Output
% * chrBFResult : Bug Finder Result Path
% * chrCPResult : Code Prover Result Path
%
%%% Copyright
% ————————————————————————-
% Copyright 2023 Consulting Services, The MathWorks, Inc.
% ————————————————————————-

function [chrBFResult,chrCPResult]=f_PSGen(chrModelPath, chrProjectPath,chrLegacyCPath,chrTarget,chrCompiler)
arguments
chrModelPath (1,:) char {mustBeText}
chrProjectPath (1,:) char {mustBeText}
chrLegacyCPath (1,:) char {mustBeText}
chrTarget (1,:) char {mustBeText}
chrCompiler (1,:) char {mustBeText}
end

%Get Current Path for Code Verification
strCurrentPath = fileparts(mfilename(‘fullpath’));
fprintf(‘[PJK] Current path: %sn’, strCurrentPath);

%Incase Simulink model , then set up the code generation folder
if( exist(char(chrModelPath),’file’) && exist(char(chrProjectPath),’file’))
%% Load Simulink Project to get Cach and CodeGen Folder
hdlSimulinkProject = openProject(char(chrProjectPath));
chrCodeGenFolder = hdlSimulinkProject.SimulinkCodeGenFolder;
chrCacheFolder = hdlSimulinkProject.SimulinkCacheFolder;
fprintf(‘[PJK] Simulink project loaded. CodeGenFolder: %s, CacheFolder: %sn’, chrCodeGenFolder, chrCacheFolder);
%%Set Reference Project for Simulink Model
hdlProject = openProject(strCurrentPath);
addReference(hdlProject,fileparts(char(chrProjectPath)),"relative");
hdlProject.SimulinkCacheFolder = chrCacheFolder;
hdlProject.SimulinkCodeGenFolder = chrCodeGenFolder;
reload(hdlProject);
fprintf(‘[PJK] Reference project set. SimulinkCacheFolder: %s, SimulinkCodeGenFolder: %sn’, hdlProject.SimulinkCacheFolder, hdlProject.SimulinkCodeGenFolder);
%Check CodeGen Folder Existing
if( ~exist(chrCodeGenFolder,’dir’) )
chrModelPath = [];
end
else
chrModelPath = [];
end

%% Checking Legacy C Code Path Existing
if( ~exist(char(chrLegacyCPath),’dir’) )
chrLegacyCPath = [];
end

%%Create Polyspace Project & Run
hPSProject = Polyspace.PSProject(chrModelPath,chrLegacyCPath,chrTarget,chrCompiler);
fprintf(‘[PJK] Polyspace project created. ModelPath: %s, LegacyCPath: %s, Target: %s, Compiler: %sn’, chrModelPath, chrLegacyCPath, chrTarget, chrCompiler);
%%Run Polyspace for Bug Finder
[chrBFResult,chrCPResult] = hPSProject.run(Polyspace.PSMode.AllMode);
fprintf(‘[PJK] Polyspace project run. BFResult: %s, CPResult: %sn’, chrBFResult, chrCPResult);
%delete handle
hPSProject.delete();
fprintf(‘[PJK] Polyspace project deleted.n’);
if( exist(char(chrModelPath),’file’) && exist(char(chrProjectPath),’file’))
removeReference(hdlProject,fileparts(char(chrProjectPath)));
hdlProject.SimulinkCacheFolder = ”;
hdlProject.SimulinkCodeGenFolder = ”;
fprintf(‘[PJK] Reference removed. SimulinkCacheFolder: %s, SimulinkCodeGenFolder: %sn’, hdlProject.SimulinkCacheFolder, hdlProject.SimulinkCodeGenFolder);
end

end

■■■■■■■■■■■■■■■■■■■■■ Error Log ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
Generating MATLAB script with content:
cd ‘D:t2-master-work-ModelworkModel’;runAll;

#################### Starting command output ####################
[PolySpace_ICU_SU2idL_FL-ICU-HMID-23-07] $ cmd.exe /C .matlabYJKDTKesrun_matlab_command.bat "cd(‘D:JenkinsworkspacePolySpace_ICU_SU2idL_FL-ICU-HMID-23-07/.matlab/YJKDTKes’);command_lKfQMwWL"
———This MATLAB R2021a Version Supported ————-
[PJK] Current path: D:t2-master-work-ModelworkModelUtilitiesM08
[PJK] Polyspace project created. ModelPath: , LegacyCPath: D:t2-master-work-ModelworkModelLegacyCProjectSU2idL_FL-ICU-HMID-23-07, Target: powerpc, Compiler: greenhills
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
{���� ��� �� ������ �߻���: rmdir
���͸��� ���ŵ��� �ʾҽ��ϴ�.

���� �߻�: Polyspace.PSProject/saveLegacy (45�� ����)
rmdir(chrFolderPath,’s’);

���� �߻�: Polyspace.PSProject/run (63�� ����)
obj.saveLegacy(true);

���� �߻�: f_PSGen (68�� ����)
[chrBFResult,chrCPResult] = hPSProject.run(Polyspace.PSMode.AllMode);

���� �߻�: PSGen (53�� ����)
f_PSGen(tblPSList.ModelPath{index},
tblPSList.ProjectPath{index},tblPSList.LegacyCPath{index},tblPSList.Target{index},tblPSList.Compiler{index}
);

���� �߻�: runAll (8�� ����)
PSGen;

���� �߻�: command_lKfQMwWL (2�� ����)
cd ‘D:t2-master-work-ModelworkModel’;runAll;
}
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
ERROR: MATLAB error Exit Status: 0x00000001
Build step ‘Run MATLAB Command’ changed build result to FAILURE
[PolySpace_ICU_SU2idL_FL-ICU-HMID-23-07] $ cmd /c call C:UsersADMINI~1AppDataLocalTempjenkins10177263456194605002.bat■■■■■■■■■■■■■■■■■■■■■ 소스 코드 ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
% f_PSGen
% Abstract: function for Polyspace for Simulink Model Only
%
%%% Syntax
% * [chrBFResult,chrCPResult]=f_SLPSGen(chrModelPath, chrProjectPath)
%
%%% Example
% [chrBFResult,chrCPResult]=f_SLPSGen(chrModelPath, chrProjectPath)
%
%%% Input
% * chrModelPath : Simulink Model Path
% * chrProjectPath : Simulink Project Path
%
%%% Output
% * chrBFResult : Bug Finder Result Path
% * chrCPResult : Code Prover Result Path
%
%%% Copyright
% ————————————————————————-
% Copyright 2023 Consulting Services, The MathWorks, Inc.
% ————————————————————————-

function [chrBFResult,chrCPResult]=f_PSGen(chrModelPath, chrProjectPath,chrLegacyCPath,chrTarget,chrCompiler)
arguments
chrModelPath (1,:) char {mustBeText}
chrProjectPath (1,:) char {mustBeText}
chrLegacyCPath (1,:) char {mustBeText}
chrTarget (1,:) char {mustBeText}
chrCompiler (1,:) char {mustBeText}
end

%Get Current Path for Code Verification
strCurrentPath = fileparts(mfilename(‘fullpath’));
fprintf(‘[PJK] Current path: %sn’, strCurrentPath);

%Incase Simulink model , then set up the code generation folder
if( exist(char(chrModelPath),’file’) && exist(char(chrProjectPath),’file’))
%% Load Simulink Project to get Cach and CodeGen Folder
hdlSimulinkProject = openProject(char(chrProjectPath));
chrCodeGenFolder = hdlSimulinkProject.SimulinkCodeGenFolder;
chrCacheFolder = hdlSimulinkProject.SimulinkCacheFolder;
fprintf(‘[PJK] Simulink project loaded. CodeGenFolder: %s, CacheFolder: %sn’, chrCodeGenFolder, chrCacheFolder);
%%Set Reference Project for Simulink Model
hdlProject = openProject(strCurrentPath);
addReference(hdlProject,fileparts(char(chrProjectPath)),"relative");
hdlProject.SimulinkCacheFolder = chrCacheFolder;
hdlProject.SimulinkCodeGenFolder = chrCodeGenFolder;
reload(hdlProject);
fprintf(‘[PJK] Reference project set. SimulinkCacheFolder: %s, SimulinkCodeGenFolder: %sn’, hdlProject.SimulinkCacheFolder, hdlProject.SimulinkCodeGenFolder);
%Check CodeGen Folder Existing
if( ~exist(chrCodeGenFolder,’dir’) )
chrModelPath = [];
end
else
chrModelPath = [];
end

%% Checking Legacy C Code Path Existing
if( ~exist(char(chrLegacyCPath),’dir’) )
chrLegacyCPath = [];
end

%%Create Polyspace Project & Run
hPSProject = Polyspace.PSProject(chrModelPath,chrLegacyCPath,chrTarget,chrCompiler);
fprintf(‘[PJK] Polyspace project created. ModelPath: %s, LegacyCPath: %s, Target: %s, Compiler: %sn’, chrModelPath, chrLegacyCPath, chrTarget, chrCompiler);
%%Run Polyspace for Bug Finder
[chrBFResult,chrCPResult] = hPSProject.run(Polyspace.PSMode.AllMode);
fprintf(‘[PJK] Polyspace project run. BFResult: %s, CPResult: %sn’, chrBFResult, chrCPResult);
%delete handle
hPSProject.delete();
fprintf(‘[PJK] Polyspace project deleted.n’);
if( exist(char(chrModelPath),’file’) && exist(char(chrProjectPath),’file’))
removeReference(hdlProject,fileparts(char(chrProjectPath)));
hdlProject.SimulinkCacheFolder = ”;
hdlProject.SimulinkCodeGenFolder = ”;
fprintf(‘[PJK] Reference removed. SimulinkCacheFolder: %s, SimulinkCodeGenFolder: %sn’, hdlProject.SimulinkCacheFolder, hdlProject.SimulinkCodeGenFolder);
end

end

■■■■■■■■■■■■■■■■■■■■■ Error Log ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
Generating MATLAB script with content:
cd ‘D:t2-master-work-ModelworkModel’;runAll;

#################### Starting command output ####################
[PolySpace_ICU_SU2idL_FL-ICU-HMID-23-07] $ cmd.exe /C .matlabYJKDTKesrun_matlab_command.bat "cd(‘D:JenkinsworkspacePolySpace_ICU_SU2idL_FL-ICU-HMID-23-07/.matlab/YJKDTKes’);command_lKfQMwWL"
———This MATLAB R2021a Version Supported ————-
[PJK] Current path: D:t2-master-work-ModelworkModelUtilitiesM08
[PJK] Polyspace project created. ModelPath: , LegacyCPath: D:t2-master-work-ModelworkModelLegacyCProjectSU2idL_FL-ICU-HMID-23-07, Target: powerpc, Compiler: greenhills
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
{���� ��� �� ������ �߻���: rmdir
���͸��� ���ŵ��� �ʾҽ��ϴ�.

���� �߻�: Polyspace.PSProject/saveLegacy (45�� ����)
rmdir(chrFolderPath,’s’);

���� �߻�: Polyspace.PSProject/run (63�� ����)
obj.saveLegacy(true);

���� �߻�: f_PSGen (68�� ����)
[chrBFResult,chrCPResult] = hPSProject.run(Polyspace.PSMode.AllMode);

���� �߻�: PSGen (53�� ����)
f_PSGen(tblPSList.ModelPath{index},
tblPSList.ProjectPath{index},tblPSList.LegacyCPath{index},tblPSList.Target{index},tblPSList.Compiler{index}
);

���� �߻�: runAll (8�� ����)
PSGen;

���� �߻�: command_lKfQMwWL (2�� ����)
cd ‘D:t2-master-work-ModelworkModel’;runAll;
}
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
ERROR: MATLAB error Exit Status: 0x00000001
Build step ‘Run MATLAB Command’ changed build result to FAILURE
[PolySpace_ICU_SU2idL_FL-ICU-HMID-23-07] $ cmd /c call C:UsersADMINI~1AppDataLocalTempjenkins10177263456194605002.bat젠킨스, cli, 오류MATLAB Answers — New Questions

API를 사용하여 젠킨스에서 CLI를 구성하여 아래 f_PSGen.m을 실행하였습니다. 오류가 발생하여, 오류분석 부탁드립니다. | Application Package Repository Telkom University (2024)

References

Top Articles
Latest Posts
Article information

Author: Clemencia Bogisich Ret

Last Updated:

Views: 5975

Rating: 5 / 5 (60 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Clemencia Bogisich Ret

Birthday: 2001-07-17

Address: Suite 794 53887 Geri Spring, West Cristentown, KY 54855

Phone: +5934435460663

Job: Central Hospitality Director

Hobby: Yoga, Electronics, Rafting, Lockpicking, Inline skating, Puzzles, scrapbook

Introduction: My name is Clemencia Bogisich Ret, I am a super, outstanding, graceful, friendly, vast, comfortable, agreeable person who loves writing and wants to share my knowledge and understanding with you.