msvc: fix imports (#50543)
This commit is contained in:
parent
f07789febf
commit
ef2b596e3f
@ -12,7 +12,6 @@
|
||||
import archspec.cpu
|
||||
|
||||
import spack.platforms
|
||||
import spack.version
|
||||
from spack.package import *
|
||||
|
||||
FC_PATH: Dict[str, str] = dict()
|
||||
@ -154,9 +153,7 @@ def init_msvc(self):
|
||||
if str(archspec.cpu.host().family) == "x86_64":
|
||||
arch = "amd64"
|
||||
|
||||
msvc_version = spack.version.Version(
|
||||
re.search(Msvc.compiler_version_regex, self.cc).group(1)
|
||||
)
|
||||
msvc_version = Version(re.search(Msvc.compiler_version_regex, self.cc).group(1))
|
||||
self.vcvars_call = VCVarsInvocation(vcvars_script_path, arch, msvc_version)
|
||||
env_cmds.append(self.vcvars_call)
|
||||
|
||||
@ -237,7 +234,7 @@ def vc_toolset_ver(self):
|
||||
@property
|
||||
def msvc_version(self):
|
||||
"""This is the VCToolset version *NOT* the actual version of the cl compiler"""
|
||||
return spack.version.Version(re.search(Msvc.compiler_version_regex, self.cc).group(1))
|
||||
return Version(re.search(Msvc.compiler_version_regex, self.cc).group(1))
|
||||
|
||||
@property
|
||||
def vs_root(self):
|
||||
@ -267,7 +264,7 @@ def platform_toolset_ver(self):
|
||||
# TODO: (johnwparent) Update this logic for the next platform toolset
|
||||
# or VC toolset version update
|
||||
toolset_ver = self.vc_toolset_ver
|
||||
vs22_toolset = spack.version.Version(toolset_ver) > Version("142")
|
||||
vs22_toolset = Version(toolset_ver) > Version("142")
|
||||
return toolset_ver if not vs22_toolset else "143"
|
||||
|
||||
|
||||
@ -362,6 +359,6 @@ def get_valid_fortran_pth():
|
||||
"""Assign maximum available fortran compiler version"""
|
||||
# TODO (johnwparent): validate compatibility w/ try compiler
|
||||
# functionality when added
|
||||
sort_fn = lambda fc_ver: spack.version.Version(fc_ver)
|
||||
sort_fn = lambda fc_ver: Version(fc_ver)
|
||||
sort_fc_ver = sorted(list(FC_PATH.keys()), key=sort_fn)
|
||||
return FC_PATH[sort_fc_ver[-1]] if sort_fc_ver else None
|
||||
|
Loading…
Reference in New Issue
Block a user