summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJohn W. Parent <45471568+johnwparent@users.noreply.github.com>2022-12-16 14:22:04 -0500
committerGitHub <noreply@github.com>2022-12-16 19:22:04 +0000
commit642c5b876b11f23323338e9025470e6fbdc6e913 (patch)
tree36f75e29b90c83574d5abf3a59efcb182de532bc /lib
parent8b7bd6dc743a1d733721eb8d0fe8e2cf83ff22bb (diff)
downloadspack-642c5b876b11f23323338e9025470e6fbdc6e913.tar.gz
spack-642c5b876b11f23323338e9025470e6fbdc6e913.tar.bz2
spack-642c5b876b11f23323338e9025470e6fbdc6e913.tar.xz
spack-642c5b876b11f23323338e9025470e6fbdc6e913.zip
Compiler detection: avoid false recognition of MSVC (#34574)
Interim fix for #34559 Spack's MSVC compiler definition uses ifx as the Fortran compiler. Prior to #33385, the Spack MSVC compiler definition required the executable to be called "ifx.exe"; #33385 replaced this with just "ifx", which inadvertently led to ifx falsely indicating the presence of MSVC on non-Windows systems (which leads to future errors when attempting to query/use those compiler objects). This commit applies a short-term fix by updating MSVC Fortran version detection to always indicate a failure on non-Windows.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/compilers/msvc.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/spack/spack/compilers/msvc.py b/lib/spack/spack/compilers/msvc.py
index d7576b78e6..86d51461aa 100644
--- a/lib/spack/spack/compilers/msvc.py
+++ b/lib/spack/spack/compilers/msvc.py
@@ -160,6 +160,8 @@ class Msvc(Compiler):
def fc_version(cls, fc):
# We're using intel for the Fortran compilers, which exist if
# ONEAPI_ROOT is a meaningful variable
+ if not sys.platform == "win32":
+ return "unknown"
fc_ver = cls.default_version(fc)
avail_fc_version.add(fc_ver)
fc_path[fc_ver] = fc