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.
This commit is contained in:
John W. Parent 2024-04-04 14:14:44 -04:00 committed by GitHub
parent 3fed320013
commit ef0bb6fe6b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -199,7 +199,7 @@ def __init__(self, *args, **kwargs):
# 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"