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 . +# 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 . +# +# 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/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")