Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Jittor Utils Config Bugs #348

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Fix Jittor Utils Config Bugs #348

wants to merge 3 commits into from

Conversation

delldu
Copy link

@delldu delldu commented Jun 30, 2022

1. Two Bugs for 'Jittor Utils Config':

  1. Bug 1: Command option for 'python -m jittor_utils.config'
    $ python -m jittor_utils.config
    Usage: /home/dell/miniconda3/envs/numba/bin/python -m jittor_utils.config --include-flags|--link-flags|--cxx-flags|--cxx-example|--help

Expected:
Usage: /home/dell/miniconda3/envs/numba/bin/python -m jittor_utils.config --include-flags|--libs-flags|--cxx-flags|--cxx-example|--help

  1. Bug 2: example could not find libpython3.10.so.1.0
$  python -m jittor_utils.config --cxx-example > example.cc
$ g++ example.cc $(python -m jittor_utils.config --include-flags --libs-flags --cxx-flags) -o example
$ ./example

./example: error while loading shared libraries: libpython3.10.so.1.0: cannot open shared object file: No such file or directory
$ ldd example
linux-vdso.so.1 (0x00007fff99cb2000)
libpython3.10.so.1.0 => not found
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f2732a25000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f2732843000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f2732828000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2732636000)
/lib64/ld-linux-x86-64.so.2 (0x00007f2732a59000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f27324e7000)

2. Fixed Results

  1. Bug 1:
    $ python -m jittor_utils.config
    Usage: /home/dell/miniconda3/envs/numba/bin/python -m jittor_utils.config --include-flags|--libs-flags|--cxx-flags|--cxx-example|--help

  2. Bug 2:
    $ python -m jittor_utils.config --libs-flags
    -Wl,-rpath=/home/dell/miniconda3/envs/numba/lib -L/home/dell/miniconda3/envs/numba/lib -lpython3.10 -ldl

$ python -m jittor_utils.config --cxx-example > example.cc
$ g++ example.cc $(python -m jittor_utils.config --include-flags --libs-flags --cxx-flags) -o example
$ ./example

...
pred.shape 2 1000

$ ldd example
linux-vdso.so.1 (0x00007ffdd2c92000)
libpython3.10.so.1.0 => /home/dell/miniconda3/envs/numba/lib/libpython3.10.so.1.0 (0x00007ff04eeb6000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff04ee95000)
libstdc++.so.6 => /home/dell/miniconda3/envs/numba/lib/libstdc++.so.6 (0x00007ff04ec81000)
libgcc_s.so.1 => /home/dell/miniconda3/envs/numba/lib/libgcc_s.so.1 (0x00007ff04ec67000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff04ea75000)
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007ff04ea70000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ff04e91f000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ff04e8fc000)
/lib64/ld-linux-x86-64.so.2 (0x00007ff04f295000)

@delldu
Copy link
Author

delldu commented Jul 3, 2022

$ python setup.py build
running build
running build_py
copying python/jittor/compiler.py -> build/lib/jittor
package init file 'python/jittor/test/init.py' not found (or not a regular file)
package init file 'python/jittor/utils/init.py' not found (or not a regular file)
copying python/jittor_utils/init.py -> build/lib/jittor_utils

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant