Programming Howto:Manually Build BCI2000 on Non-Windows Platforms

From BCI2000 Wiki
Revision as of 19:57, 15 September 2022 by Mmarcus (talk | contribs) (→‎Tell CMake which Qt installation to use)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Installing Dependencies

There are three dependencies that need to be installed before you can compile BCI2000:

  • ffmpeg (version 4.4.1, version 5 does not work with BCI2000)
  • portaudio
  • sdl2

These can be installed using the

install_dependencies

script in the BCI2000 home directory. This will automatically detect your homebrew or it will download a portable version of homebrew in your BCI2000 directory. Then it will install the necessary dependencies. Alternatively, you can manually install them, and they will be automatically detected by CMake. If you have already installed homebrew, this can be done with

brew install ffmpeg@4
brew link ffmpeg@4
brew install portaudio
brew install sdl2

Configure BCI2000 for Compilation

Run the CMake GUI

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

Cmake-init-non-windows.png

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 the compilation) and enter the path to a Qt directory. If you installed Qt with homebrew, this can be found with

brew list qt@5

The installation directory is only the part of the paths that are

.../hombrew/Cellar/qt@5/<version>

Use everything up to the version and nothing past it. Use CMAKE_PREFIX_PATH as the name for the new entry. Be aware that the entry's name is case sensitive. Currently, on non-windows platform, Qt 5 is the only version that is supported.

Cmake-add-cache-non-windows.png

Perform the configuration step

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. Cmake-generators-non-windows.png
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. Cmake-configured-non-windows.png

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.

Cmake-done-non-windows.png

Compile BCI2000

Open Terminal

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

Terminal-bulid-directory-non-windows.png

Build Makefiles

Run:

make

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.

Make-done-non-windows.png

The build process is now complete. Run

make

again to recompile. Or

make <target>

to recompile only a specific target.