Matlab Compiler and Startup script -


so i'm trying use matlab compiler in order build standalone application run on separate machine using mcr. actual application follows guide benchmark gpu. when open matlab following this make following command:

mcc -mv -o gputest mainbench.m benchfcn.m executebenchmarks.m getdata.m paralleldemo_gpu_backslash.m timesolve.m waitforcpu.m waitforgpu.m 

the output is:

compiler version: 5.1 (r2014a) dependency analysis requirements. parsing file "/media/hdd/work/matlab/gpubench/mainbench.m"     (referenced from: "compiler command line"). parsing file "/media/hdd/work/matlab/gpubench/benchfcn.m"     (referenced from: "compiler command line"). parsing file "/media/hdd/work/matlab/gpubench/executebenchmarks.m"     (referenced from: "compiler command line"). parsing file "/media/hdd/work/matlab/gpubench/getdata.m"     (referenced from: "compiler command line"). parsing file "/media/hdd/work/matlab/gpubench/paralleldemo_gpu_backslash.m"     (referenced from: "compiler command line"). parsing file "/media/hdd/work/matlab/gpubench/timesolve.m"     (referenced from: "compiler command line"). parsing file "/media/hdd/work/matlab/gpubench/waitforcpu.m"     (referenced from: "compiler command line"). parsing file "/media/hdd/work/matlab/gpubench/waitforgpu.m"     (referenced from: "compiler command line"). parsing file "/opt/matlab/r2014a/toolbox/compiler/deploy/deployprint.m"     (referenced from: "compiler command line"). parsing file "/opt/matlab/r2014a/toolbox/compiler/deploy/printdlg.m"     (referenced from: "compiler command line"). 

than on other machine, given environmental variables set execute command

./gputest 

the resulting error is:

cannot cd /media/hdd/work/matlab (name nonexistent or not directory).     error in startup (line 1) 

problem there no "startup" script 1 should have been compiled. have "startup.m" script in startup folder in fact executes "cd /media/hdd/work/matlab" , other stuff.

i have 2 questions:

  1. why heck compiling startup script @ all?
  2. how can fix execute main script?

to answer both questions:

  1. it's compiling startup.m script can ensure main script runs same in regular matlab session. you'll find includes bunch of other stuff that's needed, such preferences folder, again needed ensure runs same in regular matlab session.
  2. @matlabgui has provided similar answer, apply isdeployed within startup script block out don't want run in deployed version. personally, put following @ top of startup script, block everything.

startup.m

if isdeployed     return end 

Popular posts from this blog