Jump to content

Contributions:BrainFlow: Difference between revisions

From BCI2000 Wiki
Rlellis (talk | contribs)
Rlellis (talk | contribs)
Line 25: Line 25:




'config' determines how the solution is built, so adjust this according to which version you plan to use, then run it.
'config' determines how the solution is built, so adjust this according to which version you plan to use ("Release" or "Debug"), then run it.


Next, go to brainflow\build and open 'brainflow.sln'. Set the version to match the config used above (release or debug), and build the solution.
Next, go to brainflow\build and open 'brainflow.sln'. Set the version to match the config used above (release or debug), and build the solution.

Revision as of 22:58, 3 November 2023

Installation

BrainFlow Install

Before installation, please install git bash and python.

Libraries generated from BrainFlow are needed for this module, which requires the user to download and build the project. The download process (and configuring the solution) can be automated using these scripts:

All that needs to be done to use this scripts is: locate them in {BCI2000 Folder}\src\contrib\SignalSource\BrainFlow, and double click on "BrainFlowInstall.bat". This will clone the BrainFlow repository*** into the correct location as well as run the BrainFlowBuild.py script, which will generate compiled libraries for either debug or release, depending on what you enter upon being prompted (0=debug, 1=release).

Afterward, you will need to add the generated libraries to your systems path. ("Compiled/{Release and/or Debug}")

In the CMake GUI opened from BCI2000/build, press the


First, in the same folder containing your working copy of BCI2000, create a folder named 'brainflow'. For example, if the location of your copy of BCI2000 is C:\Users\Bob\Desktop\BCI2000, your folder will be C:\Users\Bob\Desktop\brainflow. In this new folder, open git bash, and enter 'git clone https://github.com/OpenBCI/brainflow.git' (BrainFlow). After installation is complete, navigate to the 'tools' folder, and run build.py. This will create the solution needed to generate the libraries for EITHER debug or release.

Afterward, you will need to add the generated libraries to your systems path. ("brainflow\compiled\{Release and/or Debug}")

If you wish to use debug mode, open build.py and search for 'config' until you find a section that looks like this:

   def build(args):
       if platform.system() == 'Windows':
           config = 'Release'


'config' determines how the solution is built, so adjust this according to which version you plan to use ("Release" or "Debug"), then run it.

Next, go to brainflow\build and open 'brainflow.sln'. Set the version to match the config used above (release or debug), and build the solution.

In BCI2000's CMake window (build\Configure.sh.cmd), press the blue "Add Entry" arrow in the top right corner. In the dropdown menu for "Type:", select "PATH", then in "Name:" enter: "CMAKE_PREFIX_PATH". For the value, enter the entire file location of brainflow\installed\lib\cmake\brainflow (go to the folder your BCI2000 folder resides in, a folder named "brainflow" will be located there. You can append the the location of this folder with this location so your entire file location looks like C:\Users...\{Folder containing BCI2000 folder}\brainflow\installed\lib\cmake\brainflow). After these three fields are filled out, press "OK". Make sure under "BUILD" that "BUILD_ALL_SOURCEMODULES" is selected, and you will also need to deselect "USE_DYNAMIC_CRT" under "USE".


C:/Users/Robbie/Documents/BCI2000folder/brainflow/installed/lib/cmake/brainflow


C:/Users/Robbie/Documents/BCI2000folder/brainflow/installed/lib/Brainflow.lib C:/Users/Robbie/Documents/BCI2000folder/brainflow/compiled/Debug/BoardController.lib C:/Users/Robbie/Documents/BCI2000folder/brainflow/compiled/Debug/DataHandler.lib C:/Users/Robbie/Documents/BCI2000folder/brainflow/compiled/Debug/MLModule.lib C:\Users\Robbie\Documents\BCI2000folder\brainflow\installed\lib\cmake\brainflow