Matlab native for M1 apple beta and brainstorm -nogui

Dear Brainstorm team,

Apple has released native beta
Exploring the MATLAB beta for Native Apple Silicon » The MATLAB Blog - MATLAB & Simulink (mathworks.com)
I am playing with it, and the brainstorm 'nogui' doesnt start, with the following error

Error using bst_get
Unsupported extension.

Error in bst_plugin>GetSupported (line 125)
    OsType = bst_get('OsType', 0);

Error in bst_plugin>MenuCreate (line 2193)
    PlugDesc = GetSupported();

Error in bst_plugin (line 110)
eval(macro_method);

Error in gui_brainstorm>CreateWindow (line 173)
        jMenusPlug = bst_plugin('MenuCreate', jMenuPlugins, fontSize);

Error in gui_brainstorm (line 33)
eval(macro_method);

Error in gui_initialize (line 30)
GlobalData.Program.GUI = gui_brainstorm('CreateWindow');

Error in bst_startup (line 359)
gui_initialize();

Error in brainstorm (line 103)
        bst_startup(BrainstormHomeDir, 1, BrainstormDbDir);

This is probably because this beta has problem with how native m1 release support graphics atm
I putting this here so you will have this under radar, the Matlab team asks for feedback and evaluation
https://nl.mathworks.com/support/apple-silicon-r2022a-beta.html
in case something is needed to support Brainstorm native under M1 users may push for it now

Also in my understanding, brainstorm -nogui shouldnt try to initialize gui, which is the problem here

EDIT: The real reason of error is that the mexext isn' supported yet for mexmaca64,

i dont expect that it will happen before official release of Matlab for apple architecture in Autumn, I am just discussing this on forum here :wink:

1 Like

Wow !! That’s a great news if MATLAB is finally native for the M1 Mac ! Thanks for the info.

The real reason of error is that the mexext isn' supported yet for mexmaca64,

I added "maca64" in the list of supported mex extensions: (Added mex extension mexmaca64 for Mac ARM M1 systems · brainstorm-tools/brainstorm3@98927dd · GitHub)

Please update Brainstorm and try again.

Also in my understanding, brainstorm -nogui shouldnt try to initialize gui, which is the problem here

brainstorm nogui starts the GUI internally but doesn't show it.
brainstorm server works without Java (and without any graphical elements).
https://neuroimage.usc.edu/brainstorm/Tutorials/Scripting#Starting_Brainstorm

Matlab2022b is officially out : Release Notes for MATLAB - MATLAB & Simulink

As soon as I get my hand on a license, I will do some tests. I guess we might need to recompile some mex for the M1 chip :slight_smile:

Edit: it seems matlab2022b is still using rosetta ... Mac System Requirements - MATLAB & Simulink

Matlab native for M1 was released as beta under R2022b, beta will be open until end of June
https://blogs.mathworks.com/matlab/2022/12/08/playing-with-the-r2022b-matlab-apple-silicon-beta-for-m1-m2-mac/

I suppose that the plan is to release officially M1 version under R2023b

I tried to run some brainstorm function with M1 native installation, and they are much more slower the running them in Matlab under Rosetta :frowning: