Skip to content

Add compiler version check in Devito to guard against unsupported toolchains #2586

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

Open
ggorman opened this issue Apr 16, 2025 · 2 comments
Open
Assignees

Comments

@ggorman
Copy link
Contributor

ggorman commented Apr 16, 2025

Description:

Currently, Devito does not explicitly verify the compiler version used during code generation or JIT compilation. This can lead to confusing or silent failures when using outdated, non-conforming, or otherwise unsupported compilers—particularly with features like OpenMP 4.0+ pragmas, vectorization support, and more aggressive optimization behaviors.

Proposal:

Introduce explicit compiler version checks within the Devito compilation pipeline to ensure compatibility and provide clear feedback to users.

Implementation Details:

  • Compiler Detection: Extend the existing compiler detection logic to retrieve both the compiler name and its version.

  • Minimum Supported Versions: Define and document the minimum supported compiler versions. For instance:

    • GCC: ≥ 7.0
    • Clang: ≥ 6.0
    • Intel oneAPI: >=2024.0.2
  • Version Verification: During the compilation setup, verify that the detected compiler version meets the minimum requirements.

  • User Feedback:

    • If the compiler version is below the minimum supported version, terminate the compilation process and display an informative error message.
    • [optional] If the compiler version is above the minimum but not among the versions tested in CI, emit a warning indicating that the compiler is untested and may lead to unexpected behavior.

Benefits:

  • Prevents cryptic or misleading compiler errors, such as silently ignored pragmas or miscompiled kernels.
  • Provides clear guidance to users regarding supported compiler versions.
  • Encourages the use of modern, standards-compliant toolchains, enhancing overall code reliability.

**Additional Notes:

  • Consider integrating these checks into the CI pipeline to ensure that any updates to supported compiler versions are consistently tested.
  • Update the Devito documentation to reflect these changes and guide users on configuring their environments accordingly.
@FabioLuporini
Copy link
Contributor

imho the warning makes sense because it suggests they should update their backend compiler instead

@FabioLuporini
Copy link
Contributor

we could intercept it and turn it into our own warning though

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

No branches or pull requests

3 participants