Jump to content

Programming Howto:Building BCI2000: Difference between revisions

From BCI2000 Wiki
Mellinger (talk | contribs)
Mellinger (talk | contribs)
No edit summary
 
(35 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This document describes how to build BCI2000, i.e. how to create the BCI2000 executables from their source code.
The process of building BCI2000 from source differs between Windows and non-Windows (macOS, Linux) systems.


== Why to build ==
There are step-by-step tutorials for each:
Typically, you will install BCI2000 from its binary distribution, and do not need to build BCI2000, unless
* [[Programming Howto:Building and Customizing BCI2000|Building and Customizing BCI2000 for Windows systems]],
*you want to always use its most current SVN version,
* [[Programming Howto:Non:Building and Customizing BCI2000 on Non-Windows Platforms|Building and Customizing BCI2000 for macOS and Linux]].
*you create your own module by modifying an existing one, or create a new one from scratch.


== Tools required ==
<!-- This document describes how to build BCI2000, i.e. how to create the BCI2000 executables from their source code.
As of BCI2000 version 2.0, building all parts of BCI2000 requires Borland's C++ Builder 6, or a more recent version.
The operator GUI and Application modules currently require the Borland VCL library.
Non-GUI related parts of BCI2000 can be built using the freely available Borland C++ compiler:
*[[Command line tools]]
*[[Matlab mex files]]


Matlab mex files can also be built on platforms other than Win32. Please use the src/tools/mex/buildmex.m Matlab script (tested with gcc).
==Prerequisites==
#A C++ compiler. Currently, MSVC 2017 and 2019 are supported.
#To build GUI-related parts of BCI2000, a recent version of Qt5 is required. Use Qt's maintenance tool to select and install a version of Qt that matches your C++ compiler.
#CMake 3.11 or newer. Choose "add to path for all users" when prompted by the installer.


==How to build==
==How to build==
===Compiling BCI2000 from the command line===
===1. Start CMake===
# Open a Windows cmd shell, e.g. by choosing "Run..." from the Start Menu and entering "cmd".
In the BCI2000 build directory, double-click '''Configure.sh.bat'''.
# Change to the "src" directory where this document resides.
===2. If using Qt on Windows, point CMake to it===
# Execute "make" from the command prompt.
#In the CMake GUI, click "Add Entry".
# If you updated or edited any of the source files, and experience linker errors or other unexpected behavior, execute "make clean && make all".
#Under Name, enter "Qt5_DIR" (case matters), and set "Type" to "PATH".
   
#Under Value, enter the path to your Qt distribution's <tt>lib/cmake/Qt5</tt> directory.
===Compiling BCI2000 using the Borland C++ Builder 6 IDE===
E.g., if your Qt distribution for MSVC 2019, 64 bit, is located under <tt>D:/Qt/5.10.1/msvc2019_64</tt>, the "Qt5_DIR" CMake variable should point to <tt>D:/Qt/5.10.1/msvc2019_64/lib/cmake/Qt5</tt>.
# Open the file "BCI2000.bpg" with the IDE by double-clicking it.
# Make sure the "ProjectManager" view is visible to the left.
# Right-click the topmost project (located immediately below the line reading "BCI2000"), and choose "Make all from here".
# To get rid of possible inconsistencies from earlier builds, choose "Build all from here" rather than "Make all from here".


===Starting up BCI2000===
===3. Click "Configure"===
# After compilation, a desired configuration of BCI2000 may be started by executing an appropriate batch file from the top level "batch" directory. Once a particular configuration of BCI2000 is started, simply load a parameter file with the same name as the batch file from the "parms" directory.
From the list of compilers, choose the compiler that you would like to use.
# If you need a configuration for which no batch file exists, just modify a copy of a batch file that is close to your needs.
If using Qt, the compiler must match the Qt distribution chosen above.


===Compiling BCI2000 with Borland C++ Builder 2006===
===4. Choose build options===
# Open the file "BCI2000.bpg" from within Borland Developer Studio. This will import all existing projects into BDS project files.
#Make sure that "Grouped" is checked in the GUI, and "Advanced" is unchecked.
# For each project, open the "Options..." dialog, go to "C++ Compiler->Precompiled Headers", and uncheck all check boxes. Then, go to "Link (ilink32)->Path and Definitions", and add "$(BDS)\lib\psdk" to "Library Search Path (-L)".  
#Under the "BUILD" section, you may choose which parts of BCI2000 to build. Typically, you will want to have "BUILD_CONTRIB" checked.
# In the project manager (at the top right), right-click the topmost project and choose "Make all from here".
#Under "EXTENSIONS", choose which extensions to include into the build.
# To get rid of possible inconsistencies from earlier builds, choose "Build all from here" instead of "Make all from here".
===5. Click "Generate"===
# Command-line builds cannot be done with Borland C++ Builder 2006 because it lacks a project-to-makefile conversion utility.
A project/solution file will be created inside the BCI2000 build directory. Double-click it to open it in the IDE.
===6. Build BCI2000 in full, or partially===
In the IDE, choose which projects to build. You may right-click individual projects, or groups of projects, and choose "build" from the context menu.
-->
[[Category:Howto]][[Category:Development]]

Latest revision as of 14:38, 10 March 2025

The process of building BCI2000 from source differs between Windows and non-Windows (macOS, Linux) systems.

There are step-by-step tutorials for each: