Is there a way to restrict the MCR Version used for compiled code?

Is there any way to restrict which version of the MCR can be used to launch compiled code? The project I am working on involves a fairly rigorous validation effort and we usually limit the validation to a specific system state. It seems that compiled code can be launched using other versions of the MCR besides the version that corresponds to my version of Matlab.
I am using 2012b and so would like my code to confirm that v8.0 of the MCR is being used. To test this I only installed the latest version of the MCR (8.2), but the mcrversion command still returns "8.0" and even if I compile a little script to display the results of mcrversion; it still says 8.0 even though I only have version 8.2 of the MCR installed.
Is there any other way to confirm what MCR version is used to launch a compiled code?

 Accepted Answer

What you say is not true. You cannot use an MCR that does not match the version you used to compile the executable with. So the way you want it, is already the way it is.

6 Comments

Ok, it seems that if you have Matlab installed, it can use that to launch compiled codes and you do not need an MCR installed. It was ignoring whatever installation of the MCR I had installed and was just using Matlab 2012b. Interesting.
On your development computer, obviously they're the same. So you must be saying that you installed your compiled code on some other computer that had the full blown MATLAB development environment installed but was a different version than yours (R2013b instead of your R2012b). And though you installed your MCR from R2102b on the target computer, it was instead preferentially using the MCR from the full blown 2013b instead of the MCR from R2012b that you installed. Does that summarize it correctly?
No this is all on my computer. I have 2012b and I assumed you still needed an MCR installed to run compiled code. I had MCR 8.2 installed so I thought that was being used to run my compiled code. I realize now it will just use Matlab if it is the correct version.
I just downloaded the MCR to test. I wanted to see if my compiled code would run with it.
As you found out, it will preferentially use the version that you compiled with, regardless if an earlier or later one is installed.

Sign in to comment.

More Answers (0)

Categories

Products

Community Treasure Hunt

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

Start Hunting!