I know there are a lot of posts about the topic, this might be a duplicate, but I don't think so. My config is: Matlab R2014b, clang 3.4, Ubuntu 14.04, armadillo-4.600.4.
I have a local install (not system-wise, so including/linking manually) of Armadillo that works fine when outside of Matlab. I'm trying to run a Mex file using Armadillo from Matlab. It compiles fine using the command (truncated for short):
mex -compatibleArrayDims -outdir +mx -L/home/john/.local/arma/lib -larmadillo -I/home/john/.local/arma/include test_arma.cpp
Problem is when I try to run it I get this error:
Error using mx.test_arma
Invalid MEX-file '/path/to/+mx/test_arma.mexa64': libarmadillo.so.4: cannot open shared object file: No such file or directory
The environment variable LD_LIBRARY_PATH
echoed from the shell that started Matlab contains /home/john/.local/arma/lib
(where libarmadillo.so
is), and I also manually added this path within Matlab using setenv('LD_LIBRARY_PATH',...)
. Is there something I'm missing?