aliutkus / torchinterp1d

1D interpolation for pytorch
BSD 3-Clause "New" or "Revised" License
162 stars 19 forks source link

Searchsorted dependency not installing w. GCC #2

Open catubc opened 5 years ago

catubc commented 5 years ago

Hi Thanks so much for writing this, much needed.

However, I am unable to install the torchsearchsorted extension due to some gcc version incompatibility. Do you have any insights/experience with this? (I did try also installing with gcc ver 4.8 also).

Thanks so much! Catubc

building 'torchsearchsorted.cuda' extension
gcc-5 -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/cat/anaconda3/envs/yass2/lib/python3.6/site-packages/torch/lib/include -I/home/cat/anaconda3/envs/yass2/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -I/home/cat/anaconda3/envs/yass2/lib/python3.6/site-packages/torch/lib/include/TH -I/home/cat/anaconda3/envs/yass2/lib/python3.6/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/home/cat/anaconda3/envs/yass2/include/python3.6m -c torchsearchsorted/cuda/searchsorted_cuda_wrapper.cpp -o build/temp.linux-x86_64-3.6/torchsearchsorted/cuda/searchsorted_cuda_wrapper.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
/usr/local/cuda/bin/nvcc -I/home/cat/anaconda3/envs/yass2/lib/python3.6/site-packages/torch/lib/include -I/home/cat/anaconda3/envs/yass2/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -I/home/cat/anaconda3/envs/yass2/lib/python3.6/site-packages/torch/lib/include/TH -I/home/cat/anaconda3/envs/yass2/lib/python3.6/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/home/cat/anaconda3/envs/yass2/include/python3.6m -c torchsearchsorted/cuda/searchsorted_cuda_kernel.cu -o build/temp.linux-x86_64-3.6/torchsearchsorted/cuda/searchsorted_cuda_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
In file included from /usr/local/cuda/include/cuda_runtime.h:78:0,
                 from <command-line>:0:
/usr/local/cuda/include/host_config.h:119:2: error: #error -- unsupported GNU version! gcc versions later than 5 are not supported!
 #error -- unsupported GNU version! gcc versions later than 5 are not supported!
  ^~~~~
error: command '/usr/local/cuda/bin/nvcc' failed with exit status 1

EDIT: Sorry, I just realized that the interp1d function does not do fourier based interpolation which is what I was looking for.

aliutkus commented 5 years ago

no worries !

For the reference: I had exactly the same problem as you did concerning the gcc dependency. In my case (cuda 10), it was a gcc > 6 that was needed.

I solved it by creating symbolic links of the appropriate gcc and g++ versions to the nvidia bin directory the following way:

sudo ln -s /usr/bin/g++-6 /usr/local/cuda-10.0/bin/g++
sudo ln -s /usr/bin/gcc-6 /usr/local/cuda-10.0/bin/gcc

you can probably adapt this solution with some gcc-5

HTH