Thread Subject: Matlab 2009a doesn't autostart x11 on OS X?

Subject: Matlab 2009a doesn't autostart x11 on OS X?

From: Kerry Key

Date: 1 Apr, 2009 16:23:02

Message: 1 of 3

I installed 2009a on a Macbook Pro running OS X 10.5.6. When launch Matlab, it fails if I don't already have x11 running. Anyone else experiencing this? 2008b and earlier versions auto start x11, so this was a bit unexpected.

Subject: Matlab 2009a doesn't autostart x11 on OS X?

From: Brian Arnold

Date: 1 Apr, 2009 19:20:19

Message: 2 of 3

Hi Kerry,

Mac OS X 10.5 uses X11 R7 which takes advantage of a new system startup
feature called launchd, which will automatically launch applications and
daemons on demand. MATLAB will automatically launch the X11 server when
an X11 library is loaded and an X11 call is made, using an automatically
assigned DISPLAY value (per logged-in user), rather than the traditional
local DISPLAY value of ':0'.

Under Mac OS X 10.5, your DISPLAY environment variable should have a
value that looks similar to this, beginning with /tmp/launch:

    /tmp/launch-h40Qzv/:0

Mac OS X 10.5 and X11 R7 make this assignment for you (and for MATLAB),
so neither you nor MATLAB should be specifying DISPLAY any more.

If MATLAB is failing to launch without X11 already being launched, the
most common cause of this is a startup shell file (or environment file)
which is changing the value for DISPLAY (usually to :0). The value of
:0 only happens to succeed when X11.app is launched as a Startup Items
item (e.g., by your user account at login time).

Look in the following potential locations and files for possible places
where DISPLAY may be shadowing the system-defined DISPLAY environment
variable (where ~ is your home folder):

    ~/.bashrc
    ~/.cshrc
    ~/.MacOSX/environment.plist
    ~/.xinitrc

If you know of other shell initialization files, check those as well.

If for some reason you must specify :0 (or, if you just can't find where
it's getting redefined), you can add X11.app to your Startup Items,
which will enable :0 to continue working as it did before.

Please post if this indeed is the situation, or if you find out more
about the nature of the failure (e.g., check Console logs, try launching
from the command line and reporting the command line output, etc.).

- Brian

Kerry Key wrote:
> I installed 2009a on a Macbook Pro running OS X 10.5.6. When launch Matlab, it fails if I don't already have x11 running. Anyone else experiencing this? 2008b and earlier versions auto start x11, so this was a bit unexpected.

Subject: Matlab 2009a doesn't autostart x11 on OS X?

From: Terrance Nearey

Date: 23 Nov, 2009 17:43:21

Message: 3 of 3

Hi
I'm a little reluctant to go mucking about with shell scripts that other packages I've installed might rely on.
This little Applescirpt does the trick for me.
In a file called StartMatlab2009aAscpt.scpt
I put the following 6 lines of code (including comments)

-- Start X11 then Matlab
tell application "X11"
activate
end tell
delay 2 -- your mileage may vary: give x11 time to start
do shell script "open '/Applications/MatlabR2009a/MATLAB_R2009a.app'"

Making sure that Startup Screen checkbox is off, save as "application" or "application bundle". I then put an alias to the resulting "StartMatlab2009aAscpt.app" in "KeyApps" folder i keep in the Dock.
To make it prettier,
I also use the simple icon copy method to copy the matlab startup Icon from
"StartMatlab2009aAscpt.app" to "StartMatlab2009aAscpt.app" .
You do this by opening the files two files information windows (Command+i) with folder selected). Clicking on the Matlab icon that appears in the (icon-source) "StartMatlab2009aAscpt.app" info window lets you copy it clipboard. You can then click on the generic applescirpt icon in the info window of the (icon-target) "StartMatlab2009aAscpt.app" and paste it there. The alias will keep this new icon.




-T Nearey


Brian Arnold <Brian.Arnold@mathworks.com> wrote in message <49D3BE73.6070802@mathworks.com>...
> Hi Kerry,
>
> Mac OS X 10.5 uses X11 R7 which takes advantage of a new system startup
> feature called launchd, which will automatically launch applications and
> daemons on demand. MATLAB will automatically launch the X11 server when
> an X11 library is loaded and an X11 call is made, using an automatically
> assigned DISPLAY value (per logged-in user), rather than the traditional
> local DISPLAY value of ':0'.
>
> Under Mac OS X 10.5, your DISPLAY environment variable should have a
> value that looks similar to this, beginning with /tmp/launch:
>
> /tmp/launch-h40Qzv/:0
>
> Mac OS X 10.5 and X11 R7 make this assignment for you (and for MATLAB),
> so neither you nor MATLAB should be specifying DISPLAY any more.
>
> If MATLAB is failing to launch without X11 already being launched, the
> most common cause of this is a startup shell file (or environment file)
> which is changing the value for DISPLAY (usually to :0). The value of
> :0 only happens to succeed when X11.app is launched as a Startup Items
> item (e.g., by your user account at login time).
>
> Look in the following potential locations and files for possible places
> where DISPLAY may be shadowing the system-defined DISPLAY environment
> variable (where ~ is your home folder):
>
> ~/.bashrc
> ~/.cshrc
> ~/.MacOSX/environment.plist
> ~/.xinitrc
>
> If you know of other shell initialization files, check those as well.
>
> If for some reason you must specify :0 (or, if you just can't find where
> it's getting redefined), you can add X11.app to your Startup Items,
> which will enable :0 to continue working as it did before.
>
> Please post if this indeed is the situation, or if you find out more
> about the nature of the failure (e.g., check Console logs, try launching
> from the command line and reporting the command line output, etc.).
>
> - Brian
>
> Kerry Key wrote:
> > I installed 2009a on a Macbook Pro running OS X 10.5.6. When launch Matlab, it fails if I don't already have x11 running. Anyone else experiencing this? 2008b and earlier versions auto start x11, so this was a bit unexpected.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
applescipt Terrance Nearey 23 Nov, 2009 12:44:23
x11 Terrance Nearey 23 Nov, 2009 12:44:23
start matlab Terrance Nearey 23 Nov, 2009 12:44:23
rssFeed for this Thread

Contact us at files@mathworks.com