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

CI: compilation fails on python 3.7 (but not 3.6 or 3.8) #30

Open
balbasty opened this issue Dec 10, 2020 · 0 comments
Open

CI: compilation fails on python 3.7 (but not 3.6 or 3.8) #30

balbasty opened this issue Dec 10, 2020 · 0 comments
Labels
bug Something isn't working build / ci Build system or continuous integration

Comments

@balbasty
Copy link
Owner

It's super weird: on github's CI server, the compilation fails [only] on python 3.7.

Failure happens at the last linking step (the extension files that binds the c++ code to python): the linker cannot find the python library libpython3.7m even though the python lib directory is correctly specified (/opt/hostedtoolcache/Python/3.7.9/x64/lib). Or maybe it isn't... (why is it not -L?)

g++ -pthread -shared \
    -Wl,--rpath=/opt/hostedtoolcache/Python/3.7.9/x64/lib \
    -Wl,--rpath=/opt/hostedtoolcache/Python/3.7.9/x64/lib \
    build/temp.linux-x86_64-3.7/_C/spatial/home/runner/work/nitorch/nitorch/nitorch/_C/spatial.o \
    -L/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages/torch/lib \
    -Lbuild/lib.linux-x86_64-3.7/nitorch/lib \
    -Wl,--enable-new-dtags,-R$ORIGIN/../lib \
    -lc10 -ltorch_cpu -ltorch_python -ltorch -lnitorch -lpython3.7m \
    -o build/lib.linux-x86_64-3.7/nitorch/_C/spatial.cpython-37m-x86_64-linux-gnu.so

/usr/bin/ld: cannot find -lpython3.7m

Here's what happens on 3.6 (which does not fail):

g++ -pthread -shared \
    -Wl,--rpath=/opt/hostedtoolcache/Python/3.6.12/x64/lib \
    -Wl,--rpath=/opt/hostedtoolcache/Python/3.6.12/x64/lib \
    build/temp.linux-x86_64-3.6/_C/spatial/home/runner/work/nitorch/nitorch/nitorch/_C/spatial.o \
    -L/opt/hostedtoolcache/Python/3.6.12/x64/lib/python3.6/site-packages/torch/lib \
    -Lbuild/lib.linux-x86_64-3.6/nitorch/lib \
    -Wl,--enable-new-dtags,-R$ORIGIN/../lib \
    -lc10 -ltorch_cpu -ltorch_python -ltorch -lnitorch -lpython3.6m \
    -o build/lib.linux-x86_64-3.6/nitorch/_C/spatial.cpython-36m-x86_64-linux-gnu.so

I have disabled the tests on python 3.7 in the meantime

@balbasty balbasty added bug Something isn't working build / ci Build system or continuous integration labels Dec 10, 2020
balbasty added a commit that referenced this issue Dec 10, 2020
* compilation is tested on a matrix of Python x PyTorch x CUDA versions (only on ubuntu for the moment) and triggered when c++/cuda files change (or when setup.py changes)

* tests are run on two versions of PyTorch (on cpu only since the servers do not have a gpu) and triggered when any of the library files change (nitorch/**)

* I had to disable one test that failed (grid_grad -> see #29)

* I also had to disable compilation on Python 3.7 which fails weirdly (see #30)

* Compilation on mac and windows is not there yet (needs a lot more work)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working build / ci Build system or continuous integration
Projects
None yet
Development

No branches or pull requests

1 participant