How do I direct MATLAB to use the Mesa OpenGL libraries or the system OpenGL libraries on a UNIX machine?

10 views (last 30 days)

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 18 Oct 2013
When searching for OpenGL libraries, MATLAB first looks on the system library path. If OpenGL is not found there, it uses the Mesa libraries shipped with MATLAB.
As of MATLAB 7.0.1 (R14SP1), if you want to use the MESA libraries, use the following command in MATLAB:
opengl software
If you are using a previous version of MATLAB, please read the following information:
If your system library path is defined, you must modify it in order for MATLAB to use the Mesa libraries. If you are not familiar with modifying environment variables, then you should consult your system administrator or system documentation for more information on modifying the library path.
Here is how to put the Mesa libraries at the head of the system library path:
setenv LD_LIBRARY_PATH $MATLAB/sys/opengl/lib/$ARCH:$LD_LIBRARY_PATH
PLEASE NOTE: $MATLAB should be replaced by your root MATLAB directory, and $ARCH should be replaced by your system architecture.
You can verify which OpenGL MATLAB is using by using the following command in MATLAB:
opengl info
If you want to use your system OpenGL libraries instead, you can determine the location of the libraries by consulting your system administrator or by referring to your system documentation. The OpenGL drivers will have a file name of libGL.$EXT and libGLU.$EXT (where $EXT is the platform's sharable library extension, e.g.. so, a, sl).
Here is an example for SOLARIS workstations:
If your OpenGL libraries are in /usr/lib and you are on SOLARIS then the following UNIX command will pre-append the directory to the library path.
setenv LD_LIBRARY_PATH /usr/lib:$LD_LIBRARY_PATH

More Answers (0)

Categories

Find more on Graphics Performance in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!