summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn W. Parent <45471568+johnwparent@users.noreply.github.com>2024-01-30 13:18:54 -0500
committerGitHub <noreply@github.com>2024-01-30 10:18:54 -0800
commit749301d13381fd3f6ec0ed579411e5d77ca496cc (patch)
tree3b16b14b9e384de4b43f3dec5921fa0489cd0521
parenta20c0de6d8cbeb233700b224329808818b06d0e7 (diff)
downloadspack-749301d13381fd3f6ec0ed579411e5d77ca496cc.tar.gz
spack-749301d13381fd3f6ec0ed579411e5d77ca496cc.tar.bz2
spack-749301d13381fd3f6ec0ed579411e5d77ca496cc.tar.xz
spack-749301d13381fd3f6ec0ed579411e5d77ca496cc.zip
MSVC: Broken ifx needs new $TMP (#42155)
Certain versions of ifx (the majority of those available) have an issue where they are not compatible with TMP directories with dot chars This precludes their use with CMake. Remap TMP to point to the stage directory rather than whatever the TMP default is
-rw-r--r--lib/spack/spack/compilers/msvc.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/spack/spack/compilers/msvc.py b/lib/spack/spack/compilers/msvc.py
index e6cd29c570..864d578b81 100644
--- a/lib/spack/spack/compilers/msvc.py
+++ b/lib/spack/spack/compilers/msvc.py
@@ -7,6 +7,7 @@ import os
import re
import subprocess
import sys
+import tempfile
from typing import Dict, List, Set
import spack.compiler
@@ -15,7 +16,7 @@ import spack.platforms
import spack.util.executable
from spack.compiler import Compiler
from spack.error import SpackError
-from spack.version import Version
+from spack.version import Version, VersionRange
avail_fc_version: Set[str] = set()
fc_path: Dict[str, str] = dict()
@@ -292,6 +293,15 @@ class Msvc(Compiler):
else:
env.set_path(env_var, int_env[env_var].split(os.pathsep))
+ # certain versions of ifx (2021.3.0:2023.1.0) do not play well with env:TMP
+ # that has a "." character in the path
+ # Work around by pointing tmp to the stage for the duration of the build
+ if self.fc and Version(self.fc_version(self.fc)).satisfies(
+ VersionRange("2021.3.0", "2023.1.0")
+ ):
+ new_tmp = tempfile.mkdtemp(dir=pkg.stage.path)
+ env.set("TMP", new_tmp)
+
env.set("CC", self.cc)
env.set("CXX", self.cxx)
env.set("FC", self.fc)