spack
spack copied to clipboard
How to detect ifort when using Cray compiler wrappers so that SPACK_ALWAYS flags get set?
In https://github.com/spack/spack/pull/44588 we added logic to suppress deprecation warnings from the Intel classic compilers that mess up parts of the build system, e.g. meson
builds in Python, that run version checks of the compiler.
One of the shortcomings noted back then was that the logic in
https://github.com/spack/spack/blob/adaa0a4863a810fa99d392a96c372f8be45e81f4/lib/spack/spack/compilers/intel.py#L132
and similarly, in the oneapi.py
module relied on detecting whether the classic compilers are used or not. The rationale behind this was that we don't need those flags for the Intel LLVM compilers. But the problem with this is that on a Cray system, this logic doesn't work if the Cray compiler wrappers are used (e.g. ftn
).
I checked and the Intel LLVM compilers also understand and simply ignore the -diag-disable
flags that suppress these deprecation warnings (all the way up to 2024.2.1 so far). What's more, Intel released that oneapi@2024 will be the last ever release of the ifort
compiler (just like oneapi@2023 was the last ever release of icc
and icpc
).
Thus, my thinking is that we could simply remove the check for the classic compilers and always apply these SPACK_ALWAYS flags as long as the version check on the same line passes, and amend that version check as follows:
if self.real_version >= Version("2021") and self.real_version <= Version("2024")
for the Fortran case, and
if self.real_version >= Version("2021") and self.real_version <= Version("2023")
for the C and C++ cases.