Building openDAQ™ from source

In this guide, we go through the motions of building and installing openDAQ™ from source. While this guide uses Visual Studio as the Windows CMake generator, and Ninja as the Linux generator, you can use different ones depending on your set-up and development environment.

Note that building openDAQ™ from source is meant for advanced users. We recommend for anyone new to openDAQ™ to start out by downloading the binary packages, and following the Setting up (C++/Python) guide.

Building openDAQ™

  • Windows

  • Linux

1. Install all required tools/packages

2. Clone the openDAQ™ repository

git clone git@github.com:openDAQ/openDAQ.git
cd openDAQ

3. Generate CMake project

Select the appropriate CMake preset. Below, we list all presets, and select the full installation, using Visual Studio 2022 as the generator.

cmake --list-presets=all
cmake --preset "x64/msvc-22/full"

If you are using a different generator / compiler, you can select a different preset, or override the generator with the -G CMake argument.

cmake --preset "x64/msvc-22/full" -G "Visual Studio 16 2019"

4. Build and install the project

Run the following code to build and install openDAQ™. Note that if using a different preset, your build directory might be located at a slightly different path within the build folder.

cd build/x64/msvc-22/full
cmake --build .
cmake --install . --prefix "openDAQ"

This will install the binaries in the build directory within the "openDAQ" folder. To specify a different installation directory, you can provide the path in the CMake install --prefix argument.

1. Install all required tools/packages

Ninja is used as the default build system in the "gcc/full" preset. X11 is needed for data visualization. LLD speeds up the linker step when building openDAQ™.

On Ubuntu and Debian distributions we can run the following terminal commands to install all requirements:

sudo apt-get update
sudo apt-get install -y git build-essential lld cmake ninja-build mono-complete python3
sudo apt-get install -y libx11-dev libxcursor-dev libxrandr-dev libgl-dev libudev-dev libfreetype6-dev

2. Clone the openDAQ™ repository

git clone git@github.com:openDAQ/openDAQ.git
cd openDAQ

3. Generate the CMake project

Select the appropriate CMake preset. Below, we list all presets, and select the full preset, using ninja as the generator and build tool.

cmake --list-presets=all
cmake --preset "x64/gcc/full/release"

If you are using a different generator / compiler, you can select a different preset, or override the generator with the -G CMake argument.

4. Build and install the project

Run the following code to build and install openDAQ™. Note that if using a different preset, your build directory might be located at a slightly different path within the build folder.

cd build/x64/gcc/full/release
cmake --build .
cmake --install . --prefix "openDAQ"

This will install the binaries in the build directory within the "openDAQ" folder. To specify a different installation directory, you can provide the path in the CMake install --prefix argument.