MATLAB Answers

MCR incompatibility with Mountain Lion?

2 views (last 30 days)
Pierre-Jean
Pierre-Jean on 13 Jan 2013
Hello,
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 http://www.mathworks.co.uk/products/compiler/mcr/index.html) v80.
import ctypes
libtest = ctypes.cdll.LoadLibrary('libmwmclmcrrt.dylib')
libtest.mclInitializeApplication_proxy(None, 0)
libtest.mclTerminateApplication_proxy
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

Answers (7)

Andreas Goser
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.
  2 Comments
Andreas Goser
Andreas Goser on 5 Feb 2013
A bug was identified by MathWorks Technical Support and Development and a patch was provided for this user.

Sign in to comment.


Pierre-Jean
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
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.

Sign in to comment.


Pierre-Jean
Pierre-Jean on 15 Jan 2013
Edited: 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
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.

Sign in to comment.


Pierre-Jean
Pierre-Jean on 16 Jan 2013
Edited: 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(){
mclInitializeApplication(NULL,0);
mclTerminateApplication();
}
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

Pierre-Jean
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


Pierre-Jean
Pierre-Jean on 17 Jan 2013
Malcolm,
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: http://www.mathworks.com/help/compiler/c-shared-library-target.html
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
  3 Comments
Malcolm Lidierth
Malcolm Lidierth on 17 Jan 2013
@PJ
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.
ML

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!