Error when using deploytool Application Compiler
9 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Peter
el 21 de Mayo de 2015
Comentada: Ivo
el 13 de Ag. de 2015
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:
- In command window:>> deploytool
- Select application developer
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/150393/image.png)
- Add main file
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/150395/image.png)
- Recienve Error Message
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/150397/image.png)
- Click green package checkmark
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/150399/image.png)
- 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:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/150401/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/150402/image.png)
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 comentarios
Marc Weber
el 18 de Jun. de 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
el 13 de Ag. de 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.
Respuesta aceptada
Ashish Gudla
el 26 de Mayo de 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
Más respuestas (0)
Ver también
Categorías
Más información sobre Standalone Applications en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!