Skip to content

MATLAB changes $LD_LIBRARY_PATH, breaks Qt apps #2965

@3rdcycle

Description

@3rdcycle

I've been debugging an issue with an app that depends on the Qt5 module. The app won't start because it can't find Qt's platform plugins:

qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""

I wrote a minimal Qt app to find the cause of this and it turns out to be MATLAB. More specifically, the fact that the MATLAB module prepends LD_LIBRARY_PATH with $EBROOTMATLAB/bin/glnxa64, a directory that contains tons of bundled MATLAB libraries, including their own versions of essential Qt5 libraries and many other unrelated libs which could potentially interfere with other modules too.

This change was introduced in #2008, presumably to make it easier for MCR compiled apps to load. For MATLAB itself this does not seem to be necessary because the matlab startup script sets LD_LIBRARY_PATH and other required environment variables on invocation.

The MATLAB docs cautions (bottom of the page) against setting LD_LIBRARY_PATH permanently on Linux due to this interference risk with other software. They suggest to "run MATLAB Compiler applications using the generated shell script" instead.

I would propose to revert #2008 but would obviously like to hear @smoors and maybe other's opinion on this first.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions