问题
I have Tomcat 7 and MCR 8.3 installed on my Ubuntu 14.04 server. Matlab is correctly installed, because I can execute some program, but when I try to execute others i have this error:
Invalid MEX-file '/usr/local/MATLAB/MATLAB_Compiler_Runtime/v83/mcr/toolbox/matlab/sparfun/etree.mexa64': libmwarpack.so: cannot open shared object file: No such file or directory
I set the environment in my /etc/profile.d folder in this way:
MCR_ROOT=/usr/local/MATLAB/MATLAB_Compiler_Runtime/v83
export PATH=$PATH:$MCR_ROOT/bin:$MCR_ROOT/bin/glnxa64
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MCR_ROOT/runtime/glnxa64:$MCR_ROOT/bin/glnxa64:$MCR_ROOT/toolbox/javabuilder:$MCR_ROOT/sys/os/glnxa64:$MCR_ROOT/sys/java/jre/glnxa64/jre/lib/amd64/server:$MCR_ROOT/sys/java/jre/glnxa64/jre/lib/amd64:$MCR_ROOT/sys/java/jre/glnxa64/jre/lib/amd64/native_threads:$MCR_ROOT/mcr/toolbox/matlab/sparfun:$MCR_ROOT:mcr/toolbox
export LD_LIBRARY_PATH
export MCR_CACHE_ROOT=/home/bull/MCR/cache
export XAPPLRESDIR=$MCR_ROOT/X11/app-defaults
I was a bit frustrated and I added some folder more... The etree.mexa64 and libmwarpack.so files are correctly located.
回答1:
For MATLAB, try setting the LD_RUN_PATH
as you would for LD_LIBRARY_PATH
. I think this is a small idiosyncrasy of MATLAB.
来源:https://stackoverflow.com/questions/28560592/tomcat-and-matlab-mcr-invalid-mex-file-error