From bb8ad0fc3db814d39f8179a40213e0212c27cd81 Mon Sep 17 00:00:00 2001 From: w-bonelli Date: Thu, 8 Dec 2022 11:22:37 -0500 Subject: [PATCH] refactor: test for intel oneapi env vars (#125) --- pymake/pymake_base.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pymake/pymake_base.py b/pymake/pymake_base.py index 3f28f962..bcfb4dcd 100644 --- a/pymake/pymake_base.py +++ b/pymake/pymake_base.py @@ -1165,9 +1165,11 @@ def _create_win_batch( # open the batch file f = open(batchfile, "w") - # write the compilervars batch command to batchfile - line = "call " + intel_setvars + "\n" - f.write(line) + # only write the compilervars batch command to batchfile if env vars aren't already configured + # https://www.intel.com/content/www/us/en/develop/documentation/oneapi-programming-guide/top/oneapi-development-environment-setup/use-the-setvars-script-with-windows.html + if os.environ.get("SETVARS_COMPLETED") != "1": + line = "call " + intel_setvars + "\n" + f.write(line) # assume that header files may be in other folders, so make a list searchdir = []