teddykoker / torchsort

Fast, differentiable sorting and ranking in PyTorch
https://pypi.org/project/torchsort/
Apache License 2.0
765 stars 33 forks source link

Error during installation #44

Closed Possums closed 2 years ago

Possums commented 2 years ago

I'm encountering the following error both when installing with pip and compiling from source.

<stdin>:1:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
/usr/bin/ld: cannot find -lc10-avx2
collect2: error: ld returned 1 exit status
<stdin>:1:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
/usr/bin/ld: cannot find -ltorch-avx2
collect2: error: ld returned 1 exit status
<stdin>:1:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
/usr/bin/ld: cannot find -ltorch_cpu-avx2
collect2: error: ld returned 1 exit status
<stdin>:1:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
/usr/bin/ld: cannot find -ltorch_python-avx2
collect2: error: ld returned 1 exit status
<stdin>:1:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
/usr/bin/ld: cannot find -lc10-avx512
collect2: error: ld returned 1 exit status
<stdin>:1:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
/usr/bin/ld: cannot find -ltorch-avx512
collect2: error: ld returned 1 exit status
<stdin>:1:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
/usr/bin/ld: cannot find -ltorch_cpu-avx512
collect2: error: ld returned 1 exit status
<stdin>:1:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
/usr/bin/ld: cannot find -ltorch_python-avx512
collect2: error: ld returned 1 exit status
g++ -pthread -shared -Wa,-mbranches-within-32B-boundaries -Wl,--build-id=sha1 -Wl,--build-id=sha1 /home/user/downloads/torchsort/build/temp.linux-x86_64-3.9/torchsort/isotonic_cpu.o -L/usr/lib/python3.9/site-packages/torch/lib -lc10 -ltorch -ltorch_cpu -ltorch_python -o build/lib.linux-x86_64-3.9/torchsort/isotonic_cpu.cpython-39-x86_64-linux-gnu.so
g++ -pthread -shared -Wa,-mbranches-within-32B-boundaries -Wl,--build-id=sha1 -Wl,--build-id=sha1 /home/user/downloads/torchsort/build/temp.linux-x86_64-3.9/torchsort/isotonic_cpu.o.avx2 -L/usr/lib/python3.9/site-packages/torch/lib -lc10 -ltorch -ltorch_cpu -ltorch_python -o build/lib.linux-x86_64-3.9/torchsort/isotonic_cpu.cpython-39-x86_64-linux-gnu.so.avx2
/usr/bin/ld: cannot find /home/user/downloads/torchsort/build/temp.linux-x86_64-3.9/torchsort/isotonic_cpu.o.avx2: No such file or directory
collect2: error: ld returned 1 exit status
error: command '/usr/bin/g++' failed with exit code 1

Any ideas on how to resolve this?

teddykoker commented 2 years ago

It looks like the linker is failing to find the torch libraries. Could you also share:

Possums commented 2 years ago

Thanks for the help!

teddykoker commented 2 years ago

Any chance you've figured this out? I haven't been able to reproduce on my end.