Why does MCC in MATLAB Compiler 4.5 (R2006b) open an X display even though it is a command line utility?

I am trying to compile an application using MATLAB Compiler on a remote machine that has a full MATLAB installation. I start a terminal window session to this machine and try to compile my MATLAB code.
The compilation does not complete, however, because of a broken X connection:
###>%mcc -R "-nodisplay -nojvm" -m pie3d.m
-----------------------------------------------------------------
X connection to localhost:11.0 broken (explicit kill or server shutdown).
###>%mcc -v -R "-nodisplay -nojvm" -m pie3d.m
-----------------------------------------------------------------
X connection to localhost:11.0 broken (explicit kill or server shutdown).
It appears that MCC is trying to open X display, fails, and crashes. I want to know why MCC would need to use X display, which is a command-line utility.

 Accepted Answer

The MCC command in MATLAB Compiler uses MATLAB to perform dependency analysis. MATLAB is looking for X display.
In order to work around this issue, you can use either of the following methods
1. Clear the DISPLAY environment variable. In a terminal window, use the commands:
setenv DISPLAY
mcc -m pie3d
This generates a warning that no display is available. However, MATLAB Compiler successfully compiles the file.
2. If the DISPLAY environment variable does not exist, the operating system will use a value from the cache:
-----------------------------------------------------------------
-> DISPLAY=localhost:11.0 used from the cache. No DISPLAY in the
environment . . .
-----------------------------------------------------------------
X connection to localhost:11.0 broken (explicit kill or server shutdown).
In this case, set the DISPLAY environment variable to an invalid value, for example:
setenv DISPLAY fake_display // the syntax for the 'setenv' line depends on what shell you are using
mcc -m pie3d
This will force MATLAB to accept that no display is available, rather than use a value for DISPLAY from the cache.

More Answers (0)

Categories

Find more on MATLAB Compiler in Help Center and File Exchange

Products

Release

R2006b

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!