MATLAB >> Could not access the MCR component cache

by Wyatt » Wed, 08 Jul 2009 03:30:03 GMT

I have recently compiled some code with the MATLAB compiler which I wish to have executed by a cron process every so often. After compiling the code I have had no problems when executing the code from the command line, although although doing so requires a shell script that adds a few library paths to ones environment variables before executing the compiled code.

My problem arises when the system attempts to execute the code (or should I say the shell script that executes the code) as a cron process. I get an error that looks like this every time the system attempts to execute the code:

"Could not access the MCR component cache"

I am assuming that this refers to some environment variable that needs to be defined, although I have now added every variable to the shell script that is in my user environment.

If anyone has ever seen this error, or knows what would cause it to only exist when the code is being executed as a cron process I would greatly appreciate it.


MATLAB Version 7.6.0.324 (R2008a)
Operating System: Linux 2.6.18-128.1.1.el5PAE #1 SMP Mon Jan 26 14:18:23 EST 2009 i686

MATLAB >> Could not access the MCR component cache

by Douglas Voet » Wed, 15 Jul 2009 02:41:03 GMT


I just had the same problem trying to execute compiled matlab code under a system user. I turned on MCR_CACHE_VERBOSE as described here http://www.mathworks.com/access/helpdesk/help/toolbox/compiler/brl4_f1-1.html and found that matlab was trying to extract the cache to my home directory to which , of course, the system user did not have access.

I have not figured out how to fix it yet but I am going to try compiling with the -C flag.

MATLAB >> Could not access the MCR component cache

by Douglas Voet » Wed, 15 Jul 2009 02:43:04 GMT

I just had the same problem trying to execute compiled matlab code under a system user. I turned on MCR_CACHE_VERBOSE as described here http://www.mathworks.com/access/helpdesk/help/toolbox/compiler/brl4_f1-1.html and found that matlab was trying to extract the cache to my home directory to which , of course, the system user did not have access.

I have not figured out how to fix it yet but I am going to try compiling with the -C flag.

MATLAB >> Could not access the MCR component cache

by Douglas Voet » Wed, 15 Jul 2009 02:53:03 GMT

calling:
mcc -C <function name>

then including the CTF file in the path worked.

MATLAB >> Could not access the MCR component cache

by Wyatt » Tue, 18 Aug 2009 00:37:02 GMT


Thanks for the help. I was starting to worry that nobody would respond!

That definitely did the trick!

MATLAB >> Could not access the MCR component cache

by Zohair » Sun, 30 May 2010 18:14:05 GMT

Hi eveyone,

I am using a MATLAB compiled library in Linux environment but when want to access it and run my c++ code, I receive this message:
"Could not access the MCR component cache".
I am pretty sure that this is linux pathing issue and I wonder what this message means and what file the system is unable to access.

Any help is much appreciated.

Thanks,

Zohair

MATLAB >> Could not access the MCR component cache

by Yu Ang » Fri, 22 Apr 2011 17:21:04 GMT


Hi Zohair,

Well, it's been a years time since you've posted this, but I thought I'd post a possible solution in case someone else have the same problem.

I have a similar problem some time ago, and apparently it had to do with the MCR being installed in my /opt/ path, which requires root access to make modifications. So you'll either need to login as a root user, or use commands like su and sudo.

Hope this helps.

Similar Threads

1. distributed compiler .exe issue: msg "toolbox path cache is not being used"

Hello

I am running a matlab compiler .exe sent by a client.
When I run a batch file which calls the .exe i get the msg "Toolbox Path
Cache is not being used.  Type 'help toolbox_path_cache' for more info"
Is this a problem? What can we do about it?

We are seeing some very weird problems happening in our GAMS code (the
matlab .exe invokes a GAMS session and runs our model) wrt accessing data
from an excel spreadsheet so we need to trace if this is happening because
of the listed issue above when Matlab is running.

We have matlab R14 installed (not compiler) on this machine, but we do not
have the .m file used to create this .exe (and may not be able to get it) so
cannot run the matlab code manually.

Regards
A


2. access components in GUI - MATLAB

3. I can not install MCR on the deployment machine

I am trying to run a standalone executable file on a deployment machine that does not have matlab installed on it. When I run the MCRInstaller.exe it works normally at the beginning and after two or three steps(right before starting the installation) it tells me "MCRInstaller was interrupted. Your system was not modified....."
What is the problem?
If anyone had this problem before plz tell me
Thanks

4. The MCR instance could not be initialized at MathWorks.MATLAB.NET.Utility.MWMCR..ctor - MATLAB

5. Fix Found for MCR Not Available message with Combuilder in Windows

Fix for MCR Not Available message with Combuilder in Windows boxes.

We couldn't get DLLs built with Combuilder in R14 to work.  They'd
register but give us an error saying "MCR Not Available" when we
accessed them.

After a lot of trial and error we found that if we register our DLLs in
the directory FROM which the MCR was installed, they work.  The weird
thing is that it's not the directory we installed TO, it's the
directory we installed FROM.

We copied the MCR installer to a directory named C:\INSTALLS.  We ran
the MCRInstaller.MSI program and chose to install in "C:\Program
Files\MathWorks\MATLAB Component Runtime".  Now we register our files
in C:\Installs and they work.  Plus we discovered that we don't need
the CTF files that the doc says we need.  They don't hurt, but they
don't help at all.  Having the install directory or the application
executable directory in the path doesn't help either.

The only reference to C:\INSTALLS that I can find in our registry are
under the MCR's key in:

HKEY_LOCAL_MACHINE\SOFTWARE\Clsses\Installer\Products\45179633990D5442AF2089455D9B422\SorceList


and

HKEY_LOCAL_MACHINE\SOFTWARE\Clsses\Installer\Products\45179633990D5442AF2089455D9B422\SorceList\Net


I assume the key number after \Products\ would be different for each
installation but you can search on Matlab to find your key.

Later we'll experiment with changing these registry values but for now
I wanted to share what we learned.

6. MCR not available problem - MATLAB

7. Compiled library: MCR is NOT the same as full matlab

So far a I've noticed a few things while tring to build an
application using compiled matlab libraies. If anyone understands why
I'd appreciate it!!!

First background: My windows app is in VC++ 7.1, I'm using matlab 7.0
R14. I have 2 compile libraries, call them lib1 and lib2.

I always call mclInitializeApplication() once at App level when the
app starts and call mclTerminateApplication() once at the App end
level. That's where the similarities end.

1. On the development machine, I can initialize and terminate lib1
and lib2 to mye heart's content, I can do it every time i call a
library routine. If I build and run this on a deployment machine with
MWCR installed, it will not initialize any library after any other
library has bee terminated. In other words

lib1Initialize()
lib1Terminate()
lib2Initialize() --> will fail here
lib2Terminate()

will not work.

lib1Initialize()
lib2Initialize()
lib1Terminate()
lib2Terminate()

does work but you cannot initialize any library after the first
libTerminate is called.

2. If I decide to move the lib1 and lib2 initialize to the app level
and only do it once (and move lib1 and lib2 terminate to the App
destructor) it now works on the deployment machine but not on my
development machine with the full matlab installed. On my development
machine, it crashes at the first libInitialize, doesn't matter which
one I put first.

Weird, hunh?

All I want is a single version of software that works on both
machines. Understanding what's going on would be nice as well.

8. MCR instance is not available - MATLAB