The solution is that the necessary directories need to be explicitly given via the option -I:
mcc -C -mv -R -singleCompThread -R -nodisplay -I /cm/shared/apps/matlab/spm/08/ -I /cm/shared/apps/matlab/spm/08/spm_orthviews -I /cm/shared/apps/matlab/spm/08/config -I /cm/shared/apps/matlab/spm/08/matlabbatch -I /cm/shared/apps/matlab/spm/08/matlabbatch/cfg_confgui -I /cm/shared/apps/matlab/spm/08/matlabbatch/cfg_basicio -I /cm/shared/apps/matlab/spm/08/matlabbatch/cfg_basicio/src -I /cm/shared/apps/matlab/spm/08/matlabbatch/examples -I /cm/shared/apps/matlab/spm/08/src -I /cm/shared/apps/matlab/spm/08/toolbox -I /cm/shared/apps/matlab/spm/08/toolbox/mixture -I /cm/shared/apps/matlab/spm/08/toolbox/spectral -I /cm/shared/apps/matlab/spm/08/toolbox/Seg -I /cm/shared/apps/matlab/spm/08/toolbox/Beamforming -I /cm/shared/apps/matlab/spm/08/toolbox/DEM -I /cm/shared/apps/matlab/spm/08/toolbox/DARTEL -I /cm/shared/apps/matlab/spm/08/toolbox/MEEGtools -I /cm/shared/apps/matlab/spm/08/toolbox/Neural_Models -I /cm/shared/apps/matlab/spm/08/toolbox/dcm_meeg -I /cm/shared/apps/matlab/spm/08/toolbox/SRender -I /cm/shared/apps/matlab/spm/08/toolbox/Shoot -I /cm/shared/apps/matlab/spm/08/toolbox/HDW -I /cm/shared/apps/matlab/spm/08/toolbox/FieldMap -I /cm/shared/apps/matlab/spm/08/EEGtemplates -I /cm/shared/apps/matlab/spm/08/canonical -I /cm/shared/apps/matlab/spm/08/rend -I /cm/shared/apps/matlab/spm/08/apriori -I /cm/shared/apps/matlab/spm/08/templates -I /cm/shared/apps/matlab/spm/08/external -I /cm/shared/apps/matlab/spm/08/external/fieldtrip -I /cm/shared/apps/matlab/spm/08/external/fieldtrip/plotting -I /cm/shared/apps/matlab/spm/08/external/fieldtrip/fileio -I /cm/shared/apps/matlab/spm/08/external/fieldtrip/statfun -I /cm/shared/apps/matlab/spm/08/external/fieldtrip/src -I /cm/shared/apps/matlab/spm/08/external/fieldtrip/connectivity -I /cm/shared/apps/matlab/spm/08/external/fieldtrip/inverse -I /cm/shared/apps/matlab/spm/08/external/fieldtrip/specest -I /cm/shared/apps/matlab/spm/08/external/fieldtrip/forward -I /cm/shared/apps/matlab/spm/08/external/fieldtrip/utilities -I /cm/shared/apps/matlab/spm/08/external/fieldtrip/preproc -I /cm/shared/apps/matlab/spm/08/external/fieldtrip/trialfun -I /cm/shared/apps/matlab/spm/08/external/yokogawa -I /cm/shared/apps/matlab/spm/08/external/eeprobe -I /cm/shared/apps/matlab/spm/08/external/mne -I /cm/shared/apps/matlab/spm/08/external/ctf -I /cm/shared/apps/matlab/spm/08/external/bemcp -I /cm/shared/apps/matlab/spm/08/tpm myprog.m
It is probably possible to reduce the number of directories which need to be specified by using the option -a, which can add directories recursively.
Best Answer