Nigel Davies
Nigel Davies

Reputation: 1690

How to debug a MATLAB deploytool project that works in MATLAB but fails at the command line?

I have a deploytool project that compiles and packages a MATLAB command line application correctly to an windows 64 installable exe if I run deploytool inside MATLAB. The packaging process also works correctly if I build inside the MATLAB deploytool GUI.

If I run the deploytool from the Windows command line, the same project correctly builds the application, with the results in the for_testing folder, but fails to create the installable image with the error message, "Package failed", but no further information. I cannot find a log file or any other data to help resolve the problem.

Please help.

I am using MATLAB R2014a under 64 bit Windows 7.

Here is the output from inside MATLAB (which is the same for deploytool or applicationcompiler). what is slightly odd is that the MATLAB command prompt comes back after the mcc line, event though the process is still running, as though it is running in the background:

>> applicationCompiler -package nam_converter.prj
Some of the build deliverables are missing. Rebuilding the project.
ant:

<ant>

  <mkdir dir="C:\Users\ndavies\Documents\matlab_utilities\nam_converter\nam_converter\for_redistribution" />

  <mkdir dir="C:\Users\ndavies\Documents\matlab_utilities\nam_converter\nam_converter\for_testing" />

</ant>
mcc -C -o nam_converter -W main:nam_converter -T link:exe -d C:\Users\ndavies\Documents\matlab_utilities\nam_converter\nam_converter\for_testing -R '-logfile,nam_converter.log' -v C:\Users\ndavies\Documents\matlab_utilities\nam_converter\nam_converter.m 
Compiler version: 5.1 (R2014a)
Dependency analysis by REQUIREMENTS.
Warning: Duplicate directory name: C:\Program
Files\MATLAB\R2014a\toolbox\matlab\winfun\NET 
> In path at 33
  In requirements at 156 
Warning: Duplicate directory name: C:\Program
Files\MATLAB\R2014a\toolbox\rtw\targets\AUTOSAR\AUTOSAR 
> In path at 33
  In requirements at 156 
Warning: Duplicate directory name: C:\Program
Files\MATLAB\R2014a\toolbox\rtw\targets\AUTOSAR\AUTOSAR\dataclasses 
> In path at 33
  In requirements at 156 
Warning: Duplicate directory name: C:\Program
Files\MATLAB\R2014a\toolbox\simulink\simulink\MPlayIO 
> In path at 33
  In requirements at 156 
Warning: Duplicate directory name: C:\Program
Files\MATLAB\R2014a\toolbox\slvnv\reqmgt\RTExplorer 
> In path at 33
  In requirements at 156 
[Warning: Adding path
"C:\Users\ndavies\Documents\matlab_utilities\nam_converter" to Compiler path
instance. 
Parsing file "C:\Users\ndavies\Documents\matlab_utilities\nam_converter\nam_converter.m"
  (Referenced from: "Compiler Command Line").
Parsing file "C:\Program Files\MATLAB\R2014a\toolbox\compiler\deploy\deployprint.m"
  (Referenced from: "Compiler Command Line").
Parsing file "C:\Program Files\MATLAB\R2014a\toolbox\compiler\deploy\printdlg.m"
  (Referenced from: "Compiler Command Line").
Deleting 0 temporary MEX authorization files.
Generating file "C:\Users\ndavies\Documents\matlab_utilities\nam_converter\nam_converter\for_testing\readme.txt".
Start packaging process
Packaging...
Adding custom icon C:\Users\ndavies\Documents\matlab_utilities\nam_converter\nam_converter_resources\icon.ico to C:\Users\ndavies\Documents\matlab_utilities\nam_converter\nam_converter\for_testing\nam_converter.exe.
Attempting to embed the CTF archive into the application C:\Users\ndavies\Documents\matlab_utilities\nam_converter\nam_converter\for_testing\nam_converter.exe.
Finished embedding CTF archive. Deleting the external CTF archive.
Creating the bundle...
Web based installer created at C:\Users\ndavies\Documents\matlab_utilities\nam_converter\nam_converter\for_redistribution\nam_converter_installer_web.exe.
Packaging complete.
Package finished

Here is the output in the command window:

C:\Users\ndavies\Documents\matlab_utilities\nam_converter>deploytool -package nam_converter.prj
Some of the build deliverables are missing. Rebuilding the project.
ant:
<ant>
  <mkdir dir="C:\Users\ndavies\Documents\matlab_utilities\nam_converter\nam_converter\for_redistribution" />
  <mkdir dir="C:\Users\ndavies\Documents\matlab_utilities\nam_converter\nam_converter\for_testing" />
</ant>
mcc -C -o nam_converter -W main:nam_converter -T link:exe -d C:\Users\ndavies\Documents\matlab_utilities\nam_converter\nam_converter\for_testing -R '-logfile,nam_converter.log' -v C:\Users\ndavies\Documents\matlab_utilities\nam_converter\nam_converter.m
lprj
mcc -C -o 'nam_converter' -W 'main:nam_converter' -T 'link:exe' -d 'C:\Users\ndavies\Documents\matlab_utilities\nam_converter\nam_converter\for_testing' -R -logfile,nam_converter.log -v 'C:\Users\ndavies\Documents\matlab_utilities\nam_converter\nam_converter.m'
Compiler version: 5.1 (R2014a)
Dependency analysis by REQUIREMENTS.
Warning: Duplicate directory name: C:\Program
Files\MATLAB\R2014a\toolbox\matlab\winfun\NET
> In path at 33
  In requirements at 156
Warning: Duplicate directory name: C:\Program
Files\MATLAB\R2014a\toolbox\rtw\targets\AUTOSAR\AUTOSAR
> In path at 33
  In requirements at 156
Warning: Duplicate directory name: C:\Program
Files\MATLAB\R2014a\toolbox\rtw\targets\AUTOSAR\AUTOSAR\dataclasses
> In path at 33
  In requirements at 156
Warning: Duplicate directory name: C:\Program
Files\MATLAB\R2014a\toolbox\simulink\simulink\MPlayIO
> In path at 33
  In requirements at 156
Warning: Duplicate directory name: C:\Program
Files\MATLAB\R2014a\toolbox\slvnv\reqmgt\RTExplorer
> In path at 33
  In requirements at 156
Warning: Adding path
"C:\Users\ndavies\Documents\matlab_utilities\nam_converter" to Compiler path
instance.
Parsing file "C:\Users\ndavies\Documents\matlab_utilities\nam_converter\nam_converter.m"
        (Referenced from: "Compiler Command Line").
Parsing file "C:\Program Files\MATLAB\R2014a\toolbox\compiler\deploy\deployprint.m"
        (Referenced from: "Compiler Command Line").
Parsing file "C:\Program Files\MATLAB\R2014a\toolbox\compiler\deploy\printdlg.m"
        (Referenced from: "Compiler Command Line").
Deleting 0 temporary MEX authorization files.
Generating file "C:\Users\ndavies\Documents\matlab_utilities\nam_converter\nam_converter\for_testing\readme.txt".
Start packaging process
Package failed

C:\Users\ndavies\Documents\matlab_utilities\nam_converter>

Upvotes: 0

Views: 1320

Answers (1)

Nigel Davies
Nigel Davies

Reputation: 1690

This turns out to be a fault in MATLAB R2014a, fixed in R2014b.

Upvotes: 1

Related Questions