From 7dfcc480ba1e19bd3232349fc733caef94034292 Mon Sep 17 00:00:00 2001 From: stainer_t Date: Mon, 8 Sep 2025 13:48:49 +0200 Subject: Initial commit from Polytechnique Montreal --- script/set_pythonpath.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 script/set_pythonpath.py (limited to 'script/set_pythonpath.py') diff --git a/script/set_pythonpath.py b/script/set_pythonpath.py new file mode 100755 index 0000000..3fddc37 --- /dev/null +++ b/script/set_pythonpath.py @@ -0,0 +1,26 @@ +#!/bin/env python3 +""" generation of PYTHONPATH environment variable for PyGan using pth file""" + +import os, sys +mach=os.environ['MACH'] +Compiler = os.environ.get("COMPILER", None) # Compiler selection +if Compiler == "NVTOOLS": + name=os.getcwd() + "/../PyGan/lib/" + mach+"_nvidia" + "/python" +elif Compiler == "LLVMTOOLS": + name=os.getcwd() + "/../PyGan/lib/" + mach+"_llvm" + "/python" +elif Compiler == "INTELTOOLS": + name=os.getcwd() + "/../PyGan/lib/" + mach+"_intel" + "/python" +else: + name=os.getcwd() + "/../PyGan/lib/" + mach + "/python" +if os.path.isfile(name + "/easy-install.pth"): + pythonpath = "" + count = 0 + f = open(name + "/easy-install.pth", 'r') + for line in f: + count += 1 + location = "{}".format(name + line.strip()[1:]) + pythonpath = pythonpath + location + ":" + f.close() +else: + pythonpath = name +print(pythonpath) -- cgit v1.2.3