MATLAB 2020a and prior versions generate pcode warning

13 views (last 30 days)
I help run a centralized computing site with MATLAB for our users, and at least two versions (2019a and 2020a) complain that the P-file for ver.p is older than the ver.m that's installed and might need to be rebuilt. The ver function seems to be needed by a several functions to do something (check the license?), so the warning message comes up frequently, but it's not an error and doesn't cause code failures, just confusion and trouble tickets from our users. My assumption was that these pcode files were created by The Mathworks and shipped with MATLAB and end users need not worry about them. Any advice? Here's a sample of the message, lightly edited to shorten the paths:
Warning: P-file /xxxxxxx/matlab/2020a/toolbox/matlab/general/ver.p is older
than MATLAB file /xxxxxxx/matlab/2020a/toolbox/matlab/general/ver.m.
/xxxxxxx/matlab/2020a/toolbox/matlab/general/ver.p may be obsolete and may
need to be regenerated.
Type "help pcode" for information about generating P-files.
Users sometimes try to regenerate the P-files themselves, which can lead to some really interesting trouble tickets since they don't have write permissions to the MATLAB installation directory. For the 2020a files, they both have UNIX modify and change dates a few seconds apart on what I presume to be the install date (I'm not the one that did the install).

Answers (1)

Fangjun Jiang
Fangjun Jiang on 14 Aug 2020
Someone must have modified and saved the ver.m file by mistake. ver.m and ver.p are built-in files and shouldn't be modified. Restore the original copy for those two files and the problem should be resolved.
The "Date Modified" for ver.m in R2020a is 3/6/2019. For ver.p, it is 1/29/2020.
  6 Comments
Bill Barth
Bill Barth on 15 Aug 2020
No extra P-file or M-file, but it notices the M-file that shadows it:
>> which -all ver
/xxxxxxx/matlab/2020a/toolbox/matlab/general/ver.p
/xxxxxxx/matlab/2020a/toolbox/matlab/general/ver.m % Shadowed
But we knew there must be an M-file matching our P-file, thus the complaint. I don't think the admin who installed this and the prior version accidentally or purposefully overwrote the P-file.
Also, I should note that while 2019a is fine, 2018b has the same problem and the same complaint about fullfile.m and .p. 2019b, only has the issue with ver.m and .p.
Given that the whole Linux world isn't complaining about this, I agree that this is probably us and not The Mathworks, but I don't think we're doing it on purpose. There must be something systematic about the issue. There are roughly 10k M-files installed in the core MATLAB toolbox, and only 1500-ish P-files. I doubt those are created at install-time, but instead created at the mothership and installed with the product.
I know I could run pcode on ver.m and get rid of the ver.p file I have and not have to deal with the trouble tickets, but I'd like to not destroy the evidence in the process.
Fangjun Jiang
Fangjun Jiang on 17 Aug 2020
Many .m files are for help document, for example abs.m, there won't be one-to-one match of .p file for every .m file.
Anyway, the warning message is annoying. Contact the Mathworks Tech Support. I bet they can tell you what should be the exact "time stamp" on the files and you could eventually figure out the cause and solution.

Sign in to comment.

Categories

Find more on Introduction to Installation and Licensing 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!