Last modified on 11 April 2014, at 17:57

SPM/Installation on 64bit Windows


PreambleEdit

Installing SPM on Windows 64 bit (XP, Vista, 7, 8) should be straightforward. There are pitfalls common to all versions of SPM:

  • It is not recommended to install SPM in MATLAB's toolbox folder as MATLAB toolbox directories can be cached and changes in SPM files (such as updates) might not appear when using SPM. See Toolbox Path Caching and rehash
  • If you get errors regarding "gui_mainfcn", you have to reset your MATLAB path (probably following an installation of a new MATLAB release), use the button "Default" in File > Set Path. See also restoredefaultpath.
  • If you use WinZip to unpack SPM's *.tar.gz archives, make sure to uncheck "Tar file smart CR/LF conversion", which is under the "miscellaneous" tab in "configuration" under "options", as it could corrupt some of SPM files otherwise. 7-Zip is a good open source software alternative.
  • If you see garbled text or incorrect characters in the interface, you have to change your system locale so that it matches your user locale. See How the MATLAB process uses locale settings and Setting the locale. If problems persist, try the instructions detailed at the end of this page.
  • If you have an error "Where is spm_check_version.m?", make sure not to start SPM when your MATLAB current directory is C:\Windows\system32 and not to have this directory in your MATLAB path. See MathWorks support.

SPM8Edit

InstallationEdit

  • Download spm8.zip.
  • Unzip spm8.zip in a folder of your choice, such as C:\Users\login\Documents\MATLAB\spm8).
  • Start MATLAB and add SPM into your path, either using File > Set Path > Add Folder... or typing
>> addpath C:\Users\login\Documents\MATLAB\spm8

in MATLAB's workspace.

  • Launch SPM by typing
>> spm

UpdateEdit

If you have just downloaded the spm8.zip archive, it already contains the latest set of updates. To update SPM when a new version is released:

  • Download spm8_updates_rxxxx.zip
  • Unzip spm8_updates_rxxxx.zip on top of the folder containing your SPM installation so that newer files overwrite existing files.

Alternatively, you can use the spm_update.m function:

>> spm_update

If a new version is available, it can be applied to your local installation by typing:

>> spm_update update

CompilationEdit

Precompiled MEX files (*.mexw64) are provided with SPM8 and you shouldn't need to recompile them by yourself.

See Compilation of SPM8 MEX files on Windows if needed.

SPM5Edit

InstallationEdit

  • Download spm5.zip.
  • Unzip spm5.zip in a folder of your choice, such as C:\spm\spm5).
  • Start MATLAB and add SPM into your path, either using File > Set Path > Add Folder... or typing
>> addpath C:\spm\spm5

in MATLAB's workspace.

  • Launch SPM by typing
>> spm

CompilationEdit

Precompiled MEX files (*.mexw64) are provided with SPM5 and you shouldn't need to recompile them by yourself.

Another set of precompiled MEX files can be found here:

SPM2Edit

To use SPM2 on 64 bit Windows, you need to install SPM2 and SPM2_x64_Patch.zip that can be found here:

TroubleshootingEdit

If text still appears garbled in the interface after changing the system locale, try the following:

cd(spm('Dir'))
load spm_Menu.fig -mat
hgS_070000.properties.DefaulttextFontName='Arial Narrow';
hgS_070000.properties.DefaultuicontrolFontName='Arial Narrow';
save spm_Menu.fig hgS_070000 -v6
load spm_Welcome.fig -mat
hgS_070000=spm_changepath(hgS_070000,'Helvetica','Arial Narrow');
save spm_Welcome.fig hgS_070000 -v6
set(0,'defaultTextFontName','Arial Narrow') 
set(0,'defaultUicontrolFontName','Arial Narrow') 

Edit spm/matlabbatch/private/cfg_mlbatch_defaults.m and modify lines:

cfg_defaults.cfg_ui.lfont.FontName   = 'Arial Narrow';
cfg_defaults.cfg_ui.bfont.FontName   = 'Arial Narrow';