Skip to content

Post vcpkg project clean up - #9972

Closed
pjones wants to merge 11 commits into
OpenMS:developfrom
pjones:pjones/vcpkg-cleanup
Closed

pjones wants to merge 11 commits into
OpenMS:developfrom
pjones:pjones/vcpkg-cleanup

Conversation

@pjones

@pjones pjones commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

This PR attempts to remove outdated references to the contrib module and ensure the documenation for building OpenMS from source is accurate.

I opened it as a draft because I don't know what to do with the Windows documentation. The existing documentation for building OpenMS on Windows is quiet extensive and covers many edge cases. I'm not a Windows user/developer so I don't know which sections are no longer relevant and which need to be updated.

If a Windows developer would be willing to update the Windows install doc I would greatly appreciate it.

@cbielow cbielow left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left a few prelim comments.

Currently building locally and running into problems on Windows.
Fixing this will take a while. Will submit fixes to this PR, once its ready.


@subsection install_vcpkg_optional_deps Optional Dependencies

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:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't we hide this from the user and do the mapping inside cmake?

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 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).

@cbielow cbielow Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this "run cmake --list-presets to see all available presets," should come before the example, so non-Linux don't feel lost

@cbielow

cbielow commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

one more thing:
after a few tries, I can configure cmake --preset windows-x64-debug but end up with:

...
-- Configuring done (48.4s)
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
C:/temp/OpenMS/src/openms/PYLMCF_INC
   used as include directory in directory C:/temp/OpenMS/src/openms
C:/temp/OpenMS/src/openms/WNETALIGN_INC
   used as include directory in directory C:/temp/OpenMS/src/openms
C:/temp/OpenMS/src/openms/WNET_INC
   used as include directory in directory C:/temp/OpenMS/src/openms

-- Generating done (6.0s)
CMake Generate step failed.  Build files cannot be regenerated correctly.

this is using
cmake version 3.31.6-msvc6

the underlying reason is:
What was wrong: WITH_WNETALIGN defaults ON, but the wnetalign vcpkg manifest feature is opt-in and windows-x64-debug doesn't request it — it inherits only windows-x64-base + debug-base, while VCPKG_MANIFEST_FEATURES lives in ci-base. So the three ports were never installed (confirmed: no aligner.hpp or lmcf.hpp anywhere under build/), all three find_path calls returned -NOTFOUND, and those went unchecked into target_include_directories at src/openms/CMakeLists.txt:355. CMake only catches that at generate time, which is why the error named three bare variables and never mentioned wnetalign.

Why this fix: wnetalign was the outlier. WITH_OPENTIMS and WITH_THERMO_RAW are also ON by default with optional vcpkg features, and both use find_package(... QUIET) → FetchContent fallback, which is exactly why they don't break the default preset. wnetalign alone had a find with no guard and no fallback. It now follows the same find-then-fetch shape, so the default preset works out of the box, and when the feature is enabled (the *-ci presets) the vcpkg ports are used instead — you'll see wnetalign: using vcpkg ports in that case.

Two notes:

The fallback fetches three small header-only repos from GitHub at configure time, so it needs network — same trade-off opentims and the Thermo bridge already make. Yours resolved into build/windows-x64-debug/_deps/.
If you'd rather this be vcpkg-native than git-fetched, the alternative is adding wnetalign to the non-CI presets' VCPKG_MANIFEST_FEATURES, or defaulting WITH_WNETALIGN=OFF when the feature is absent. I went with matching the siblings since that keeps all three ON-by-default optional deps behaving identically, but either is a one-liner if you prefer.

--> So one more reason to have a single point of configuration for the package flags (if that's even possible).

What is the general idea here? Use vcpkg only for dependencies which are not installable via package managers? It would not make sense to compile your own boost, when the system ships one, right? If so, will cmake/vcpgk detect preexisting dependencies and not build them?

…rom subprojects; add MSVC toolset guard before vcpkg runs
…leting CMakeCache.txt and CMakeFiles folder) without every fetched lib complaining about the mismatch (since FetchContent inherited the Generator via subprojects)
@pjones

pjones commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

@cbielow Thank you for looking into this!

