summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJohn W. Parent <45471568+johnwparent@users.noreply.github.com>2024-04-04 14:14:44 -0400
committerGitHub <noreply@github.com>2024-04-04 11:14:44 -0700
commitef0bb6fe6bfe06dd5d4d8b8634863f60a70e37b1 (patch)
tree73d32b3566766f0c1c783af211de93e040cda9fb /lib
parent3fed320013583a7301ca68ee8cb68d7e3d4ba12a (diff)
downloadspack-ef0bb6fe6bfe06dd5d4d8b8634863f60a70e37b1.tar.gz
spack-ef0bb6fe6bfe06dd5d4d8b8634863f60a70e37b1.tar.bz2
spack-ef0bb6fe6bfe06dd5d4d8b8634863f60a70e37b1.tar.xz
spack-ef0bb6fe6bfe06dd5d4d8b8634863f60a70e37b1.zip
Msvc: Determine OneAPI_ROOT from fc compiler path (#43131)
If ONEAPI_ROOT is not set as an environment variable, the current approach will raise an error. Instead we can compute the OneAPI_ROOT from the compiler paths like we do with vcvarsall.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/compilers/msvc.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/spack/spack/compilers/msvc.py b/lib/spack/spack/compilers/msvc.py
index cba2b6e41c..d34ef83c3e 100644
--- a/lib/spack/spack/compilers/msvc.py
+++ b/lib/spack/spack/compilers/msvc.py
@@ -199,7 +199,7 @@ class Msvc(Compiler):
# for a fortran compiler
if paths[2]:
# If this found, it sets all the vars
- oneapi_root = os.getenv("ONEAPI_ROOT")
+ oneapi_root = os.path.join(self.cc, "../../..")
oneapi_root_setvars = os.path.join(oneapi_root, "setvars.bat")
oneapi_version_setvars = os.path.join(
oneapi_root, "compiler", str(self.ifx_version), "env", "vars.bat"