MATLAB Answers

0

P files cannot be analyzed to find their dependencies. Please add P file dependencies manually

Asked by Micah Mayne on 20 Feb 2016
Latest activity Edited by Jan
on 5 Oct 2019
Accepted Answer by Jan
Hello, I am making a standalone GUI application that uses the most recent Arduino support package. My GUI does not work because one certain file, as shown in the image is a .p file.
MATLAB advises me to 'P files cannot be analyzed to find their dependencies. Please add P file dependencies manually'.
To be exact, the file name is: 'C:\MATLAB\SupportPackages\R2015b\arduinoide\toolbox\realtime\targets\arduinoide \+ide\+internal\getArduinoIDERootDir.p'
I do not know how to work with .p files in such a manner and am unable to find any sources to solve the problem.

  5 Comments

Have exactly same problem, did anyone find some workaround?
You can call clear all at first and after calling the code, which contains the P-file, check the list of loaded functions:
[M,X,C] = inmem('-completenames');
Care for including these files.

Sign in to comment.

Tags

1 Answer

Answer by Jan
on 6 Dec 2017
Edited by Jan
on 5 Oct 2019
 Accepted Answer

I'd start with a web search: Ask your favorite search engine for "Matlab get dependencies of P file". You will find e.g.:
There is a chance, that getArduinoIDERootDir.p does not call any other functions, which have not been included from somewhere else. So you could simply try it: Ignore the warning and check, if the resulting executable works reliably. If not, the error message might reveal the required subfunctions. Or use one of the above mentioned methods to analyze the dependencies.
[EDITED] You can call clear all at first and after calling the code, which contains the P-file, check the list of loaded functions:
[M,X,C] = inmem('-completenames');
Care for including these files.

  2 Comments

I have the same problem and Im not sure if I understand your answer.
What did you mean exactly with "Calling the Code"? Should I clear all and start the GUI and after the start I use
[M,X,C] = inmem('-completenames');
?
When I press a button, different functions are called which are not automatically used when starting my app. Are these also shown by inmem? Or how can I know in which function the p.- files occur?
@Kim: If you have a GUI with a bunch of callback functions, follow these steps:
clear('all')
% Now the memory does not contain any loaded functions
% anymore, except if they are locked (see: mlock)
... start the GUI
... Press all GUI elements, e.g. buttons
... to trigger all callbacks
... Every function, which is called now, is kept in the
... memory and found by:
[M,X,C] = inmem('-completenames')
Then you get lists of all called functions including the P-files. For creating a compiled application, you do not have to include the built-in functions, so you have to remove them from these lists.
An alternative is using the pofiler, which offers a dependency tree also. And I still think, that the 3 posted links are useful also.
My GUI codes have an interface for a unit-testing. This allows an automatic testing of all elements without the need of user interactions. This is safer than letting the user "press all GUI elements", because you cannot be sure, that this war really exhaustive.
I'm using a tool to scan the source code of M-files for a list of function names. This does not work in the case of this question, because the source code of P files is not available. But of course the author of the P files has the source code. So I would contact him or her, if I have the need to now the called functions. Why guessing and searching if the most reliable way is to ask?

Sign in to comment.