From 6414b8333a800f104511adaf2a36703c787a8b44 Mon Sep 17 00:00:00 2001 From: Dell Du <18588220928@163.com> Date: Thu, 30 Jun 2022 19:00:46 +0800 Subject: [PATCH 1/2] Fix Jittor Utils Config Bugs --- python/jittor_utils/config.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python/jittor_utils/config.py b/python/jittor_utils/config.py index 7b13dc37..32079aa0 100644 --- a/python/jittor_utils/config.py +++ b/python/jittor_utils/config.py @@ -13,7 +13,7 @@ def search_file(dirs, name): LOG.f(f"file {name} not found in {dirs}") if __name__ == "__main__": - help_msg = f"Usage: {sys.executable} -m jittor_utils.config --include-flags|--link-flags|--cxx-flags|--cxx-example|--help" + help_msg = f"Usage: {sys.executable} -m jittor_utils.config --include-flags|--libs-flags|--cxx-flags|--cxx-example|--help" if len(sys.argv) <= 1: print(help_msg) sys.exit(1) @@ -38,7 +38,10 @@ def search_file(dirs, name): for libbase in libpaths: libpath = os.path.join(libbase, f"lib{base}.{libext}") if os.path.isfile(libpath): - s += f" -L{libbase} -l{base} -ldl " + if os.name == "posix": + s += f" -Wl,-rpath={libbase} -L{libbase} -l{base} -ldl " + else: + s += f" -L{libbase} -l{base} -ldl " break else: raise RuntimeError("Python dynamic library not found") From 51280c0cda3020ff887c5f81ddccf81c0f8388f2 Mon Sep 17 00:00:00 2001 From: Dell Du <18588220928@163.com> Date: Sun, 3 Jul 2022 14:33:10 +0800 Subject: [PATCH 2/2] add init files for 'python setup.py build' warning. --- python/jittor/test/__init__.py | 8 ++++++++ python/jittor/utils/__init__.py | 10 ++++++++++ 2 files changed, 18 insertions(+) create mode 100644 python/jittor/test/__init__.py create mode 100644 python/jittor/utils/__init__.py diff --git a/python/jittor/test/__init__.py b/python/jittor/test/__init__.py new file mode 100644 index 00000000..6f5f4ccc --- /dev/null +++ b/python/jittor/test/__init__.py @@ -0,0 +1,8 @@ +#!/usr/bin/python3 + +# *************************************************************** +# Copyright (c) 2022 Jittor. All Rights Reserved. +# Maintainers: Dun Liang <randonlang@gmail.com>. +# This file is subject to the terms and conditions defined in +# file 'LICENSE.txt', which is part of this source code package. +# *************************************************************** diff --git a/python/jittor/utils/__init__.py b/python/jittor/utils/__init__.py new file mode 100644 index 00000000..c6f65e48 --- /dev/null +++ b/python/jittor/utils/__init__.py @@ -0,0 +1,10 @@ +#!/usr/bin/python3 +# *************************************************************** +# Copyright (c) 2022 Jittor. All Rights Reserved. +# Maintainers: +# Guowei Yang <471184555@qq.com> +# Dun Liang <randonlang@gmail.com>. +# +# This file is subject to the terms and conditions defined in +# file 'LICENSE.txt', which is part of this source code package. +# ***************************************************************