- 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 (최근 30일)
이전 댓글 표시
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
채택된 답변
Harsheel
2015년 4월 17일
if ~isdeployed
cd('/media/hdd/work/matlab')
end
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 MATLAB Compiler에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!