Skip to content

Commit

Permalink
Update build environment / build docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tstenner committed Nov 10, 2020
1 parent d01a419 commit 2b03c9c
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 80 deletions.
118 changes: 48 additions & 70 deletions docs/dev/build_env.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ LSL build environment
=====================

liblsl and most apps use :ref:`buildenvcmake` and C++.
Most apps also use Qt for a graphical user interface.

Recommended compiler toolchain
------------------------------
Expand All @@ -20,18 +21,41 @@ OS / Compiler Supported Versions
------------------------- ------------------
Name Min Max
========================= ====== ===========
Windows XP 10 (1909)
Visual C++ 2008 2019 (16.3)
Windows XP 10 (20H2)
Visual C++ 2015 2019 (16.6)
OS X 10.9 10.14 ?
XCode 9.3 ?
Ubuntu 16.04 19.10
CentOS 5 ?
Ubuntu 16.04 20.10
CentOS 6 ?
Clang 3.5 9.0.0
g++ 6.2 9.0
Alpine Linux <3.6 3.10
:ref:`buildenvcmake` 3.12 3.15
Alpine Linux <3.6 3.12
:ref:`buildenvcmake` 3.12 3.18
========================= ====== ===========

Some apps may have higher requirements while liblsl works on very old
(e.g. Windows XP) and tiny (e.g. Raspberry Pi, some microcontrollers,
Android) systems.

`Qt5 <http://qt.io>`__
----------------------

For compatibility with Ubuntu 16.04, Qt5.5 is the oldest supported
version.

Qt5 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 :envvar:`PATH`
(:samp:`set {PATH}=C:\Qt\<version>\<compiler_arch>;%PATH%`
on the same command line you call cmake from) or add the path to the Qt5 CMake
configuration to the cmake parameters
(:samp:`-D{Qt5_DIR}=C:/path_to/Qt/<version>/<compiler_arch>/lib/cmake/Qt5/`).


Installation: Windows
---------------------

To get a minimal Visual Studio installation, copy this block into a file and
use “Import configuration” in the
`Visual Studio 2019 <https://visualstudio.com/downloads>`_
Expand All @@ -47,79 +71,33 @@ installer:
]
}

Some apps may have higher requirements while liblsl works on very old
(e.g. Windows XP) and tiny (e.g. Raspberry Pi, some microcontrollers,
Android) systems.

Note: MacOS users are expected to have `homebrew <https://brew.sh/>`__ installed.

CMake
-----

See :ref:`CMake <buildenvcmake>`.

.. _Boost:

`Boost <https://boost.org>`__
-----------------------------

`liblsl <https://github.com/labstreaminglayer/liblsl/>`__ already
includes Boost, so you only need it to build some apps.
Visual Studio (2017 and newer) includes CMake.
For a system wide CMake installation, download the
`.msi installer <https://cmake.org/download/>`__
and check the :guilabel:`Add to the path (for all users)` box.

Boost libraries come in two flavors: header-only and compiled libraries.
Qt can be installed with the
`official Qt installer <http://download.qt.io/official_releases/online_installers/qt-unified-windows-x86-online.exe>`__

For the header-only libraries you can download the source archive unpack it to
your local disk.
Installation: OS X
-------------------

For compiled libraries, you either have to compile it yourself (not recommended)
or download precompiled binaries *that have to match your compiler version
and processor architecture!*
For newer apps, you should use the C++11 standard library (e.g. for threads and
regular expressions).

Afterwards, point CMake to it (:samp:`-D{BOOST_ROOT}=path/to/boost`).
Note: MacOS users are expected to have `homebrew <https://brew.sh/>`__ installed.

Each app's build instructions should tell you exactly which boost
libraries you need.
- :command:`brew install cmake`

- Windows: install the `precompiled
binaries <https://sourceforge.net/projects/boost/files/boost-binaries/>`__
- :command:`brew install qt` (not necessary for liblsl)

- Choose the version that matches your compiler and target
architecture (probably 64-bit). You can find the mapping between
visual studio number and compiler version
`here <https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B#Internal_version_numbering>`__.
Installation: Debian / Ubuntu
-----------------------------

