From 67e8e9a1ea31579049eadcc6dcc451c80ce46f97 Mon Sep 17 00:00:00 2001 From: Dun Liang Date: Fri, 14 May 2021 15:16:16 +0800 Subject: [PATCH] os polish --- python/jittor/__init__.py | 2 +- python/jittor/compiler.py | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/python/jittor/__init__.py b/python/jittor/__init__.py index e8231728..7e1db286 100644 --- a/python/jittor/__init__.py +++ b/python/jittor/__init__.py @@ -9,7 +9,7 @@ # file 'LICENSE.txt', which is part of this source code package. # *************************************************************** -__version__ = '1.2.3.5' +__version__ = '1.2.3.6' from . import lock with lock.lock_scope(): ori_int = int diff --git a/python/jittor/compiler.py b/python/jittor/compiler.py index 2e303e70..b142b071 100644 --- a/python/jittor/compiler.py +++ b/python/jittor/compiler.py @@ -997,8 +997,8 @@ with open("/etc/os-release", "r", encoding='utf8') as f: os_release[a[0]] = a[1].replace("\"", "") os_type = { - "ubuntu": "", - "debian": "", + "ubuntu": "ubuntu", + "debian": "ubuntu", "centos": "centos", } version_file = os.path.join(jittor_path, "version") @@ -1008,13 +1008,12 @@ if os.path.isfile(version_file) and not os.path.isdir(os.path.join(jittor_path, # key = f"{version}-{cc_type}-{'cuda' if has_cuda else 'cpu'}.o" key = f"{version}-g++-cpu" os_id = os_release["ID"] - os_key = os_type.get(os_id, "") - LOG.i("OS type:", os_id, "OS key", os_key) - if len(os_key): - key += '-' + os_key + os_key = os_type.get(os_id, "ubuntu") + LOG.i("OS type:", os_id, " OS key:", os_key) + key += '-' + os_key + '.o' # TODO: open the website extra_obj = os.path.join(cache_path, key) - url = os.path.join("https://cg.cs.tsinghua.edu.cn/jittor/assets/build/"+key+".o") + url = os.path.join("https://cg.cs.tsinghua.edu.cn/jittor/assets/build/"+key) jit_utils.download(url, extra_obj) files.append(extra_obj)