The general idea is to have a single source for all dependencies (vcpkg) for consistency and reliability. The system is currently opt-in. But if you do use vcpkg then CMake will ignore dependencies installed on the system and only use those in from vcpkg. Unfortunately, we do still depend on some external tools/packages that haven't been integrated via vcpkg.

@cbielow cbielow mentioned this pull request Sep 4, 2026
5 tasks
@cbielow

cbielow commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

whops. Sorry, pushed to the wrong branch. undo and prefer #10063 ?

@cbielow

cbielow commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

the current state successfully builds on VS2022, both debug and release.

Do we still want to advertise contrib? If not, references to it should be removed.

@cbielow

cbielow commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

one important thing: I highly recommend adding a Debug build for VS2022 for CI.
This was the main factor which kept me from building successfully here.

@pjones

pjones commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

@cbielow

Do we still want to advertise contrib? If not, references to it should be removed.

No, I think we want to completely get rid of contrib.

@pjones

pjones commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

@cbielow

I highly recommend adding a Debug build for VS2022 for CI.

The reason we don't do this is because the builds would take twice as long when you have a cache miss.

Maybe we can have a special CI workflow whose only job is to fill the vcpkg cache and doesn't run in response to PRs. Perhaps the nightly run could enable debug builds? What do you think?

@cbielow

cbielow commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

@cbielow

I highly recommend adding a Debug build for VS2022 for CI.

The reason we don't do this is because the builds would take twice as long when you have a cache miss.

When would a cache miss occur? Only when vcpkg is updated? Or is that cache for all of OpenMS?

Maybe we can have a special CI workflow whose only job is to fill the vcpkg cache and doesn't run in response to PRs. Perhaps the nightly run could enable debug builds? What do you think?

I'd prefer it as part of the actual CI. Once a PR is merged, people tend not to care if something breaks the night after.
Having it in CI would prevent the merge in the first place.

@pjones

pjones commented Sep 13, 2026

Copy link
Copy Markdown
Contributor Author

When would a cache miss occur? Only when vcpkg is updated? Or is that cache for all of OpenMS?

Yes, when vcpkg is updated. But also if GitHub changes the OS or compiler versions for the runner.

I'd prefer it as part of the actual CI. Once a PR is merged, people tend not to care if something breaks the night after. Having it in CI would prevent the merge in the first place.

I agree, but then we hit time limits with GitHub.

We're currently talking with Oliver about what build resources we need.

Copy link
Copy Markdown
Contributor

Superseded by #10112, which merged into develop on 2026-09-11 as 7f57f1d. That PR carries all 11 commits from this branch (29a5272 … d088ce8) plus follow-up fixes, so I'm closing this one. Thanks @pjones and @cbielow — the work is in.

For the record, the two red checks here were fixed in #10112 by restoring cmake_minimum_required() in the three CMakeLists.txt files that are also configured as standalone top-level projects:

  • src/pyOpenMS/CMakeLists.txt is the top-level project for py-build-cmake (pip install . / cibuildwheel); without the call all four build-wheels-* jobs failed with "No cmake_minimum_required command is present".
  • src/openms/extern/eol-bspline/CMakeLists.txt and src/openms/extern/IsoSpec/CMakeLists.txt are staged and configured standalone by the vcpkg overlay ports, and their *-standalone-cmake.patch files use that line as hunk context — so the eol-bspline port failed with "patch does not apply" and aborted the manifest install on the Windows job.

Dropping the call from directories that are only entered via add_subdirectory() was fine, which is why the Linux and macOS jobs stayed green.

Three things raised in this thread did not make it into #10112 and are still open on develop:

  1. @cbielow's two review comments on install-vcpkg.doxygen — deriving the VCPKG_MANIFEST_FEATURES entries from the WITH_* options inside CMake instead of asking users to set both, and moving the cmake --list-presets hint ahead of the Linux example.
  2. The Windows install docs: doc/doxygen/install/install-win.doxygen still has ~28 references to contrib and install-contrib.doxygen is still there, so the contrib removal @pjones described is not finished.
  3. The VS2022 Debug CI job, and whether it belongs in PR CI or a nightly.

Let's track those separately rather than on a closed PR.


Generated by Claude Code

Copy link
Copy Markdown
Contributor

Filed the three follow-ups from the previous comment:


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants