Dear Rodrigo,
The script that we use to compile SPM is in
spm12/config/spm_make_standalone.m. You are doing the right thing in
using the -a <spm12_DIR> option for mcc; could it be that MYSCRIPT.m
should be the last argument in the function call?
Otherwise, you should be able to use spm_make_standalone to compile,
passing your script as the 'gateway' input argument.
That said, if MYSCRIPT.m is indeed a script only calling MATLAB or SPM
functions, you shouldn't even have to do the compilation yourself and
should be able to use the SPM standalone instead:
https://en.wikibooks.org/wiki/SPM/Standalone
./run_spm12.sh <MCR> script MYSCRIPT.m
Best regards,
Guillaume.
On 18/04/18 16:34, Rodrigo Perea wrote:
> Hi SPM community,
> I am trying to compile the function spm_vol() so I can deploy it and run it as a wrapper for imaging processing in my institution’s cluster supercomputer that uses a pbs system.
>
> I believe I am having difficulties compiling the @nifti/private/read_hdr.m function when compiled in MATLAB2016a
>
> Here are my different tries:
>
> TRY 1: In terminal when I compile using
> mcc -m MYSCRIPT.m -a <spm12_DIR>
>
> Gives me the following error:
>
> USING SPM:
> Undefined function 'read_hdr' for input arguments of type 'char'.
> Error in nifti (line 26)
> Error in spm_vol_nifti (line 19)
> Error in spm_vol>spm_vol_hdr (line 154)
> Error in spm_vol (line 88)
> .
> .
> .
>
>
> TRY 3:
> Then I try addind the @nifti/private/*.m functions to a <PRIVATE_FNs> (e.g. `cp <spm12>/@nifti/private/*.m` <PRIVATE_FNs> ) and run:
>
> mcc -m MYSCRIPT.m -a <PRIVATE_FNs>
> * (spm12 should be added from my startup.m ~isdeployed() condition…) :
>
> Which gives me the error of other dependencies…
>
> USING SPM:
> Undefined function 'fname' for input arguments of type 'struct'.
> Error in file_array (line 32)
> Error in nifti (line 69)
> Error in spm_vol_nifti (line 19)
> Error in spm_vol>spm_vol_hdr (line 154)
> Error in spm_vol (line 88)
> .
> .
> .
> *same results (or fails) as when I tried: mcc -m MYSCRIPT.m -a <spm12>/@nifti/private/*.m
>
>
> TRY 2:
> So then I tried adding all the private functions in a folder I called <PRIVATE_FNs> (e.g. `cp <spm12>/*/private/*.m <PRIVATE_FNs>/ `) and run:
>
> mcc -m MYSCRIPT.m -a <PRIVATE_FNs>
>
> *spm12 should be added from my startup.m ~isdeployed() condition:
>
> Which five me the following error:
>
> USING SPM:
> Reference to non-existent field 'dtype'.
> Error in read_hdr (line 45)
> Error in nifti (line 26)
> Error in spm_vol_nifti (line 19)
> Error in spm_vol>spm_vol_hdr (line 154)
> Error in spm_vol (line 88)
> .
> .
>
>
> TRY 4:
> Finally, I tried adding explicitly all @ functions but still getting the same error as TRY1:
> mcc -m MYSCRIPT.m -a <spm12>/@*
>
> USING SPM:
> Undefined function 'read_hdr' for input arguments of type 'char'.
> Error in nifti (line 26)
> Error in spm_vol_nifti (line 19)
> Error in spm_vol>spm_vol_hdr (line 154)
> Error in spm_vol (line 88)
> .
> .
> .
>
>
> Any suggestions on how to make this work? I could change MATLAB versions but I hardly think the problem is in it.
>
> Thanks in advance,
>
> Rodrigo
>
--
Guillaume Flandin, PhD
Wellcome Trust Centre for Neuroimaging
University College London
12 Queen Square
London WC1N 3BG
|