- The startup.m file is always included with the compiled application. This is to ensure that the behavior of MATLAB and the compiled application is same during the initialization phase.
- If you want some statements in the startup.m file to NOT execute when the compiled application is running then, wrap those statements under isdeployed . For your use case, I'd do:
Matlab Compiler Standalone Application and startup.m
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Aleksandar Botev
el 9 de Abr. de 2015
Respondida: Harsheel
el 17 de Abr. de 2015
So I'm trying to use the Matlab Compiler in order to build a standalone application which to run on a separate machine using MCR. The actual application follows this guide to benchmark GPU. When I open matlab following this I make the following command to compile the standalone application:
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 by 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 the other machine, given that the environmental variables are set I just execute the command
./gpuTest
The resulting error is:
Cannot CD to /media/hdd/work/matlab (Name is nonexistent or not a directory).
Error in startup (line 1)
Problem is there is no "startup" script from in the folder of the scripts that should have been compiled. However I do have a "startup.m" script which is in my startup folder which in fact exactly executes "cd /media/hdd/work/matlab" and some other stuff.
I have 2 questions:
- Why the heck is it compiling also my startup script at all?
- How can I fix this to just execute the main script?
I'm using Matlab R2014a with the corresponding MCR 8.3.
0 comentarios
Respuesta aceptada
Harsheel
el 17 de Abr. de 2015
if ~isdeployed
cd('/media/hdd/work/matlab')
end
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre MATLAB Compiler en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!