MATLAB 2014a (8.3) Compiler Runtime Errors libmwlaunchermain.so
Asked Answered
A

2

7

MATLAB 2014a (8.3) Runtime Compiler (MCR) Errors when trying to launch deployed (using deploy tool) application in Ubuntu 13.04.

Right after installation of MCR if one runs the deployed application following error appears:

error while loading shared libraries: libmwlaunchermain.so: cannot open shared object file: No such file or directory.
Agrarian answered 2/6, 2014 at 22:22 Comment(1)
export LD_LIBRARY_PATH=mcr_root/version/runtime/glnxa64:mcr_root/version/bin/glnxa64:mcr_root/version/sys/os/glnxa64:mcr_root/version/sys/opengl/lib/glnxa64, MATLAB Runtime Path Settings for Run-Time Deployment.Perky
A
7

Since I have already found a solution to this problem wasting a day, I just want to share it:

This seems to be a problem of MATLAB MCR installation script designed for Linux by MathWorks. Furthermore, it is a result of a known Ubuntu bug. To fix it, add your MCR to the $PATH as shown below:

  • First make sure to add the missing files to the right folder, in terminal:

    sudo cp /usr/local/MATLAB/MATLAB_Compiler_Runtime/v83/runtime/glnxa64/* /usr/local/MATLAB/MATLAB_Compiler_Runtime/v83/bin/glnxa64
    
  • Add the proper library folder to your .profile, such that this change will stay after logout

    ubuntu: gedit .profile
    

    In the end of the file add following lines:

    #MATLAB MCR
    
    export LD_LIBRARY_PATH=/usr/local/MATLAB/MATLAB_Compiler_Runtime/v83/bin/glnxa64
    export XAPPLRESDIR=/usr/local/MATLAB/MATLAB_Compiler_Runtime/v83/X11/app-defaults
    
    export PATH=$PATH:$LD_LIBRARY_PATH
    export PATH=$PATH:$XAPPLRESDIR
    
  • Invoke following code in the terminal to make sure that Ubuntu bug doesn't re-write your variable:

    echo STARTUP=\"/usr/bin/env LD_LIBRARY_PATH=\${LD_LIBRARY_PATH} \${STARTUP}\" | sudo tee /etc/X11/Xsession.d/90preserve_ld_library_path
    
  • Reboot

If this solution doesn't work, try to reinstall MATLAB MCR 8.3 from the MathWorks website and repeat the steps.

Agrarian answered 3/6, 2014 at 9:24 Comment(0)
R
2

In my case (Matlab R2016b = v91), the binary generated by Matlab was accompanied by a shell script which sets up the LD_LIBRARY_PATH for me. If I just run

./run_scriptname.sh

it complains about the missing <deployedMCRroot>. So running the script with

./run_scriptname.sh /home/user/MatlabMCR/v91

it worked out of the box.

For me, it was not obvious that the path shown above is the <deployedMCRroot> because I chose /home/user/MatlabMCR as installation directory. And with the wrong path specified, it led to the same error message.

Rosalindarosalinde answered 17/10, 2017 at 14:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.