Dear Maria, I'm surprised that EEGLAB, via FieldTrip, is still relying on SPM8. You indeed need to recompile the MEX files, instructions for macOS are available here: https://en.wikibooks.org/wiki/SPM/Installation_on_64bit_Mac_OS_(Intel)#Compilation_2 If, by chance, EEGLAB was only using spm_bwlabel.mexmaci64 then you could copy over that file from SPM12: https://github.com/spm/spm12/blob/master/spm_bwlabel.mexmaci64 as that version should be more compatible across platforms. Best regards, Guillaume. On 01/04/2019 14:00, Maria Niedernhuber wrote: > Dear list > > I'm processing data in SPM with my student, and I'm getting an invalid > mexfile error for the mex file spm_bwlabel.mexmaci64 on a macbook when > running an eeglab analysis which uses spm functions. I only get the > error on his macbook (OS X Yosemite Version 10.10.4) but not my macbook > (MacOS Movaje, R2017b). Does anyone know of a way to recompile the > mexfiles? I'd be grateful for your help. I am copying the error message > below. We are using eeglab14_1_1_b. > > Thanks a lot and best wishes > Maria > > "Invalid MEX-file '/Users/Ahmed/Documents/Amirs Stuff/Medicine/3rd > Year/Project/Analysis/Matlab > misc/Matlab > packages/eeglab14_1_1b/plugins/Fieldtrip-liteDaily/external/spm8/spm_bwlabel.mexmaci64': > dlopen(/Users/Ahmed/Documents/Amirs Stuff/Medicine/3rd > Year/Project/Analysis/Matlab misc/Matlab > packages/eeglab14_1_1b/plugins/Fieldtrip-liteDaily/external/spm8/spm_bwlabel.mexmaci64, > > 6): > Library not loaded: @loader_path/libmex.dylib > Referenced from: /Users/Ahmed/Documents/Amirs Stuff/Medicine/3rd > Year/Project/Analysis/Matlab > misc/Matlab > > packages/eeglab14_1_1b/plugins/Fieldtrip-liteDaily/external/spm8/spm_bwlabel.mexmaci64 > Reason: image not found." > > > -- > Maria Niedernhuber > PhD candidate in Psychology > Consciousness and Cognition Lab > Dept Psychology, University of Cambridge > twitter: @maria_ndrnh -- Guillaume Flandin, PhD Wellcome Centre for Human Neuroimaging UCL Queen Square Institute of Neurology London WC1N 3BG