-
Notifications
You must be signed in to change notification settings - Fork 536
Building on Linux
opentrack does not provide binaries for Linux users. The following is a brief attempt at the missing guide on compiling opentrack for Linux. Users of other distributions are encouraged to submit PRs improving this document.
The following dependencies are required to build opentrack.
sudo apt update
sudo apt install build-essential cmake git libopencv-dev libproc2-dev qt6-base-private-dev qt6-tools-devsudo pacman -S cmake git opencv procps-ng qt6-base qt6-toolssudo dnf install cmake git opencv-devel procps-ng-devel qt6-qtbase-private-devel qt6-qttools-develgit clone https://github.com/opentrack/opentrack
cd opentrack/Set configuration options, as for any cmake project:
Available config variables can be viewed and edited interactively, with:
cmake -B build
ccmake build(The 'build' directory this generates can be called anything, so you can manage multiple builds, perhaps using different configuration values.)
When done, press c to reconfigure, e to dismiss the resulting dialog, and then g to generate the configuration.
The defaults values should be fine for now.
Alternatively, configuration can be set at the command line, using -D to define the value of each variable, eg:
cmake -B build -DSDK_WINE=ONThe commands below compile and then install opentrack, by default to the directory './install'. Override this install location by setting config variable CMAKE_INSTALL_PREFIX, e.g:
cmake . -DCMAKE_INSTALL_PREFIX=$HOME/.local/You'll probably need more of these config variables if you choose some of the
optional dependencies listed below. Add their config variables as extra -D
args to this cmake command.
Use the table below to see if you'll need any optional dependencies. If you do, then repeat the above apt/pacman/dnf command, with the optional dependencies appended to the end.
Similarly, some of the following functionalities require you to set more config variables. Run 'the 'cmake' or 'ccmake' commands above to set any extra configuration variables you need.
The table shows dependencies for Debian except where otherwise noted. PRs for other distros are welcome.
| Functionality | Dependency | Config variables |
|---|---|---|
| Aruco paper marker tracker |
libopencv-dev, andcompile libaruco (see below) |
SDK_ARUCO_LIBPATH=<path> |
| EasyTracker | libopencv-dev |
|
| FTNoIR PointTracker | libopencv-dev |
|
| Hatire head tracker |
qt6-serialport-dev(was libqt5serialport5-dev) |
|
| Intel RealSense |
librealsense2-dev (docs) |
SDK_REALSENSE=<path>(or env var RSSDK_DIR) |
| libevdev (docs) | libevdev-dev |
|
| NeuralNet tracker with ONXX |
libopencv-dev,onnxruntime-devel (Fedora),Download and extract onxx tarball |
ONNXRuntime_DIR=<path>and env var ONXXRuntime_ROOTto same path. |
| Oscpack | liboscpack-dev |
SDK_OSCPACK=/usr |
| Valve SteamVR support | Download and extract Valve SteamVR SDK |
SDK_VALVE_STEAMVR=<path> |
| Wine/Proton |
wine64-tools (Debian)wine-devel (Fedora) |
SDK_WINE=ON. |
| X-Plane | Download and extract X-Plane Plugin SDK |
SDK_XPLANE=<path> |
Needed for Aruco paper marker tracker. You'll have to compile it yourself. In a new directory:
git clone https://github.com/opentrack/aruco.git
cd aruco
cmake -B build -DCMAKE_BUILD_TYPE=RELEASE
cmake --build buildThen specify the full path of aruco/build/src/libaruco.a using the config variable SDK_ARUCO_LIBPATH.
(cd build; make -j$(nproc))The -j arg does the compilation in parallel across all your CPUs, so speeds things up tremendously.
(cd build; make -j$(nproc) install)This installs to wherever the config variable CMAKE_INSTALL_PREFIX points to, which defaults to ./build/install.
Run the installed executable to try it out, e.g.:
cd build/install/bin # or wherever you configured the install directory
./opentrack