On Sep 3, 12:44 pm, William Stein <[email protected]> wrote:
> 2009/9/2 jjh <[email protected]>
> > On Sep 3, 2:20 am, Tim Lahey <[email protected]> wrote:
> > > On Sep 2, 2009, at 11:09 AM, jjh wrote:
> > > > Hi,
>
> > > > I have recently upgraded to OS X 10.6. This seems to have broken the
> > > > MATLAB interface. MATLAB crashes on startup when called through
> > > > matlab.eval() (but runs fine if I run it directly through the
> > > > Terminal). This occurs for MATLAB 2008b and 2009a.
>
> > > > The root cause seems to be that this line:
> > > > os.execv('/Applications/MATLAB_R2009a.app/bin/matlab', ['/
> > > > Applications/
> > > > MATLAB_R2009a.app/bin/matlab', '-nodisplay'])
> > > > will happily result in a running version of MATLAB when run through
> > > > the OS X built-in python (which is version 2.6.1). However, when the
> > > > same command is issued within Sage the resulting MATLAB process
> > > > crashes on startup (I've appended the MATLAB output to the end of this
> > > > message).
>
> > > According tohttp://snowleopard.wikidot.com/thereare some problems
> > > with
> > > the command line version of Matlab 2009a on Snow Leopard. I highly
> > > doubt it's a
> > > Sage problem.
>
> > As I mentioned, MATLAB 2009a (and 2008b) both work fine for me when
> > run through Terminal (with or without -nodisplay) and work fine when
> > run directly. They even work fine using execv from a normal Python
> > shell. But execv matlab with sage crashes MATLAB on startup. It would
> > be rather pointless to debate whose "problem" it is, it may well be
> > MATLAB doing something wrong in the Sage case. But obviously, MATLAB
> > does run on 10.6 in other cases. I would be interested to try and help
> > figure out what is going on when started using execv from within Sage
> > and fix/workaround it. Does anyone have any ideas what to try?
>
> I'm guessing environment variables / libraries are relevant.   What happens
> when you do:
>
> sage: !sage-native-execute matlab
>
> and
>
> sage: !matlab
>
> Thanks for looking into this and reporting this issue.
>
> William

Thanks for that. Yes it makes more sense now. MATLAB works when run
using sage-native-execute but not when using !matlab.

Essentially the cause of the problem is that DYLD_LIBRARY_PATH
includes /Applications/sage/local/lib when running MATLAB. Some
library in this folder is obviously replacing the one MATLAB expects
and causing issues - maybe it's libgcc? I'm not sure
export DYLD_LIBRARY_PATH=/Applications/sage/local/lib && matlab
consistently causes the crash from the command line.

What is the best way to fix this (and submit a patch). Is it just that
once a version of Sage is compiled for 10.6 the libraries will no
longer conflict and the problem will go away? Or should I change
matlab.py to call sage-native-execute before matlab? Or should I
change expect.py or pexect.py to always shed the DYLD_LIBRARY_PATH
environment variables? Or something else?

Thanks,
Jonny

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to