Skip to content

Windows CI builds use /Od /Ob0 (no optimization) for Release — likely unintended #8932

Closed

Description

@timosachsenberg

Summary

tools/ci/cibuild.cmake line 46 overrides Release C++ flags on Visual Studio with:

set(OWN_OPTIONS "-DCMAKE_CXX_RELEASE_FLAGS='/MD /Od /Ob0 /DNDEBUG /EHsc'")
  • /Od — disables all optimizations
  • /Ob0 — disables all inlining (including __forceinline)

This applies to the entire OpenMS build on Windows (library, TOPP tools, and pyOpenMS when built via this path), including nightly and release branches. This means Windows release binaries built through openms_ci_matrix_full.yml are completely unoptimized.

Context

This was likely added as a workaround for MSVC's pathological O(n²) compile-time behavior with __forceinline — a known issue in nanobind (see wjakob/nanobind#791). Without this flag, large binding files could take 2+ hours to compile.

However, the fix is overly broad:

  1. It affects all of OpenMS, not just pyOpenMS/nanobind
  2. It produces unoptimized release binaries
  3. The wheel build workflow (pyopenms-wheels-cibuildwheel.yml) does not use this override and builds with normal optimization

What changed

A targeted fix has been added to src/pyOpenMS/CMakeLists.txt that patches nanobind's __forceinline → inline on MSVC after FetchContent, which addresses the root cause without disabling optimization globally.

Suggested action

Consider removing or relaxing the /Od /Ob0 override in cibuild.cmake now that the nanobind-specific fix is in place. Options:

  1. Remove the override entirely — let CMake use its default Release flags (/MD /O2 /Ob2 /DNDEBUG)
  2. Keep /Ob1 instead of /Ob0 — allow normal inlining but not aggressive expansion, as a safety measure
  3. Investigate whether any non-nanobind part of OpenMS also triggers the MSVC inlining blowup before removing

🤖 Generated with Claude Code

Activity

  1. coderabbitai commented on Mar 18, 2026

    @coderabbitai
    Contributor
    🔗 Related PRs

    #7857 - refactor: cmake use target_compile_flags [merged]
    #7996 - Window Installer Qt6 fix [merged]
    #8242 - Remove obsolete (and loud) warning ‘-Wno-unused-member-function’ [merged]
    #8288 - Disable WITH_PARQUET option in CI workflow [merged]
    #8880 - fix: exclude MSVC runtime DLLs from dependency resolution (CMake 4.x) [merged]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions