I am trying to run PSPM for SCR analysis using latest Matlab release (R2017b) on MacOS Sierra 10.12.6. During EDF data import I encountered the following error:
Running 'Import'
Importing /Volumes/My Book Pro/EmoCon/dane_edf/1pok_exp/LOMMOP.edf ...Failed 'Import'
Invalid MEX-file '/Users/michal/toolboxes/pspm/Import/fieldtrip/read_16bit.mexmaci64': dlopen(/Users/michal/toolboxes/pspm/Import/fieldtrip/read_16bit.mexmaci64, 6): Library not loaded: @loader_path/libmex.dylib
Referenced from: /Users/michal/toolboxes/pspm/Import/fieldtrip/read_16bit.mexmaci64
Reason: image not found.
In file "/Users/michal/toolboxes/pspm/Import/fieldtrip/read_edf.m" (v27), function "readLowLevel" at line 376.
In file "/Users/michal/toolboxes/pspm/Import/fieldtrip/read_edf.m" (v27), function "read_edf" at line 344.
In file "/Users/michal/toolboxes/pspm/Import/fieldtrip/ft_read_data.m" (v701), function "ft_read_data" at line 463.
In file "/Users/michal/toolboxes/pspm/scr_get_edf.m" (v63), function "scr_get_edf" at line 25.
In file "/Users/michal/toolboxes/pspm/scr_import.m" (v701), function "scr_import" at line 181.
In file "/Users/michal/toolboxes/pspm/scr_cfg/scr_cfg_run_import.m" (v357), function "scr_cfg_run_import" at line 68.
The following modules did not run:
Failed: Import
I also use SPM and after moving to Matlab R2017b I had to recompile SPM's mex files, following the instructions in SPM wikibook. I suppose it is a similar case here, with PSPM, but I don't know how to handle it.
Do you have any recommendations on how to proceed?
Best regards
Michał Szczepanik
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
libmex.dylib does not seem to be found, which is a bit odd because it should be present, as it is part of Matlab itself. Also referring to fieldtrip, it should be compatible with MacOS without recompiling it. Maybe you could solve the problem by changing the search path for dylib. Unfortunately I'm not very familiar with MacOS but a bit of googling led me to http://www.manpagez.com/man/1/dyld/ . So maybe you could try to modify your environment using setenv() / getenv() to correct the search path. The variable DYLD_LIBRARY_PATH might be interesting. The libmex.dylib should be in <MATLAB-PATH>/bin/maci64/ (might not be exactly maci64 but).
As the new year dawned, I realised that I have left this issue without any response. So, for the record: in PSPM 3.1, recompiling the read_16bit mex files (from fieldtrip) made the mex-related error go away, although import subsequently failed for another reason anyway.
However, in PSPM 4.0, import works like a charm, without me having to change anything. So I think whatever caused these problems has been fully resolved. Thank you for your assistance and for the new release.
Best regards
Michał
Last edit: Michał Szczepanik 2018-01-04
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello
I am trying to run PSPM for SCR analysis using latest Matlab release (R2017b) on MacOS Sierra 10.12.6. During EDF data import I encountered the following error:
I also use SPM and after moving to Matlab R2017b I had to recompile SPM's mex files, following the instructions in SPM wikibook. I suppose it is a similar case here, with PSPM, but I don't know how to handle it.
Do you have any recommendations on how to proceed?
Best regards
Michał Szczepanik
Hi Michał
libmex.dylib does not seem to be found, which is a bit odd because it should be present, as it is part of Matlab itself. Also referring to fieldtrip, it should be compatible with MacOS without recompiling it. Maybe you could solve the problem by changing the search path for dylib. Unfortunately I'm not very familiar with MacOS but a bit of googling led me to http://www.manpagez.com/man/1/dyld/ . So maybe you could try to modify your environment using setenv() / getenv() to correct the search path. The variable DYLD_LIBRARY_PATH might be interesting. The libmex.dylib should be in <MATLAB-PATH>/bin/maci64/ (might not be exactly maci64 but).
If you want to recompile the fieldtrip functions I would download fieldtrip from the website and follow this document: http://www.fieldtriptoolbox.org/faq/compile#general_compilation_of_most_mex_files . After recompiling you can replace the folder/Import/fieldtrip/fileio with fileio from the fieldtrip root.
I hope this helps.
Best regards
Tobias
As the new year dawned, I realised that I have left this issue without any response. So, for the record: in PSPM 3.1, recompiling the read_16bit mex files (from fieldtrip) made the mex-related error go away, although import subsequently failed for another reason anyway.
However, in PSPM 4.0, import works like a charm, without me having to change anything. So I think whatever caused these problems has been fully resolved. Thank you for your assistance and for the new release.
Best regards
Michał
Last edit: Michał Szczepanik 2018-01-04
Thnaks for letting us know - this is excellent news! Dominik