SPM Installation with MATLAB¶
Prerequisites
The SPM software is a collection of MATLAB functions and thus requires the MATLAB (or GNU Octave) software to be installed on your computer in order to run. SPM requires only core MATLAB to run (no special toolboxes are required - unless stated otherwise).
SPM is tested against MATLAB 2020a and newer but may work with earlier versions.
Installation¶
-
Download the spm ZIP file (not standalone) from the newest GitHub release.
-
Unzip
spm_<version>.zip
in a folder of your choice, such asC:\Users\login\Documents\MATLAB\spm
. -
Start MATLAB and add SPM to your path, either using:
Home
Set Path
Add Folder...
: select the directory containing your SPM installation then click onSave
andClose
.or type the following at the MATLAB prompt:
-
Download the spm ZIP file (not standalone) from the newest GitHub release in your home directory.
-
Uncompress the archive by typing the following in a terminal:
-
Start MATLAB and add SPM to your path, either using:
Home
Set Path
Add Folder...
: select the directory containing your SPM installation then click onSave
andClose
.or typing the following at the MATLAB prompt:
MEX file validation issues (Apple Silicon)
If you have validation issues with MEX files with one of these errors:
"*.mexmaca64" cannot be opened because the developer cannot be verified.
macOS cannot verify that this app is free from malware
Code signature not valid for use in process using Library Validation: library load disallowed by system policy
cd
to the SPM directory and type:
If it doesn’t work, please try this equivalent alternative, replacing SPM_PATH
with the path of your SPM installation:
MEX file validation issues (Intel Mac)
If you have validation issues with MEX files with one of these errors:
"*.mexmaci64" cannot be opened because the developer cannot be verified.
macOS cannot verify that this app is free from malware
Code signature not valid for use in process using Library Validation: library load disallowed by system policy
cd
to the SPM directory and type:
If it doesn’t work, please try this equivalent alternative, replacing SPM_PATH
with the path of your SPM installation:
-
Download the spm ZIP file (not standalone) from the newest GitHub release in your home directory.
-
Uncompress the archive by typing the following in a terminal:
-
Start MATLAB and add SPM to your path, either using:
Home
Set Path
Add Folder...
: select the directory containing your SPM installation then click onSave
andClose
.or typing the following at the MATLAB prompt:
Crash at startup
The following concerns a situation where MATLAB generates a segmentation fault when opening the SPM interface with errors like:
BadWindow (invalid Window parameter)
serial 20133 error_code 3 request_code 20 minor_code 0
Pango-CRITICAL **: pango_font_description_from_string: assertion 'str != NULL' failed
GLib-CRITICAL **: g_once_init_leave: assertion 'result != 0' failed
GLib-GObject-CRITICAL **: g_type_register_dynamic: assertion 'parent_type > 0' failed
This is likely to be an issue with the display of the welcoming message in the Graphics window as a web document.
One fix is to comment one line in spm.m.. Another fix not requiring to modify the SPM source code is to define an environment variable.:
If you are using MATLAB without its desktop, you can open the Set Path dialog box by typing pathtool
at the MATLAB prompt.
Danger
If using the graphical interface, make sure to use the Add Folder...
button and not Add with Subfolders...
. SPM will automatically add the appropriate subfolders to the MATLAB path at runtime.
You can then launch SPM by typing spm
at the MATLAB prompt.
Update¶
If you have just downloaded the spm_<version>.zip
archive, it already contains the latest set of updates. To update SPM when a new version is released:
- Download the latest
spm_<version>.zip
. - Replace your current SPM installation with the newer version so that newer files overwrite existing files.
Alternatively, you can use the spm_update.m
function:
If a new version is available, it can be applied to your local installation by typing: