teddykoker / torchsort

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

Installation error on conda environment (and how to fix it) #35

Closed levnikmyskin closed 2 years ago

levnikmyskin commented 2 years ago

Hi! First things first, thanks for this package! Now, it looks like in some linux systems the package does not compile with pip install in conda environments (to me it looks like it does not compile on colab as well though).
In my case, the error was that the system compiler and the compiler used for installing pytorch via conda are different. I'm opening this issue just FYI (and because this will probably be helpful to others):
if this happens, you should install the g++ compiler with conda install -c conda-forge gxx_linux-64, set the env variable export CXX=/path/to/miniconda3/envs/env_name/bin/x86_64-conda_cos6-linux-gnu-g++. If this still fails, export also the LD_LIBRARY_PATH env variable to export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/miniconda3/lib.

teddykoker commented 2 years ago

Thanks @levnikmyskin, I'll add a note to the README!