Print

Print


I am trying to compile an spm8 batch script as a shell script to be run from the linux command prompt, so that it can be run on a remote server in a high-performance computing environment. I have done this successfully with other matlab scripts using the mcc command (matlab 2010a). The spm8 batch script (for normalization) that I'm trying to compile runs fine from the matlab command prompt. The process of compiling this script runs smoothly, but when I try to run the compiled version I get error messages regarding cfg_mlbatch_appcfg_master and local_initapps (full output pasted below).

I'm actually compiling a script which calls the normalization batch script. The relevant lines in that (the lines it gets to when the error output appears) are:

spm('Defaults','fmri')
spm_jobman('initcfg'); % recommended by the ouput from running normalize_batchscript_generic from mlab command prompt
normalize_batchscript_generic % line 74

I've been attempting to fix the problem by adding spm scripts mentioned in error outputs to the list of scripts to compile in my mcc command:
mcc -C -R -nodisplay -R -nojvm -R -singleCompThread  -m -v -w enable -d ./compilenormsmoothdeploydir fieldtriptocpcaimageprep.m spm_jobman.m cfg_util.m cfg_mlbatch_appcfg.m

However, I have no way around the cfg_mlbatch_appcfg_master and local_initapps errors below. I tried downloading the latest spm8 updates but the only difference that made was to change the line numbers in the error message. I tried entering 'run_nogui' instead of 'serial' in the first option when calling spm_jobman:

spm_jobman('serial', jobs, '', inputs{:}); % line 14.

but that didn't make any difference.

Any suggestions, anyone?

Jen Whitman

error output when trying to run compiled script from linux command prompt:

------------------------------------------
Setting up environment variables
---
LD_LIBRARY_PATH is .:/opt/MATLAB_Compiler_Runtime/v713//runtime/glnxa64:/opt/MATLAB_Compiler_Runtime/v713//bin/glnxa64:/opt/MATLAB_Compiler_Runtime/v713//sys/os/glnxa64:/opt/MATLAB_Compiler_Runtime/v713//sys/java/jre/glnxa64/jre/lib/amd64/native_threads:/opt/MATLAB_Compiler_Runtime/v713//sys/java/jre/glnxa64/jre/lib/amd64/server:/opt/MATLAB_Compiler_Runtime/v713//sys/java/jre/glnxa64/jre/lib/amd64/client:/opt/MATLAB_Compiler_Runtime/v713//sys/java/jre/glnxa64/jre/lib/amd64
Extracting CTF archive. This may take a few seconds, depending on the
 size of your application. Please wait...
...CTF archive extraction complete.
run 1 of 1
Warning: Run spm_jobman('initcfg'); beforehand
> In spm_jobman at 107
  In normalize_batchscript_generic at 14
??? Undefined function or variable 'cfg_mlbatch_appcfg_master'.

Error in ==> cfg_util>local_initapps at 1283



Error in ==> cfg_util at 619



Error in ==> spm_jobman at 160



Error in ==> spm_jobman at 109



Error in ==> normalize_batchscript_generic at 14



Error in ==> imageprep at 74


 

MATLAB:UndefinedFunction