![]() |
OpenMS
|
OpenMS can obtain its third-party dependencies (Boost,Eigen, Apache Arrow, etc.) through vcpkg, Microsoft's cross-platform C/C++ package manager, instead of the system package manager or the contrib package. vcpkg builds vcpkg resolves the manifest and builds or restores packages as needed in a fixed, reproducible configuration, which make it easiest way to get a consistent set of libraries across Linux, macOS and Windows.
The set of dependencies and their versions or features are declared in the manifest file vcpkg.json at the root of the repository, and an overlay settings are declared in vcpkg-configuration.json. For a general introduction to vcpkg and manifest mode, see the vcpkg documentation.
Most of the libraries OpenMS depends are available, unmodified from the public vcpkg directory. A few, however needs a patch, file changes or do not exist in the registry at all (for example the header-only pylmcf/wnet/wnetalign libraries used for Wasserstein network alignment feature or the openms-thermo-bridge library used for native Thermo RAW file support). For these cases OpenMS ships its own overlay ports in the vcpkg-overlays/ directory:
vcpkg-overlays/ports contain one subdirectory per port. A port here can either replace a port of the same name from the public registry(e.g., to apply a patch or edit the existing port files) or provide an entirely a new port that is not available upstream at all (e.g., opentime, isospec, pylmcf, etc.).vcpkg-overlays/triplets contains custom triplets used to build these dependencies with non-default settings.These locations are wired up via the overlay-ports and overlay-triplets keys in vcpkg-configuration.json, so vcpkg automatically picks them up whenever it resolves a port name. If you need to add or edit the corresponding subdirectory under vcpkg-overlays/ports; see the vcpkg overlay-ports and the packaging details for details on writing a overlay-port.
OpenMS need an underlying compiler, build generator, and (because some vcpkg ports build upstream projects using an autotools build system, and because WITH_GUI is on by default) the autotools chain and GUI/OpenGL prerequisites below.
A C++23-capable compiler is required; see Compiler Requirements for the minimum supported GCC/Clang versions.
A C++23-capable Xcode installation is required; see Required Applications and Dependencies.
vcpkg is included as a git submodule, so make it sure it is checked out alongside the rest of source tree:
If you already have a clone without the vcpkg submodule initialized. run:
Building with presets uses [Ninja][https://ninja-build.org/] as the generator, so make sure it is installed and available on your PATH.
Configure, build and (optionally) test using a preset name for your platform. For example, on Linux x64:
The resulting build directory is build/linux-x64-release (each preset gets its own directory, so debug/release/relwithdebinfo builds don't clash). Substitute the preset name for your platform and desired build type; run cmake --list-presets to see all available presets, including the *-ci presets used by the CI pipeline, which additionally enable most optional features via VCPKG_MANIFEST_FEATURES (see below).
The first configure of a given preset can take a while, since it builds all vcpkg dependencies for that triplet from source; subsequent configures reuse the already-built packages from build/<preset>/vcpkg_installed/.
If you need a configuration that isn't covered by a preset, you can still configure manually, mirroring what the presets do under the hood:
Optional OpenMS features that pull in additional dependencies (HDF5, ONNX Runtime, the Wasserstein network alignment libraries, etc.) need two** things to be turned on together: the corresponding CMake option (e.g. -DWITH_HDF5=ON, -DWITH_ONNX=ON) and the matching vcpkg manifest feature via -DVCPKG_MANIFEST_FEATURES="<feature1>;<feature2>;...", so that vcpkg actually installs the extra dependency. The *-ci presets show an example enabling several of these together:
See Building OpenMS on GNU/Linux or other operating system build docs for the full list of WITH_*/USE_EXTERNAL_* build flags and what each optional feature does.
OPENMS_USE_VCPKG is an alternative to, not a combination with, the system/contrib-based dependency discovery.