In development machine where MATLAB and MATLAB Compiler is installed
As of R2020b, MATLAB Compiler does not support OS cross compile, so you need to use MATLAB on Linux if the target machine is Linux.
- Open Application Compiler app.
- Specify m files in Main File panel.
- If you want to include MATLAB Runtime in your package, check "Runtime included in package" radio button.
If MATLAB cannot fine MATLAB Runtime installer (.zip file), a pop up window appears.
You can select "Download from Web" or "Specify Location".
This is the location of installer (.zip file) and not an installed path.
You can download the installer from the following.
By MATLAB command,
compiler.runtime.download
By web browser.
In target machine
- Install the package and MATLAB Runtime.
- Set MATLAB Runtime path to LD_LIBRARY_PATH. As described in this document.
setenv 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
where mcr_root is the location of MATLAB Runtime (ex, /usr/local/MATLAB/MATLAB Runtime/v99).
3. Run the execution file.
or, if you skipt the previous 2 (LD_LIBRARY_PATH), you can use run_xxx.sh script with specifying MATLAB Runtime path.
./run_yourapp.sh /path/to/MATLAB_Runtime arg1 arg2