Skip to main content

Deployment

This page explains how MNE-CPP handles deployment on Windows, Linux, and macOS. Deployment bundles the required Qt runtime libraries with the compiled applications so they can run outside of a development environment.

Build Rules

All MNE-CPP libraries are built to the mne-cpp/lib folder. All applications, test, and examples are built to the mne-cpp/out/Release folder.

Dependency Solving

MNE-CPP depends on Qt, Eigen, and optionally ONNX Runtime and Skigen. Qt and Eigen are downloaded automatically by the repository init scripts (./init.sh / .\init.bat) into src/external/; neither is bundled in the repository. For Qt runtime deployment we use Qt-specific deployment tools (windeployqt, linuxdeployqt, macdeployqt).

Windows

The WinDynamic workflow in release-windows.yml excludes examples and tests. MNE-CPP libraries are copied to both mne-cpp/lib and mne-cpp/out/Release.

Dependency resolution uses windeployqt (maintained by Qt), called from deploy.bat with dynamic as the first argument. It runs against:

  • The MNE Scan .exe (covers all application-level Qt modules)
  • The Disp3D .dll (the highest-level library, linking all needed Qt modules)

Afterward, Qt and system libraries reside in mne-cpp/out/Release. The test data folder is deleted, and the output is compressed to a .zip file and uploaded as a release asset.

Linux

The LinuxDynamic workflow in release-linux.yml excludes examples and tests. CMake configures the RPATH to link against libraries in mne-cpp/lib.

Dependency resolution uses linuxdeployqt, called from the deployment script under scripts/deploy/.

The test data folder is deleted, and the folders out/Release/apps, out/Release/lib, out/Release/plugins, and out/Release/translations are compressed to a .tar.gz file and uploaded as a release asset.

macOS

The MacOSDynamic workflow in release-macos.yml excludes examples and tests. All applications are built as .app bundles.

Dependency resolution uses macdeployqt (maintained by Qt). MNE-CPP libraries are manually copied to each app's Contents/Frameworks folder, and resources and plugin folders are copied to the corresponding .app directories.

Before packaging, standalone plugin folders (mne_scan_plugins, mne_analyze_plugins, mne_rt_server_plugins) and the resources symlink are deleted. The out/Release folder is compressed to a .tar.gz file and uploaded as a release asset.

Static Builds

The information above corresponds to deploying the dynamically built version of MNE-CPP. In case of static deployment the process differs slightly. See the deployment scripts in scripts/deploy/.

Deployment Scripts

The deployment scripts live in scripts/deploy/. The cross-platform deploy.bat script handles dependency resolution and packaging.

Each script accepts two arguments:

  1. Linkage type: dynamic (default) or static.
  2. Packaging: Pass pack as the second argument to generate a compressed archive (.zip or .tar.gz) containing all binaries and required libraries.

During development, running the deployment script with just the dynamic argument is useful to resolve Qt dependencies for a particular MNE-CPP application without creating a full package.

Example:

# Resolve Qt dependencies for development (no archive)
./scripts/deploy/deploy.bat dynamic

# Create a distributable archive
./scripts/deploy/deploy.bat dynamic pack