You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: setup.py
+32Lines changed: 32 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,7 @@
22
22
# SOFTWARE.
23
23
#
24
24
25
+
importatexit
25
26
importos
26
27
importsubprocess
27
28
importsys
@@ -34,6 +35,37 @@
34
35
ENABLE_SPARSE=os.getenv("ENABLE_SPARSE")
35
36
36
37
38
+
_warning_printed=False
39
+
40
+
41
+
defprint_platform_warning():
42
+
global_warning_printed
43
+
ifnotPLATFORMandnot_warning_printed:
44
+
_warning_printed=True
45
+
RED="\033[91m"
46
+
YELLOW="\033[93m"
47
+
BOLD="\033[1m"
48
+
RESET="\033[0m"
49
+
50
+
warning_msg=f"""
51
+
{RED}{'='*80}
52
+
{BOLD}⚠️ WARNING: PLATFORM environment variable is not set! ⚠️{RESET}
53
+
{RED}{'='*80}{RESET}
54
+
{YELLOW}Please set PLATFORM to one of: cuda, ascend, musa, maca{RESET}
55
+
Example:
56
+
{BOLD}export PLATFORM=cuda{RESET} # For CUDA platform
57
+
{YELLOW}In CI scenarios only, you don't need to specify PLATFORM. If it's not a CI scenario, please uninstall and then reinstall with PLATFORM specified.{RESET}
58
+
{RED}{'='*80}{RESET}
59
+
"""
60
+
# Use write and flush to ensure output even without -v flag
0 commit comments