How To Create A Standalone Executable from MATLAB m-files
A standalone executable is built with the MATLAB compiler mcc.
You can run the standalone on a similar computer without MATLAB installed.
On such a computer, however, the
MATLAB Compiler Runtime (MCR) library, available free of charge from Mathworks, must be installed.
The standaloneDemo folder
makefile.m -- app-specific m-file to help make.m create exec
make.m -- performs the compilation (>> make )
myApp.m -- example user application's main program
myStandalone.m -- optional starting m-file
mybash.txt -- append to your .bashrc file
mycsh.txt -- append to your .cshrc file
README.html -- this file
run-matlab-standalone.zip -- zip file of this directory
run_standalone_job -- batch script for running standalone
Procedures for generating and running a MATLAB standalone on the SCC (or other Linux clusters)
If you do not have access to Boston University's Shared Computing Cluster (SCC), you may download the standaloneDemo.zip file. Upon unzipping it, follow the steps starting from "cd run-matlab-standalone"
If you have access to Boston University's Shared Computing Cluster (SCC), it is more convenient to
scc1$ source ~/.bashrc <== if you run the bash shell
scc1% source ~/.cshrc <== if you run the csh shell
To run executable myExecR2013a
interactively from xterm (xwin32, MobaXterm) scc1$ ./myExecR2013a 2000 4 <== n, nprocs are input to executable
Submit one batch job via command line scc1$ qsub -V -pe omp 4 -b y "./myExecR2013a 2000 4"
Submit one batch job via batch script scc1$ qsub -V ./run_standalone_job
Launch multiple batch jobs via qsub Array Job option
scc1$ qsub ./run_standalone_job <== run 1 job n = 1000
scc1$ qsub -t 3 ./run_standalone_job <== run 1 job; SGE_TASK_ID = 3;
scc1$ qsub -t 4-6 ./run_standalone_job <== run 3 jobs; SGE_TASK_ID = [4,5,6];
The qsubs Array Jobs option (-t) generates the environment variable $SGE_TASK_ID upon submission.
Script run_standalone_job computes n = $SGE_TASK_ID * 1000 and pass to myExecR2013a to calculate
the sum of the arithmetic sequence
s = 1 + 2 + 3 + . . . + n
Kadin Tseng, Research Computing Services, IS&T, Boston University
Created : November, 2013
Modified : March, 2014
Note: Research Computing Services (RCS) example programs are provided
"as is" without any warranty of any kind. The user assumes the entire risk of
quality, performance, and repair of any defects. You are encouraged to copy
and modify any of the given examples for your own use.