Error when using deploytool Application Compiler

8 views (last 30 days)
Background
I wrote a program to send commands to several motor controllers using tcpip and serial interface objects. The program consist of 2 class files and a 'main' script:
  • CSimpleVXM
  • CTestProtocols
  • simple_main
I would like make this into a standalone executable (to be used without a matlab license).
Problem
However I get the following error when attempting to make an executable using the Application Developer:
The following error was encountered when analyzing user added files. Subscript indices must either be real positive integers or logicals.
My attempt at this:
  1. In command window:>> deploytool
  2. Select application developer
  1. Add main file
  1. Recienve Error Message
  1. Click green package checkmark
  1. Inspect log file... sit there and contemplate life
ant:
<ant>
<mkdir dir="C:\Users\magmeasure\Documents\MATLAB\simple_main\for_redistribution" />
<mkdir dir="C:\Users\magmeasure\Documents\MATLAB\simple_main\for_testing" />
<mkdir dir="C:\Users\magmeasure\Documents\MATLAB\simple_main\for_redistribution_files_only" />
</ant>
mcc -C -o simple_main -W WinMain:simple_main -T link:exe -d C:\Users\magmeasure\Documents\MATLAB\simple_main\for_testing -v E:\ProNovadata2\Projects\MagnetMapperGUI\MatLab_Code\SimpleCode\code\simple_main.m
Compiler version: 6.0 (R2015a)
Dependency analysis by REQUIREMENTS.
{Subscript indices must either be real positive integers or logicals.
Error in getSymbolNames (line 155)
Error in matlab.depfun.internal.MatlabInspector/analyzeSymbols (line 189)
[F, S] = getSymbolNames(symbol.WhichResult);
Error in matlab.depfun.internal.Completion/findDependentFiles (line 1288)
analyzeSymbols(inspector, symbol);
Error in matlab.depfun.internal.Completion/computeDependencies (line 246)
findDependentFiles(obj);
Error in matlab.depfun.internal.Completion/computePartsList (line 1858)
computeDependencies(obj);
Error in matlab.depfun.internal.Completion/requirements (line 2230)
parts = computePartsList(obj, false);
Error in matlab.depfun.internal.requirements (line 194)
[parts, resources.products, resources.platforms] = c.requirements();
}
Unexpected error while determining required deployable files. Compilation terminated.
Error Info Inspecting the error:
Stepping though code to see where error was thrown:
followed it to here. This is a p-file, so I'm not really sure what is happening.
Notes
  • Version Info
  • MCR version: 8
  • My code appears syntax free, and can be ran without error inside matlab.
  • Link to codehttps://drive.google.com/folderview?id=0B_ARxFAg-dCWfk9ybkRoX3VlckdqTFV5bFFXM0dPMElDUnNtdnlhbDJuVWNmdjBZZmNYMnc&usp=sharing
  4 Comments
Marc Weber
Marc Weber on 18 Jun 2015
I have the same problem.
Background
I am working on a large simulation software that contains many classes and files organized in folders and subfolders. I need to compile the software to be able to run it on a computation cluster without using Matlab licenses which are limited in my research institute.
All the examples from PATH_TO/matlab/R2014a/extern/examples/compiler could be compiled successfully and passed the tests in my environment, using the compiler from version R2014a.
The simulation software runs successfully in a desktop Matlab session.
Matlab version 2014a 8.3.0
Matlab MCR version 8.3
Linux 64 bits
gcc version 4.7.2
Problem
When compiling with command
mcc -o runSimulation -W main:runSimulation -T link:exe -d ./bin/runSimulation -p bioinfo -p curvefit -p images -p optim -p signal -p stats -N -w enable:specified_file_mismatch -w enable:repeated_file -w enable:switch_ignored -w enable:missing_lib_sentinel -w enable:demo_license -R -nodisplay -R -singleCompThread -v ./bin/runSimulation.m -a LONG_LIST_OF_ALL_MATLAB_FILES
I always get dependencies error like:
Error using getSymbolNames (line 145) Import argument "SOME_CLASS_NAME" in MATLAB code 'SOME_MATLAB_FILE.m' cannot be found or cannot be imported.
Error in matlab.depfun.internal.MatlabInspector/analyzeSymbols (line 152) [F, S] = getSymbolNames(symbol.WhichResult);
Error in matlab.depfun.internal.Completion/findDependentFiles (line 1057) analyzeSymbols(inspector, symbol);
Error in matlab.depfun.internal.Completion/computeDependencies (line 234) findDependentFiles(obj);
Error in matlab.depfun.internal.Completion/computePartsList (line 1581) computeDependencies(obj);
Error in matlab.depfun.internal.Completion/requirements (line 1890) parts = computePartsList(obj, false);
Error in matlab.depfun.internal.requirements (line 191) [parts, resources.products, resources.platforms] = c.requirements();
Unexpected error while determining required deployable files. Compilation terminated.
What I tried to solve the problem
I tried to include ALL the subfolders by passing them with the -p option to the compiler.
I tried to change the order of the files passed the compiler. In this case I get the same error but referring to another import statement in a different file.
In a Matlab desktop session, by setting the correct paths with the addpath() function, I can import the mentionned class without any problem. Therefore, it seems to be a problem related to the Matlab compiler.
Ivo
Ivo on 13 Aug 2015
Is there any update on this ? We have been encountering the same problem for a while now. I picked out one function of our toolbox that generates this error and commented all import statements but: [fList,pList] = matlab.codetools.requiredFilesAndProducts('foo.m')
still gives the same error as above. We do heavily use java code and eval statements in our application (which is rather complex) making it difficult to narrow it down. Can Matlab report the filename + the actual symbol name that causes the error ? As mentioned, we can not dig deeper as GetSymbolName is p-coded.

Sign in to comment.

Accepted Answer

Ashish Gudla
Ashish Gudla on 26 May 2015
I understand that you get a 'Subscript indices must either be real positive integers or logicals' error message when you try and deploy your code.
This appears to be an issue with the 'matlab.codetools.requiredFilesAndProducts' function when handling import statements.I work for Mathworks and forwarded your feedback to the appropriates product team.
Meanwhile as a workaround you could comment out the import statements in your code (simple_main.m and CTestProtocols.m) and that should resolve the error
  1 Comment
Peter
Peter on 26 May 2015
Ashish,
I removed the import as adivised. Because of this my code would not compile. I had some of the file placed in different folders. Previously, when running my program I would have to used the Addpath function in the commandline. I vaguely remember that this function can not be used with the application compiler.
I placed all of the programs files into the same folder and removed all imports before running the application compiler. The application was created as expected with no errors/warnings.
Is this expected behaviour?

Sign in to comment.

More Answers (0)

Categories

Find more on Java Package Integration in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!