Building openDAQ™ from source
Building openDAQ™ from source is meant for advanced users. We recommend for anyone new to openDAQ™ to start out by downloading the pre-build binary packages as described in the Setting up (C++) and Setting up (Python) guides instead. |
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.
Building openDAQ™
-
Windows
-
Linux
1. Install all required tools/packages
-
CMake 3.24 or higher: https://cmake.org/
-
Git: https://git-scm.com/
-
Python3: https://www.python.org/downloads/
-
Visual Studio (2017 / 2019 / 2022): https://visualstudio.microsoft.com/downloads/
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
-
CMake 3.24 or higher: https://cmake.org/
-
Git: https://git-scm.com/
-
Python3: https://www.python.org/downloads/
-
Ninja-build: https://ninja-build.org/
-
g++
-
X11
-
LLD (optional)
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.