Jump to content

RaspberryPi: Difference between revisions

From BCI2000 Wiki
Nluczak (talk | contribs)
No edit summary
Nluczak (talk | contribs)
No edit summary
Line 54: Line 54:


If launched from a terminal within the Pi desktop, it should open normally.
If launched from a terminal within the Pi desktop, it should open normally.
==Configure BCI2000 for Compilation==
===Run the CMake GUI===
Double-click "Configure.sh.cmd" in your BCI2000 build directory.
[[File:Cmake-init-non-windows.png|700px]]
===Tell CMake which Qt installation to use===
Click "AddEntry" in the CMake window (<i>Note that checking off "Advanced" in CMake is optional and does not impact compilation</i>) and enter the path to a Qt directory.
<!--If you installed Qt with homebrew, this can be found with
brew list qt@6
The installation directory is only the part of the paths that are
.../homebrew/Cellar/qt@6/<version>
Use everything up to the version and nothing past it.-->
If you installed Qt using the Qt online installer, the path will look like /Users/foo/Qt/6.9.0/macos.
Use CMAKE_PREFIX_PATH as the name for the new entry. Be aware that the entry's name is case sensitive.
<b>Also, currently, on non-windows platforms, Qt 6 is the only version that is supported.</b>
[[File:Cmake-add-cache-non-windows.png|700px]]
===Configuration===
In the CMake window, click "Configure" and choose a generator that is consistent with your compiler. This tutorial will be using Unix Makefiles.
Then click "Done" to perform the configuration step.
[[File:Cmake-generators-non-windows.png|700px]]
You will see a list of targets scrolling by, and a number of new entries in the variable list at the top of the window, marked in red.
===Choose Build Options===
Make sure the "Grouped" checkbox is checked, and configure the build by customizing values in the "BUILD" group, "EXTENSIONS" group,  and "USE" group.
[[File:Cmake-configured-non-windows.png|700px]]
===Generate Makefiles===
Then, click "Generate" to create build files. When CMake displays its "Generating done" message, your BCI2000 build directory will now contain a Makefile (or a project file for your compiler of chioce), as well as a number of additional CMake-generated files.
[[File:Cmake-done-non-windows.png|700px]]
==Compile BCI2000==
===Open Terminal===
Open a new terminal window and navigate to your BCI2000 build directory.
[[File:terminal-bulid-directory-non-windows.png|700px]]
===Build Executables===
Run:
make -j
from your BCI2000 build directory. Once this is finished your BCI2000 prog directory will contain a number of executables, one for each module, plus a few helper executables. Not everything works the same or, in some cases, at all on non-windows platforms. See [[Non-Windows Functionality]] for more information.
[[File:Make-done-non-windows.png|700px]]
The build process is now complete. Run
make -j
again to recompile. Or
make <target>
to recompile only a specific target.
[[Category:Howto]]

Revision as of 21:58, 18 December 2025

Raspberry Pi (Linux) Build Dependencies (BCI2000 GUI build)

This section documents system packages needed to compile BCI2000 on a Raspberry Pi with GUI components enabled (e.g., OperatorQt, StimulusPresentation, BCI2000Viewer).

Dependencies observed during build troubleshooting

During compilation, missing headers/libraries were resolved by installing the following packages:

libdrm-dev — Direct Rendering Manager development files (graphics stack)

libxcb-dev / libxcb1-dev — XCB (X11) client library development files

libxcb-cursor-dev — XCB cursor support (required by Qt/X11)

Recommended minimal install command (GUI build)

The following is a practical minimal set for a Raspberry Pi OS / Debian-like system when building BCI2000 with Qt GUI components:

 sudo apt update sudo apt install -y \ build-essential \ cmake \ qtbase5-dev \ qt5-qmake \ qtbase5-dev-tools \ libdrm-dev \ libxcb1-dev \ libxcb-dev \ libxcb-cursor-dev \ libx11-dev \ libxext-dev \ libxrender-dev \ libxi-dev \ libxrandr-dev

Notes:

Qt on Linux typically depends on X11/XCB libraries, so missing XCB/DRM packages commonly block Qt GUI builds.

If you are doing a headless build (no GUI), you may be able to omit Qt and X11/XCB packages.

Verify GUI dependency availability

To confirm the GUI-related packages are installed:

 dpkg -l | egrep "libdrm-dev|libxcb|qtbase5-dev|cmake"

Running the CMake GUI on Raspberry Pi (cmake-gui)

The CMake GUI executable is cmake-gui, provided by Debian’s cmake-qt-gui package. Debian Packages +1

1) Install the CMake GUI package

On Raspberry Pi OS / Debian Bookworm-like systems:

 sudo apt update sudo apt install -y cmake-qt-gui

This installs the cmake-gui executable. Debian Packages +1

2) Run cmake-gui on the Pi desktop (local monitor)

If your Pi is running a desktop environment and you are logged in locally:

 cmake-gui

If launched from a terminal within the Pi desktop, it should open normally.


Configure BCI2000 for Compilation

Run the CMake GUI

Double-click "Configure.sh.cmd" in your BCI2000 build directory.

Tell CMake which Qt installation to use

Click "AddEntry" in the CMake window (Note that checking off "Advanced" in CMake is optional and does not impact compilation) and enter the path to a Qt directory. If you installed Qt using the Qt online installer, the path will look like /Users/foo/Qt/6.9.0/macos. Use CMAKE_PREFIX_PATH as the name for the new entry. Be aware that the entry's name is case sensitive.

Also, currently, on non-windows platforms, Qt 6 is the only version that is supported.

Configuration

In the CMake window, click "Configure" and choose a generator that is consistent with your compiler. This tutorial will be using Unix Makefiles.

Then click "Done" to perform the configuration step.

You will see a list of targets scrolling by, and a number of new entries in the variable list at the top of the window, marked in red.

Choose Build Options

Make sure the "Grouped" checkbox is checked, and configure the build by customizing values in the "BUILD" group, "EXTENSIONS" group, and "USE" group.

Generate Makefiles

Then, click "Generate" to create build files. When CMake displays its "Generating done" message, your BCI2000 build directory will now contain a Makefile (or a project file for your compiler of chioce), as well as a number of additional CMake-generated files.

Compile BCI2000

Open Terminal

Open a new terminal window and navigate to your BCI2000 build directory.

Build Executables

Run:

make -j

from your BCI2000 build directory. Once this is finished your BCI2000 prog directory will contain a number of executables, one for each module, plus a few helper executables. Not everything works the same or, in some cases, at all on non-windows platforms. See Non-Windows Functionality for more information.

The build process is now complete. Run

make -j

again to recompile. Or

make <target>

to recompile only a specific target.