Starting error using standalone and MCR

MCR version v91
When I run the command: ./brainstrom3.command /opt/mcr/v91/
I got an error: cannot reload '/opt/mcr/v91/bin/glnxa64/libmwhgbuiltins.so'
And the file exists.
So what's the problem?

Please post the full output you get in the terminal.

As mentioned in the installation instructions, you can try with other version of the MCR if this one does not work on your OS: 2012b, 2013b, 2014b, 2016a, 2016b, R2017a, R2017b, R2018a...
https://neuroimage.usc.edu/brainstorm/Installation

Thank you for the reply. The problem has already been solved. Because some libs (the libmwhgbuiltins.so depends on ) were missing.

Hi Francois,
I have another question.
I can run my own script by "brainstorm <script1.m>" correctly on one computer. But when I run the same script on a server using "brainstorm.command <script1.m> ", the system posts an error which is my another function (function_name.m) called by script1.m is not defined. Actually, the function_name.m is in the same fold with script1.m.
So what can I do to run the script on the server? Can the script1.m call another functions defined by user?

Based on your Error message i would try first this steps:

Try which functionName in the Command Window to see if Matlab can Find the Function.

That will give you the Path of the Function.
If which returned "not found".

  • add file to Path

If Path points to another Function or there are 2 Functions with this name

  • Change the current folder.
  • Move or remove folders on the search path.
  • Rename or move files.
  • Specify the full path or partial path to the file that you want.

If this won't work use dbstop if error and check if the Parameters you're passing to function_name are defined as they are definced in function_name

Hello

When using the free MCR library instead of a full Matlab license, you are not allowed by the Mathworks to execute your own .m scripts, you can only run the programs that were compiled with the Matlab Compiler. We can understand the logic of the company: otherwise, there would be no need for buying an expensive Matlab license, you could just execute everything with the free library...

This functionality that we added in which allows executing Brainstorm scripts from the compiled version of the function is not a real execution of the .m file, as if you were running it from Matlab. It reads the .m file line by line, and executes it with the eval() function, which works only for functions that were compiled with the Matlab Compiler. It is just a way to automated some of the Brainstorm tasks that you would have to run with the interface otherwise. If the .m script contains anything that is not directly a Brainstorm or native Matlab function, it would crash, just like you mentioned.

I'm sorry, the only solution for your problem is to buy a Matlab license... Or do everything within Brainstorm.

Cheers,
Francois

Thank you for the very clear and logical response :slight_smile:

Thank you very much for the detailed answer. The brainstorm <script1.m> can not handle when script1.m calls another function defined by user.