LSL build environment

liblsl and most apps use CMake and C++. Most apps also use Qt for a graphical user interface.

Common Requirements

Qt

For compatibility with Ubuntu 22.04 (20.04 with a PPA), Qt 6.2 is the oldest supported version.

Qt6 is the recommended toolkit to create graphical user interfaces. To build apps using Qt, install it and if CMake doesn’t find it automatically tell it where to find it, either by adding the compiler specific base path to the PATH (set PATH=C:Qt<version><compiler_arch>;%PATH% on the same command line you call cmake from) or add the path to the Qt CMake configuration to the cmake parameters (-DQt5_DIR=C:/Qt/<version>/<compiler_arch>/lib/cmake/Qt5/). (-DQt6_DIR=C:/Qt/<version>/<compiler_arch>/lib/cmake/Qt6/).

Boost

Nowadays, Boost is mostly used for apps connecting to a device over the local network with Boost.Asio. As these apps don’t need any parts of Boost to be built, you can just download Boost, extract it somewhere and tell CMake where to find it (-DBOOST_ROOT=path/to/boost).

Environment Configuration

Windows

Visual Studio

To get a minimal Visual Studio installation, copy this block into a file and use “Import configuration” in the Visual Studio 2019 installer:

{
    "version": "1.0",
    "components": [
        "microsoft.visualstudio.component.vc.coreide",
        "microsoft.visualstudio.component.vc.cmake.project"
    ]
}

Visual Studio (2017 and newer) includes CMake. For a system wide CMake installation, download the .msi installer and check the Add to the path (for all users) box.

Qt

Qt can be installed with the official Qt installer

OS X

Note: MacOS users are expected to have homebrew installed.

  • brew install cmake
  • brew install qt (not necessary for liblsl)
  • brew install labstreaminglayer/tap/lsl (if you’re only building an app, not liblsl itself)

Debian / Ubuntu

Build Tools

  • apt install build-essential g++ cmake

PyPI has newer precompiled CMake binaries for some architectures, you can install those via python -m pip install cmake.

Qt

The simplest way is to install whichever version of Qt is appropriate for your distro (20.04::Qt5.12):
  • apt install qt5-default (not necessary for liblsl)
However, if your app requires a newer version of Qt then the easiest way to install it is with aqtinstall:
  • sudo -i
  • apt install python3-pip
  • pip3 install aqtinstall
The newest version that will work with Ubuntu 20.04 is Qt 5.15.2:
  • aqt install --outputdir /opt/Qt 5.15.2 linux desktop
  • apt-get install libxcb-xinerama0
  • You would then use this in cmake with -DQt5_DIR=/opt/Qt/5.15.2/gcc_64/lib/cmake/Qt5
For Ubuntu 20.04 (+PPA) and Ubuntu 22.04, you can use Qt 6. For example:
  • aqt install --outputdir /opt/Qt 6.2.4 linux desktop
  • You would then use this in cmake with -DQt6_DIR=/opt/Qt/6.2.4/gcc_64/lib/cmake/Qt6
For your application to run, it needs to find Qt libraries. Add the following to the bottom of your .bashrc file:
LD_LIBRARY_PATH=”$LD_LIBRARY_PATH:/opt/Qt/{version}/gcc_64/lib” (make sure to swap out {version} for your qt version).