updated polish

This commit is contained in:
lzhengning 2021-06-09 21:42:39 +08:00
parent 3fdda2f91d
commit 582bdfe52b
2 changed files with 14 additions and 3 deletions

View File

@ -1041,7 +1041,7 @@ if platform.system() == 'Linux':
if len(a) != 2: continue if len(a) != 2: continue
os_release[a[0]] = a[1].replace("\"", "") os_release[a[0]] = a[1].replace("\"", "")
elif platform.system() == 'Darwin': elif platform.system() == 'Darwin':
os_release = {'ID' : 'macOS'} os_release = {'ID' : 'macos'}
os_type = { os_type = {
"ubuntu": "ubuntu", "ubuntu": "ubuntu",
@ -1049,7 +1049,7 @@ os_type = {
"centos": "centos", "centos": "centos",
"rhel": "ubuntu", "rhel": "ubuntu",
"fedora": "ubuntu", "fedora": "ubuntu",
"macOS": "macOS", "macos": "macos",
} }
version_file = os.path.join(jittor_path, "version") version_file = os.path.join(jittor_path, "version")

View File

@ -23,6 +23,7 @@ from jittor.compiler import run_cmd
from jittor_utils import translator from jittor_utils import translator
from jittor.utils.polish_centos import run_in_centos from jittor.utils.polish_centos import run_in_centos
import sys import sys
import platform
jittor_path = jt.flags.jittor_path jittor_path = jt.flags.jittor_path
root_path = os.path.realpath(os.path.join(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()) home = str(Path.home())
# for cc_type in ["g++", "clang"]: # for cc_type in ["g++", "clang"]:
# for device in ["cpu", "cuda"]: # 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 cc_type in ["g++"]:
for device in ["cpu"]: for device in ["cpu"]:
key = f"{git_version}-{cc_type}-{device}" key = f"{git_version}-{cc_type}-{device}"