0

I am trying to use MCR to run an executable file that I created using

mcc -mv mycode.m

I installed MCR (2017a Matlab) for Mac from here https://uk.mathworks.com/products/compiler/matlab-runtime.html. After this, I edited the .bashrc file to set the path as instructed at the end of installation by:

export DYLD_LIBRARY_PATH=/Applications/MATLAB/MATLAB_Runtime/v92/runtime/maci64:/Applications/MATLAB/MATLAB_Runtime/v92/sys/os/maci64:/Applications/MATLAB/MATLAB_Runtime/v92/bin/maci64

After the above I typed in terminal to run the executable file as:

sh mycode.sh

But this gives the following message

Usage: mycode.sh deployedMCRroot args

Can anyone help me with what I may be missing here?

I am right now installing MCR on the same machine on which I used MATLAB to generate executable file. I am doing this to test the output file.

pirho
  • 11,565
  • 12
  • 43
  • 70
P_0frF67
  • 11
  • 3
  • If you are on "El Capitan" or later, `DYLD_LIBRARY_PATH` won't work the same way it did before. I'm not sure if this use case would be affected, but I presume so. See https://stackoverflow.com/questions/35568122/why-isnt-dyld-library-path-being-propagated-here – Cris Luengo Jan 22 '18 at 21:14

1 Answers1

1

deployedMCRroot refers to the directory in which you installed the MCR. Supposing that your script doesn't require any additional argument, if you installed MCR under /Applications/MCR/, you should type the following command in order to make your script work:

sh mycode.sh /Applications/MCR/

Normally, at installation time, the MCR framework is installed in the chosen directory but placed into a subfolder describing its version. So it's possible that you may be required the correct MCR framework specifying the proper version as follows:

sh mycode.sh /Applications/MCR/v70/
Tommaso Belluzzo
  • 23,232
  • 8
  • 74
  • 98