From 749301d13381fd3f6ec0ed579411e5d77ca496cc Mon Sep 17 00:00:00 2001 From: "John W. Parent" <45471568+johnwparent@users.noreply.github.com> Date: Tue, 30 Jan 2024 13:18:54 -0500 Subject: 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 --- lib/spack/spack/compilers/msvc.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'lib') 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) -- cgit v1.2.3-70-g09d2