- Debian / Ubuntu Linux: install the ``libboost-all-dev`` package
- OS X: install Boost via `Homebrew <https://brew.sh/>`__
- :command:`apt install build-essentials g++ cmake`

MacOS
^^^^^
- :command:`apt install qt5-default` (not necessary for liblsl)

If you are using MacOS and homebrew, then install an old version of
boost with (e.g.) :command:`brew install boost@1.60`.
Then the cmake argument will be
:samp:`-D{BOOST_ROOT}=$(brew --prefix boost@1.60)`.
Try :command:`brew search boost` to see which older versions of boost are available.
`PyPI <https://pypi.org/project/cmake/>`_ has newer precompiled CMake binaries
for some architectures, you can install those via
:command:`python -m pip install cmake`.

.. _Qt5:

`Qt5 <http://qt.io>`__
----------------------

For compatibility with Ubuntu 16.04, Qt5.5 is the oldest supported
version.

Qt5 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 :envvar:`PATH`
(:samp:`set {PATH}=C:\Qt\<version>\<compiler_arch>;%PATH%`
on the same command line you call cmake from) or add the path to the Qt5 CMake
configuration to the cmake parameters
(:samp:`-D{Qt5_DIR}=C:/path_to/Qt/<version>/<compiler_arch>/lib/cmake/Qt5/`).

- Windows: use the
`installer <http://download.qt.io/official_releases/online_installers/qt-unified-windows-x86-online.exe>`__
- Debian / Ubuntu Linux: :command:`apt install qt5-default`
- OS X: :command:`brew install qt`
24 changes: 14 additions & 10 deletions docs/dev/lib_dev.rst
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
Library Development
###################

Follow this guide if you are...
.. note:: Stop reading if you just want to...

- trying to build liblsl for a platform that does not already have a release
- stream data from one of the :doc:`../info/supported_devices` or record data with the
LabRecorder. You can download pre-built releases for the apps and LabRecorder from each
repositories release page.

- Please check the `liblsl release page <https://github.com/sccn/liblsl/releases>`_ first.
- Please let us know so we can add the platform to the list of automated builds, if possible.
- create or use a program to stream or receive data via the LabStreamingLayer. You can
download a precompiled liblsl binary from the
`liblsl release page <https://github.com/sccn/liblsl/releases>`_

- trying to use liblsl in a language that does not already have an interface
Follow this guide if you are...

- want to add / modify core liblsl

- Please create a `GitHub issue <https://github.com/sccn/liblsl/issues>`__
first to ask for advice and to get pre-approval if you would like your
modification to be included in the official library.

- build liblsl for a device / OS with no official release (e.g. an embedded Linux device)

Building liblsl
***************

Expand All @@ -32,7 +37,7 @@ Getting the source

Open a Terminal / Developer Command Prompt and cd to a convenient location to download and build the library.

:samp:`git clone https://github.com/sccn/liblsl.git`
:samp:`git clone --depth=1 https://github.com/sccn/liblsl.git`

The resulting folder structure is as follows.

Expand Down Expand Up @@ -60,17 +65,16 @@ Configuring the liblsl project
.. code:: bash
cd liblsl
mkdir build && cd build
cmake .. -G <generator name>
cmake -S . -B build -G <generator name>
Note: call :samp:`cmake -G` without a generator name to get a list of available
generators.
I use :samp:`cmake .. -G "Visual Studio 16 2019" -A x64`
I use :samp:`cmake -S . -B build -G "Visual Studio 16 2019" -A x64`

If you used a generator, you can now open the IDE project file. Then build the install target.

Alternatively, you can build directly from command line:
:samp:`cmake --build . --config Release --target install`
:samp:`cmake --build build -j --config Release --target install`

In either case, this will create an ``install`` folder in your build folder.
This ``install`` folder is your :doc:`LSL_INSTALL_ROOT` that you might use in when
Expand Down

0 comments on commit 2b03c9c

Please sign in to comment.