From 582bdfe52bb0af6321b6d20734f9637427848562 Mon Sep 17 00:00:00 2001 From: lzhengning Date: Wed, 9 Jun 2021 21:42:39 +0800 Subject: [PATCH] updated polish --- python/jittor/compiler.py | 4 ++-- python/jittor/utils/polish.py | 13 ++++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/python/jittor/compiler.py b/python/jittor/compiler.py index c77f6ea0..a8e492c3 100644 --- a/python/jittor/compiler.py +++ b/python/jittor/compiler.py @@ -1041,7 +1041,7 @@ if platform.system() == 'Linux': if len(a) != 2: continue os_release[a[0]] = a[1].replace("\"", "") elif platform.system() == 'Darwin': - os_release = {'ID' : 'macOS'} + os_release = {'ID' : 'macos'} os_type = { "ubuntu": "ubuntu", @@ -1049,7 +1049,7 @@ os_type = { "centos": "centos", "rhel": "ubuntu", "fedora": "ubuntu", - "macOS": "macOS", + "macos": "macos", } version_file = os.path.join(jittor_path, "version") diff --git a/python/jittor/utils/polish.py b/python/jittor/utils/polish.py index 54287d8c..e185b7b8 100644 --- a/python/jittor/utils/polish.py +++ b/python/jittor/utils/polish.py @@ -23,6 +23,7 @@ from jittor.compiler import run_cmd from jittor_utils import translator from jittor.utils.polish_centos import run_in_centos import sys +import platform jittor_path = jt.flags.jittor_path root_path = os.path.realpath(os.path.join(jt.flags.jittor_path, "..", "..")) @@ -52,7 +53,17 @@ from pathlib import Path home = str(Path.home()) # for cc_type in ["g++", "clang"]: # for device in ["cpu", "cuda"]: -for os_name in ['ubuntu', 'centos']: + +os_name_system_dict = { + 'ubuntu': 'Linux', + 'centos': 'Linux', + 'macos': 'Darwin', +} + +for os_name, os_type in os_name_system_dict.items(): + if platform.system() != os_type: + continue + for cc_type in ["g++"]: for device in ["cpu"]: key = f"{git_version}-{cc_type}-{device}"