MATLAB Answers


MCR incompatibility with Mountain Lion?

Asked by Pierre-Jean
on 13 Jan 2013


It seems there is an incompatibility between the MCR and Mountain Lion. The following minimal Python code is just trying to initialize the MCR. It works fine with the MCR v711, but it breaks with the latest one (downloaded from v80.

import ctypes
libtest = ctypes.cdll.LoadLibrary('libmwmclmcrrt.dylib')
libtest.mclInitializeApplication_proxy(None, 0)

This: mclInitializeApplication_proxy crashes with the following message: libc++abi.dylib: terminate called throwing an exception Abort trap: 6

Does anyone know how to handle this?

Thanks! PJ


7 Answers

Answer by Andreas Goser
on 15 Jan 2013

According this reference, the latest MCR version as of today is MCR 8.0 as part of the product MATLAB Compiler 4.18 and the Release R2012b.

The system requirements for R2012b list the Mac OS 10.8 (Mountain Lion) as supported platform.

I conclude that it is correct to assume that software versions should not be part of the problem. I cannot assess the cause of the problem, but before you contact MathWorks Technical Support, try createing a very simple stand-alone application in MATLAB Release R2012b and run it on this computer with just the MCR and see how it behaves. This helps to distinguish the location of the error.


on 15 Jan 2013

Walter, Andreas,

Thanks a lot for your help on this.

Just to clarify: the code I posted does not do anything "custom". Actually, we spent a LOT of time in our code since we thought the problem was on our side, and bit by bit we ended up stripping everything out and only have this bare bone script that does nothing. It just tries to initialise the MCR.

This MCR comes from the Mathworks website itself. It is here:

So we are stuck. We even tried using Ruby instead - same thing. And again: the script just loads the MCR, nothing else. Hence it seems to us it has to be a bug with the MCR on Mountain Lion.

We tried 3 different Macs already... The only way to make it work is to downgrade to Snow Leopard, which is not an option.

Walter, if you could give it a go on Lion (I don't have a Lion machine), it would be fantastic.

Thanks! PJ

Andreas Goser
on 5 Feb 2013

A bug was identified by MathWorks Technical Support and Development and a patch was provided for this user.

Answer by Pierre-Jean
on 13 Jan 2013

I tried on Snow Leopart (10.6.8) and it works fine. So it looks like it is a Mountain Lion issue. It is almost 6 months old now though. It should work by now.

Did anyone manage to get a working MCR with Mountain Lion?

  1 Comment

Walter Roberson
on 15 Jan 2013

I do not have the compiler toolbox, but if you put a copy of your binary up somewhere, I'll try it on Lion (not Mountain Lion) to see what happens here.

You can email me the link; please mention MATLAB in the subject.

Answer by Pierre-Jean
on 15 Jan 2013
Edited by Pierre-Jean
on 15 Jan 2013

Hi there,

I don't want to bug people with this... but is there anyone from Mathworks watching this forum?

This clearly seems like a Matlab bug since it used to work fine. It will need a fix.

Thanks PJ

  1 Comment

Andreas Goser
on 15 Jan 2013

I will give a technical response below. First a comment with regards to "bugging people" and "MathWorks watching this forum". There are many MathWorks employees contributing to MATLAB Answers. But typically those contributions are based on personal experience and viewpoints and are not an official MathWorks position. If you like to report a bug, please contact MathWorks Technical Support. And with regards to bugging people: You either bug nobody here or everybody. All contributors are here free to read or not, write or not.

Answer by Pierre-Jean
on 16 Jan 2013
Edited by Pierre-Jean
on 16 Jan 2013

Hi Friedrich,

Thank you for your help.

"basically as far as I know, calling the MCR like this is not a supported way"

What do you mean? I don't think my code does anything different from the driver example, does it? It is just implemented in a different language. The reason it is shorter is that I have stripped out all the code related to my custom shared lib since it never gets accessed anyway. In C it would be:

int main(){

Also, if it was the case (i.e. if the MCR itself had changed), the same MCR would also break on another system (like Snow Leopard). It is not the case.

MCR v7.11 + Snow Leopard -> works fine

MCR v7.11 + Mountain Lion -> works fine

MCR v8.0 + Snow Leopard -> works fine

MCR v8.0 + Mountain Lion -> crash

with the exact same, super basic code.

I guess I was hoping to get feedback from someone who managed to have their compiled code work with the MCR v8.0 + Mountain Lion. If it works for someone then it means the problem is on my side indeed. But so far I haven't heard anyone so I am really concerned.

Thanks PJ


Answer by Pierre-Jean
on 16 Jan 2013

Just to confirm: I tried the official matrixdriver example. It crashes as well (at the same line as the python script):

Thread 5 Crashed:
0 libsystem_kernel.dylib 0x00007fff89b7a212 __pthread_kill + 10
1 libsystem_c.dylib 0x00007fff90be2af4 pthread_kill + 90
2 libsystem_c.dylib 0x00007fff90c26dce abort + 143
3 libc++abi.dylib 0x00007fff8f378a17 abort_message + 257
4 libc++abi.dylib 0x00007fff8f3763c6 default_terminate() + 28
5 libobjc.A.dylib 0x00007fff90ac3887 _objc_terminate() + 111
6 libc++abi.dylib 0x00007fff8f3763f5 safe_handler_caller(void (*)()) + 8
7 libc++abi.dylib 0x00007fff8f3763e4 unexpected_defaults_to_terminate() + 16
8 libc++abi.dylib 0x00007fff8f376434 __cxxabiv1::__unexpected(void (*)()) + 6
9 libc++abi.dylib 0x00007fff8f37735d __cxa_call_unexpected + 55
10 libmwmcr.dylib 0x0000000103f501f1 mnSigInit(bool) + 1809
11 libmwmcr.dylib 0x0000000103f45ba0 mnInitExceptionHandling(bool) + 48
12 libmwmvm.dylib 0x0000000107af6ea3 mvm::detail::SessionImpl::init() + 451
13 libmwmvm.dylib 0x0000000107af65e2 mvm::detail::SessionImpl::initWithOptions(mvm::SessionOptions const&) + 50
14 libmwmclbase.dylib 0x0000000107161f91 mclInitializeApplicationImpl(char const**, unsigned long) + 1089
15 libmwmclbase.dylib 0x0000000107162b9c mclInitializeApplication + 28
16 libmwmclmcrrt.8.0.dylib 0x000000010000886a mclInitializeApplicationInternal_proxy + 10
17 libmwmclmcrrt.8.0.dylib 0x0000000100004bdc mclInitializeApplication_proxy + 44
18 matrixdriver 0x0000000100000a05 run_main + 85
19 libmwmvm.dylib 0x0000000107afa4bb boost::detail::function::function_obj_invoker2<boost::function2<int, int, char const**>, int, int, char const* []>::invoke(boost::detail::function::function_buffer&, int, char const**) + 123
20 libmwmcr.dylib 0x0000000103f4a42b 0x103f00000 + 304171
21 libsystem_c.dylib 0x00007fff90be1742 _pthread_start + 327
22 libsystem_c.dylib 0x00007fff90bce181 thread_start + 13

Thanks, PJ


Answer by Malcolm Lidierth
on 17 Jan 2013

It does work on Mountain Lion.

Have you installed the Command Line Tools in XCode Preferences (needed in Mountain Lion) and the patches from TMW:


Answer by Pierre-Jean
on 17 Jan 2013


Thanks a lot for your input. That's great news. We did apply the patches, but maybe it means there is a conflict with something else on our machines.

Before we go ahead and reinstall everything, may I ask you to confirm:

- for us too, compiled standalone applications work absolutely fine.

- shared libraries do not work. For instance, the matrixdriver example from the doc fails:

Do both work in your experience?

If they do, would you agree to let me know: - which version of Mountain Lion you are running - which version of gcc you have?

Thanks a lot for your help, PJ


Malcolm Lidierth
on 17 Jan 2013


I do not have access to it at present so will not be able to check details today but gcc 4.4 springs to mind (possible wrongly). I am using the latest Mountain Lion and XCode 4.5.(2?) - on a machine recently updated from Snow Leopard - so 2-3 years old.

I have little experience of the mcr having only recently been given access to it. My test was just to deploy an m-file with surf(peaks(20)) to give a clear visual output and then double clicked "".

I have Java 6 installed as well as 7 (which I guess you must too). I also recently ran the Apple Disk Utility to "fix permissions" following a web suggestion related to something else (I forget exactly what). I was surprised by how many file permissions it fixed. Not sure if that could be relevant here.


PS Also the MCR is in the default /Applications/MATLAB/.... - I has problems when I put it elsewhere.

on 17 Jan 2013

Thanks Malcolm.

The thing though, the scenario you describe works for me as well. The one that does not work is when you compile a C-Shared library. I think something is broken with v8.0 of the MCR.

I am in contact with support now. Hopefully they will be able to help.


Malcolm Lidierth
on 17 Jan 2013


I will be trying to do that too in a few weeks - so any tips you can share here if you solve it would be welcome.


Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply today