Last active
August 29, 2015 14:07
-
-
Save brockpalen/3de41f7bed218f948e24 to your computer and use it in GitHub Desktop.
Demenstrate the use of MATLAB MCC to make standalone executables.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#compile source on Flux | |
module load matlab/2014a | |
mcc -m implicitthreads.m |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%fills random large matrix and vector solves for unknown | |
%[email protected] | |
%10/2014 | |
%used to demonstate built in matlab threading | |
% solved Ax=b | |
function implicitthreads(dim) | |
if ischar(dim) | |
dim=str2num(dim) | |
end | |
A=rand(dim); | |
b=rand(dim,1); | |
x=zeros(dim,1); | |
tic | |
x=A\b; | |
toc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#use run_<programname>.sh <MCR root> <args> | |
#that file is created by the compiler and needs to be copied along with the executable | |
./run_implicitthreads.sh $WORK/mcr/v83 1000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#install the correct MCR (MATLAB Compiler Runtime) for your MATLAB version | |
# http://www.mathworks.com/products/compiler/mcr/ | |
#This need only be done once | |
#use $WORK to have sufficent space | |
mkdir $WORK/mcr | |
cd $WORK/mcr | |
wget http://www.mathworks.com/supportfiles/downloads/R2014a/deployment_files/R2014a/installers/glnxa64/MCR_R2014a_glnxa64_installer.zip | |
unzip MCR_R2014a_glnxa64_installer.zip | |
./install -mode silent -agreeToLicense yes -destinationFolder $WORK/mcr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment