Hot to compile generated scritp

Hi!

I’m looking for a way to generate a executable from my script of actions from the brainstorm. I’ve tried to compile by using the mcc matlab command, but it didn’t work. Am I missing something? The command that I am using is this:

mcc -m - v my_script.m -I D:\users\ggsm\workspace

Thanks in advance for your help!

Hello,
Compiling Brainstorm with the Matlab compiler is very complicated…
You can have a look at the functions brainstorm3/toolbox/bst_deploy_java_*.m
I don’t recommend you try this on your own.
Francois

[QUOTE=Francois;8466]Hello,
Compiling Brainstorm with the Matlab compiler is very complicated…
You can have a look at the functions brainstorm3/toolbox/bst_deploy_java_*.m
I don’t recommend you try this on your own.
Francois[/QUOTE]

All I need is to visualize the 3D model of my eeglab data. Is there any way to do that? Also, I didn’t find the bst_deploy_java_*.m file in the brainstorm folder.

All I need is to visualize the 3D model of my eeglab data. Is there any way to do that? Also, I haven’t found the bst_deploy_java_*.m file in the brainstorm folder.

Sorry for the error in the path: brainstorm3/deploy/bst_deploy_java_*.m
I don’t think this would allow you to compile anything on your own, just recompiling Brainstorm as it is would already be a very difficult task.

I’m not sure I understand why you need to compile anything…
If you need to call a script from the command line, you can use the Matlab syntax: “matlab -r myscript”

Francois

To be more specific: I don’t know any easy way to compile a script using Brainstorm commands.

Hi Francois! Is there any way to compile the brainstorm with matlab compiler SDK to generate a brainstorm version to run my script in MCR? I’m searching a way to run my script that calls some functions of brainstorm in a PC without matlab but with MCR installed. I’m trying this due to license restrictions on that PC.

As I was saying before, the compiling scripts are available in the Brainstorm distribution:
brainstorm3/deploy/bst_deploy_java_*.m

You can run the compilation by typing “brainstorm deploy 1”.
You would need to edit them to match your environment, this is not an easy task…
I think you can comment out all the lines that are including files you don’t have.

Francois

[QUOTE=Francois;8850]As I was saying before, the compiling scripts are available in the Brainstorm distribution:
brainstorm3/deploy/bst_deploy_java_*.m

You can run the compilation by typing “brainstorm deploy 1”.
You would need to edit them to match your environment, this is not an easy task…
I think you can comment out all the lines that are including files you don’t have.

Francois[/QUOTE]

Thanks for your help! I understand now. So… it is possible to generate an executable to run my script in MCR with the “brainstorm nogui” option?

Not really, you would have to create process (=plugin) to encapsulate your code, and you would be able to use it from the Brainstorm interface.
http://neuroimage.usc.edu/brainstorm/Tutorials/TutUserProcess

If you want to run a script without the interface, you would need to edit the brainstorm.m as well.

This is complicated to do and I apologize in advance, I won’t be able to help you much in this direction. This is a bit far off topic from the generic support of the Brainstorm software.

Hi Francois,

I’m trying to run the compilation by typing “brainstorm deploy 1”. However, I get this error message:

Error: Caught exception when building project: E:\gilliano\brainstorm3\deploy\bst_javabuilder_2015a.prj
com.mathworks.project.api.InvalidProjectException
At least one file must be added to Exported functions

I’ve already setted the “bst_deploy_java2015a.m” JDK folder to match my environment. Any suggestions of what might be causing this? THis error message happens when I try to execute the line 224:

deploytool(’-build’, compilerFile);

Hello,
You have to edit the project file (bst_javabuilder_2015a.prj) to point at the correct files.
You can also try to generate your own project file using “deploytool”.
Francois

[QUOTE=Francois;9009]Hello,
You have to edit the project file (bst_javabuilder_2015a.prj) to point at the correct files.
You can also try to generate your own project file using “deploytool”.
Francois[/QUOTE]

So… I have to add every “.m” file in brainstorm3 folder?

No, just the brainstorm.m and the folders.
Just open the .prj file with a text editor and fix the paths.

[QUOTE=Francois;9009]Hello,
You have to edit the project file (bst_javabuilder_2015a.prj) to point at the correct files.
You can also try to generate your own project file using “deploytool”.
Francois[/QUOTE]

Hi Francois! I really appreciate your help…

I’ve done what you’ve suggested, however it didn’t work yet. I’ve tried to create a new project with deploytool (by adding the brainstorm.m file and adding the folders “bin”, “defaults”, “deploy”, “doc”, “external”, “java” and “toolbox”). Besides, I have tried to run the “brainstorm deploy 1” command after changing the paths in the file “bst java builder 2015.prj”, but it didn’t work neither.

I’m sorry, I tried to warn you in advanced that it was going to be very complicated.
Setting up this compiling environment is a nightmare… You have to install I don’t remember which libraries in the correct order, and the errors returned by the Matlab compiler are not specific and very difficult to debug.

I don’t have any additional directions to give you, just try again editing differently the matlab script (bst_deploy_java_2015a.m - run it line by line) and the builder project (bst_javabuilder_2015a.prj).
Then contact the Matlab technical support if you don’t understand the errors returned by the Matlab compiler.

Hi Francois! Thanks to your help, I got it! I managed to compile the brainstorm using the deploytool. However, I don’t know how to run it… I see that was created a lot of folders and files, but I have no idea wich on e is the brainstorm executable…

You have to unzip it, add some files and a manifest, then re-zip it.
This is all clearly described in bst_deploy_java_2015a.m

[QUOTE=Francois;9039]You have to unzip it, add some files and a manifest, then re-zip it.
This is all clearly described in bst_deploy_java_2015a.m[/QUOTE]

I’m sorry, but it was not sufficient clear to me… I still don’t know what to do to run the compiled brainstorm.

What step of bst_deploy_java_2015a.m is it that you don’t understand?
You really have to re-write completely this script line by line and adapt it to your environment…