Linux上安装并启动MATLAB MCR

项目需要在另外的服务器上部署,代码中有一部分是MATLAB写的,没打短时间内转成python的,因此需要在服务器上安装MATLAB。

但是考虑到MATLAB体积太大,而计算只需要MATLAB的运行环境就可以了,因此考虑采用MATLAB Runtime,安装到服务器上。

具体的步骤如下:

首先,下载MCR
地址是:
https://www.mathworks.com/products/compiler/matlab-runtime.html
选择对应的版本,这里选择的是 MCR_R2018a_glnxa64_installer.zip

下载好之后,解压 unzip MCR_R2018a_glnxa64_installer.zip 

安装说明: 

官网上给出了具体的教程: 
https://www.mathworks.com/help/compiler/install-the-matlab-runtime.html#bvf6b29

本次安装采用的是静默安装,并且安装到默认的目录下/usr/local/MATLAB/MATLAB_Runtime/v94/
因此只需要输入: 

./install -mode silent -agreeToLicense yes

安装好之后,运行之前编译好的MATLAB程序: 

./run_get_liangtibuwei.sh /usr/local/MATLAB/MATLAB_Runtime/v94

运行正常的话,会输出结果。

报错情况: 

部分情况下会报错,本次出现过两次报错,两次错误只发生在没有图像界面的Ubuntu系统中,而带有图像界面的
Ubuntu则没有出现过该问题。(
Some graphics libraries such as Julia's GR.jl and Python's VTK require X11 (Linux's windowing system) support files. You're might encounter the following error when running your code: libXt.so.6: cannot open shared object file: No such file or directory):

1) start failed: libXt.so.6: cannot open shared object file: No such file or directory

解决办法:

https://help.codeocean.com/tips-and-tricks/installation-tips/missing-libxtso6-installing-x11-dependencies

sudo apt-get install libxt6

2) 
Can't reload '/usr/local/MATLAB/MATLAB_Runtime/v93/bin/glnxa64/libmwcoder_types.so'"

解决办法:

https://www.mathworks.com/matlabcentral/answers/363058-deploying-standalone-matlab-exe-on-a-linux-based-server

sudo apt-get -y install xserver-xorg

你可能感兴趣的:(深度学习)