-
Notifications
You must be signed in to change notification settings - Fork 0
Fix openmp windows #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughBumped app/version references from 0.9.2 → 0.9.4 in workflow and settings; enabled OpenMP and increased Ninja parallelism in the Windows CI; added a cmake token Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (4)
settings.json (1)
4-4: Version bump to 0.9.4 looks correct and aligns with workflow APP_NAME.
Matches the workflow’s APP_NAME change to FLASHApp-0.9.4. No issues here.As a small safeguard: your build-executable job later overwrites settings.json.version with github.event.release.tag_name unconditionally. On non-release events this can become empty. Consider guarding that step to only run on releases, or falling back to this 0.9.4 value. Example approach (in the workflow, not here):
- name: Set Version in settings.json if: ${{ github.event_name == 'release' && github.event.release.tag_name != '' }} run: | $VERSION="${{ github.event.release.tag_name }}" $content = Get-Content -Raw settings.json | ConvertFrom-Json $content.version = $VERSION $content | ConvertTo-Json -Depth 100 | Set-Content settings.json.github/workflows/build-windows-executable-app.yaml (3)
17-17: APP_NAME updated to 0.9.4 — good consistency with settings.json.
This keeps installer names aligned with the app version. Consider deriving APP_NAME from a single source (e.g., settings.json or the release tag) to avoid future mismatches.Example pattern (optional): parse settings.json and set APP_NAME dynamically before packaging.
177-177: Use canonical CMake boolean casing for consistency (“ON” instead of “On”).
CMake handles booleans case-insensitively, but the file mixes “OFF/Off/On/ON”. Standardizing reduces confusion.Apply this minimal change:
- OPENMP: "On" + OPENMP: "ON"
180-180: Increased Ninja parallelism to -j4 — reasonable for GHA Windows runners.
This should speed up the build without oversubscribing cores too much. If build times fluctuate, you could make this configurable via an env var.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
.github/workflows/build-windows-executable-app.yaml(2 hunks)settings.json(1 hunks)
🔇 Additional comments (1)
.github/workflows/build-windows-executable-app.yaml (1)
177-177: Heads-up: enabling OpenMP on Windows may require runtime redistribution.
If OpenMS ends up linking against the MSVC OpenMP runtime, some target machines might need the corresponding VC++ Redistributable, or you may need to bundle the required OpenMP DLLs. Please test the MSI on a clean Windows VM to ensure no “missing DLL” errors at runtime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
Dockerfile(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: build-executable
- GitHub Check: build-full-app
|
|
||
| # Configure. | ||
| RUN /bin/bash -c "cmake -DCMAKE_BUILD_TYPE='Release' -DCMAKE_PREFIX_PATH='/OpenMS/contrib-build/;/usr/;/usr/local' -DHAS_XSERVER=OFF -DBOOST_USE_STATIC=OFF -DPYOPENMS=ON ../OpenMS -DPY_MEMLEAK_DISABLE=On" | ||
| RUN /bin/bash -c "cmake -DCMAKE_BUILD_TYPE='Release' -DCMAKE_PREFIX_PATH='/OpenMS/contrib-build/;/usr/;/usr/local' -DHAS_XSERVER=OFF -DBOOST_USE_STATIC=OFF -DPYOPENMS=ON ../OpenMS -DPY_MEMLEAK_DISABLE=On DOPENMP=ON" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Fix missing -D prefix for OPENMP and place the source dir last in cmake invocation
The token DOPENMP=ON is missing the leading -, so CMake won’t treat it as a cache definition. Also, placing ../OpenMS before the final -D options is non-standard and brittle. Move all -D options before the source path and use -DOPENMP=ON. Consider consistent boolean casing as a minor cleanup.
[suggest_optional_refactor]
Apply this diff:
-RUN /bin/bash -c "cmake -DCMAKE_BUILD_TYPE='Release' -DCMAKE_PREFIX_PATH='/OpenMS/contrib-build/;/usr/;/usr/local' -DHAS_XSERVER=OFF -DBOOST_USE_STATIC=OFF -DPYOPENMS=ON ../OpenMS -DPY_MEMLEAK_DISABLE=On DOPENMP=ON"
+RUN /bin/bash -c "cmake -DCMAKE_BUILD_TYPE='Release' -DCMAKE_PREFIX_PATH='/OpenMS/contrib-build/;/usr/;/usr/local' -DHAS_XSERVER=OFF -DBOOST_USE_STATIC=OFF -DPYOPENMS=ON -DPY_MEMLEAK_DISABLE=ON -DOPENMP=ON ../OpenMS"If OpenMS expects a different CMake toggle for OpenMP (e.g., -DOPENMS_OPENMP=ON or -DUSE_OPENMP=ON), adjust accordingly. To confirm the correct flag in the upstream OpenMS CMake, please run this quick web query:
🌐 Web query:
What is the CMake option used by the OpenMS project to enable OpenMP?
💡 Result:
The OpenMS project uses the OPENMS_USE_OPENMP CMake option to enable or disable OpenMP support during the build process. You can set this option by passing -DOPENMS_USE_OPENMP=ON to your cmake command when configuring the build.
Example usage:
cmake -DOPENMS_USE_OPENMP=ON ..This option is specific to the OpenMS project and controls whether OpenMP parallelization is enabled in the compiled binaries. This approach is project-specific and complements the general CMake method for enabling OpenMP using the FindOpenMP module or manual flags for other projects[7][4].
If you are compiling OpenMS, be sure to use the exact name OPENMS_USE_OPENMP, as documented and used in the OpenMS source and CMake scripts.
Citations:
- 1: https://www.scivision.dev/cmake-openmp/
- 2: https://openmp.llvm.org/doxygen/index.html
- 3: How to enable OpenMP with CMake ?(Windows and VS2013) OpenMathLib/OpenBLAS#776
- 4: https://discourse.cmake.org/t/unique-way-to-enable-openmp-with-cmake/10350
- 5: Build error: OpenMP_libomp_LIBRARY on MacOs mapillary/OpenSfM#681
- 6: https://openmp.llvm.org
- 7: https://cmake.org/cmake/help/latest/module/FindOpenMP.html
- 8: https://community.sonarsource.com/t/microsoft-extension-activated-by-openmp-compiler-option-is-not-supported-de-upgrade/59435
- 9: https://forums.opensuse.org/t/how-to-enable-openmp-on-cmake-gcc-covid-sim/140653
- 10: https://learn.microsoft.com/en-us/cpp/build/reference/openmp-enable-openmp-2-0-support?view=msvc-170
Correct OpenMP CMake flag and reorder options in Dockerfile
The Dockerfile’s CMake invocation needs the proper OpenMS-specific flag (OPENMS_USE_OPENMP) and all -D options placed before the source directory. Also normalize boolean values to uppercase.
• File: Dockerfile
• Line: 106
Suggested diff:
-RUN /bin/bash -c "cmake -DCMAKE_BUILD_TYPE='Release' -DCMAKE_PREFIX_PATH='/OpenMS/contrib-build/;/usr/;/usr/local' -DHAS_XSERVER=OFF -DBOOST_USE_STATIC=OFF -DPYOPENMS=ON ../OpenMS -DPY_MEMLEAK_DISABLE=On DOPENMP=ON"
+RUN /bin/bash -c "cmake \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_PREFIX_PATH='/OpenMS/contrib-build/;/usr/;/usr/local' \
+ -DHAS_XSERVER=OFF \
+ -DBOOST_USE_STATIC=OFF \
+ -DPYOPENMS=ON \
+ -DPY_MEMLEAK_DISABLE=ON \
+ -DOPENMS_USE_OPENMP=ON \
+ ../OpenMS"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| RUN /bin/bash -c "cmake -DCMAKE_BUILD_TYPE='Release' -DCMAKE_PREFIX_PATH='/OpenMS/contrib-build/;/usr/;/usr/local' -DHAS_XSERVER=OFF -DBOOST_USE_STATIC=OFF -DPYOPENMS=ON ../OpenMS -DPY_MEMLEAK_DISABLE=On DOPENMP=ON" | |
| RUN /bin/bash -c "cmake \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DCMAKE_PREFIX_PATH='/OpenMS/contrib-build/;/usr/;/usr/local' \ | |
| -DHAS_XSERVER=OFF \ | |
| -DBOOST_USE_STATIC=OFF \ | |
| -DPYOPENMS=ON \ | |
| -DPY_MEMLEAK_DISABLE=ON \ | |
| -DOPENMS_USE_OPENMP=ON \ | |
| ../OpenMS" |
🤖 Prompt for AI Agents
In Dockerfile around line 106, the CMake command uses an incorrect OpenMP flag
and places -D options after the source dir; update the RUN line so all -D
options come before the source directory, replace the incorrect DOPENMP flag
with -DOPENMS_USE_OPENMP=ON, and normalize boolean values to uppercase (ON/OFF)
for flags like PYOPENMS and PY_MEMLEAK_DISABLE; ensure CMAKE_PREFIX_PATH and
other -D settings remain but appear before the final "../OpenMS" argument.
Summary by CodeRabbit
New Version
Performance
Chores