Last modified on 25 July 2014, at 18:16

SPM/Installation on 64bit Mac OS (Intel)


PreambleEdit

If you use drag-and-drop in Finder to install the updates, it will actually perform a folder copy and not a folder merge so that updated files will be overwritten but unchanged old files will be deleted (see this thread). Using the command line option as described below will overcome this.

SPM12Edit

Mac Intel with 64bit MATLAB is a supported SPM12 platform. Precompiled MEX files (*.mexmaci64) are included in the SPM distribution.

InstallationEdit

Download spm12.zip and its updates spm12_updates_rxxxx.zip in your home directory then type the following in a Terminal:

cd /Users/login
unzip spm12.zip
unzip -o spm12_updates_rxxxx.zip -d spm12

Start MATLAB and add SPM into your path, either using File > Set Path > Add Folder... or typing

addpath /Users/login/spm12

in MATLAB's workspace.

CompilationEdit

Should you want to compile SPM MEX files, you need to have Apple's development environment Xcode installed.

You also need to have the mex executable in your system path. To do so, type the following in a Terminal:

export PATH=$PATH:/Applications/MATLAB_R2009a.app/bin

with the appropriate path where MATLAB is installed

Then, in a Terminal, from the src folder of your SPM8 installation, type:

cd /Users/login/spm12/src
make distclean
make && make install
make external-distclean
make external && make external-install

If you get errors such as Bad : modifier in $ (/), this is because the instructions are given for a bash Terminal while you are using a tcsh Terminal. The equivalent commands are:

setenv PATH ${PATH}:/Applications/MATLAB_R2009a.app/bin

SPM8Edit

Mac Intel with 64bit MATLAB (available since R2009b) is a supported SPM8 platform. Precompiled MEX files (*.mexmaci64) are included in the SPM distribution.

InstallationEdit

Download spm8.zip and its updates spm8_updates_rxxxx.zip in your home directory then type the following in a Terminal:

cd /Users/login
unzip spm8.zip
unzip -o spm8_updates_rxxxx.zip -d spm8

Start MATLAB and add SPM into your path, either using File > Set Path > Add Folder... or typing

addpath /Users/login/spm8

in MATLAB's workspace.

CompilationEdit

Should you want to compile SPM MEX files, you need to have Apple's development environment Xcode installed. It should be available on your Mac OS X installation DVD.

You also need to have the mex executable in your system path. To do so, type the following in a Terminal:

export PATH=$PATH:/Applications/MATLAB_R2009a.app/bin

with the appropriate path where MATLAB is installed

Then, in a Terminal, from the src folder of your SPM8 installation, type:

cd /Users/login/spm8/src
export MACI64=1
make distclean
make && make install
make toolbox-distclean
make toolbox && make toolbox-install
make external-distclean
make external && make external-install

If you get errors such as Bad : modifier in $ (/), this is because the instructions are given for a bash Terminal while you are using a tcsh Terminal. The equivalent commands are:

setenv PATH ${PATH}:/Applications/MATLAB_R2009a.app/bin
setenv MACI64 1

SPM5Edit

Precompiled MEX files for Mac Intel with 64bit MATLAB (*.mexmaci64) are available in the latest update.

InstallationEdit

Download spm5.zip in your home directory then type the following in a Terminal:

cd /Users/login
unzip spm5.zip

Start MATLAB and add SPM into your path, either using File > Set Path > Add Folder... or typing

addpath /Users/login/spm5

in MATLAB's workspace.

CompilationEdit

If you want to compile SPM5 MEX files by yourself, you need to have Xcode installed and mex in your system path (see SPM8 for details).

Then, in a Terminal, from the src folder of your SPM5 installation, type:

cd /Users/login/spm5/src
export MACI64=1
make distclean
make && make install

SPM2Edit

There are no plans to provide SPM2 64bit MEX files for Mac Intel.

TroubleshootingEdit

"This is pdfTeX, Version ..." errorEdit

If you get an error message such as:

mex -O -c spm_vol_utils.c -DSPM_UNSIGNED_CHAR 
mex: unrecognized option `-O'
mex: unrecognized option `-c'
This is pdfTeX, Version 3.1415926-2.3-1.40.12 (TeX Live 2011)
restricted \write18 enabled.
entering extended mode
(./spm_vol_utils.c
This is MeX  Version 1.05  18 XII 1993  (B. Jackowski & M. Ry\'cko)
! You can't use `macro parameter character #' in vertical mode.

this is due to a conflict between MATLAB mex and a LaTeX command with the same name. Edit src/Makefile.var and mention the full path when referring to MEXBIN

MEXBIN = /Applications/MATLAB_R2012a.app/bin/mex