Skip to content

Fixed oneAPI check and get version - #16053

Open
kentonwho wants to merge 8 commits into
mesonbuild:masterfrom
kentonwho:patch-1
Open

Fixed oneAPI check and get version#16053
kentonwho wants to merge 8 commits into
mesonbuild:masterfrom
kentonwho:patch-1

Conversation

@kentonwho

@kentonwho kentonwho commented Aug 1, 2026

Copy link
Copy Markdown

At early as 2021.16, oneAPI-MPI's versioning command may use a capital '-V' instead of lowercase '-v'. This is patched by adding an additional '-V' check. In addition, in only the Fortran wrappers, it gives an error code, which is patched by adapting returncode_value to 1. This resolves #16052.

As of 2021.17, oneAPI's wrapper versioning command gives an error and uses a capital '-V' instead of lowercase '-v'. This is patched by adding an additional '-V' check, and changing the error code to 1. This resolves mesonbuild#16052
@kentonwho
kentonwho requested a review from jpakkane as a code owner August 1, 2026 09:12
@kentonwho
kentonwho marked this pull request as draft August 1, 2026 09:14
@kentonwho
kentonwho marked this pull request as ready for review August 1, 2026 09:18
@kentonwho

Copy link
Copy Markdown
Author

said error:

$ mpiifx -V
mpiifx for the Intel(R) MPI Library 2021.17 for Linux*
Copyright Intel Corporation.
Intel(R) Fortran Compiler for applications running on Intel(R) 64, Version 2025.3.2 Build 20260112
Copyright (C) 1985-2026 Intel Corporation. All rights reserved.

GNU ld (GNU Binutils for Ubuntu) 2.38
ld: /opt/spack/opt/spack/linux-skylake/intel-oneapi-compilers-2025.3.2-nhus2sux6zzkjs7rw2dkj23autib5usl/compiler/2025.3/lib/for_main.o: in function `main':
for_main.c:(.text+0x19): undefined reference to `MAIN__'

@bonzini bonzini added this to the 1.11.3 milestone Aug 4, 2026
@kentonwho

kentonwho commented Aug 6, 2026

Copy link
Copy Markdown
Author

Update: see below, the assessment of the source of the non-zero exit code was slightly inaccurate

Update: upon a closer look at other versions, it actually looks like Intel has completely mangled what -v/V is supposed to do:

| Version | Flag | What the --help says it does | What it actually returns | Executes and returns error code on empty arguments? |
|---|---|---|---|---|
| mpiifort for the Intel(R) MPI Library 2019 Update 9 for Linux* | -v | Return driver tools and execute | Wrapper info | No |
| mpiifort for the Intel(R) MPI Library 2019 Update 9 for Linux* | -V | Return compiler version | Compiler info | No
| mpiifx 2021.16.0 | -v | Return driver tools and execute | Driver tools | No |
| mpiifx 2021.16.0 | -V | Compiler info | Wrapper info | No |
| mpiifx 2021.17.0 | -v | None | Driver tools | Yes |
| mpiifx 2021.17.0 | -V | None | Wrapper info | Yes |
| mpiifx 2021.18.0 | -v | Return driver tools and execute | Driver tools | Yes |
| mpiifx 2021.18.0 | -V | Return compiler version | Wrapper info | Yes |

In particular in 2021.17 and 2021.18, both -v and V actually attempt to execute ifx, which results in an error code when used to verify installation. I can't say what they want to happen for sure, but I would guess that '-V' is supposed to return the wrapper info and not execute (like in 2021.16). Because of that I think it makes the most sense for Meson MPI to be pinned to 2021.16 and warn on newer versions. A wider fallback like checking for '--help' is an alternative.

Add fallback check for --help, necessary to catch Intel's unstable mpiifx -V/v flags since >2021.16
Updated note regarding Intel oneAPI MPI wrappers detection issues.
@kentonwho

Copy link
Copy Markdown
Author

also as a suggestion, it may be helpful to add a warning when intel-llvm is used and falls back to mpif90, since Intel intended mpif90 to build using gfortran, which would prevent confusing interactions like #16052

@kentonwho

kentonwho commented Aug 10, 2026

Copy link
Copy Markdown
Author

Update: actually, the mangling seems to occur because of ifx, not mpiifx, and maybe install stream dependent. It seems the mpiifx versioning always uses capital '-V' (again even though the usage message says -v), which is always passed to ifx. How ifx responds to an empty -V seems to be dependent on the installation stream. I cross referenced 2025.2.1 Build 20250806 across the installer, conda, and spack, and it seems to only execute with error with the install through the spack stream somehow? Doc changes have been updated accordingly.

This may be connected to spack/spack#47672

@kentonwho

kentonwho commented Aug 11, 2026

Copy link
Copy Markdown
Author

#16052 (comment) outlines 2 upstream bugs and 1 Meson bug lining up to create a failure mode. This PR implements a workaround for upstream bug 1 and bug 2.

warn users against remaining soft failure mode
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.

GCC Fortran MPI flags leaking into Intel C++ build string

2 participants