setup.py issue with g++ and gcc version >10
caglasozen opened this issue · 3 comments
caglasozen commented
Issue Description
I believe this is the same issue as #38 . When trying to run the setup.py
for any extension. The following error occurs. Indeed the problem is related to g++ and gcc versions as described here.
building 'chamfer' extension
/usr/bin/nvcc -I/home/caglasozen/.cache/pypoetry/virtualenvs/pointr-V-JpY-Pz-py3.8/lib/python3.8/site-packages/torch/include -I/home/caglasozen/.cache/pypoetry/virtualenvs/pointr-V-JpY-Pz-py3.8/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/caglasozen/.cache/pypoetry/virtualenvs/pointr-V-JpY-Pz-py3.8/lib/python3.8/site-packages/torch/include/TH -I/home/caglasozen/.cache/pypoetry/virtualenvs/pointr-V-JpY-Pz-py3.8/lib/python3.8/site-packages/torch/include/THC -I/home/caglasozen/.cache/pypoetry/virtualenvs/pointr-V-JpY-Pz-py3.8/include -I/home/caglasozen/.pyenv/versions/3.8.10/include/python3.8 -c chamfer.cu -o build/temp.linux-x86_64-cpython-38/chamfer.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -DTORCH_EXTENSION_NAME=chamfer -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -std=c++14
/usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with '...':
435 | function(_Functor&& __f)
| ^
/usr/include/c++/11/bits/std_function.h:435:145: note: '_ArgTypes'
/usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not expanded with '...':
530 | operator=(_Functor&& __f)
| ^
/usr/include/c++/11/bits/std_function.h:530:146: note: '_ArgTypes'
error: command '/usr/bin/nvcc' failed with exit code 1
Solution
Downgrade gcc and g++. I followed this suggestion. to downgrade to 9.5.0 and now it works. Better solution would be to replace parts of c++ code that causes the issue as suggested here.
sudo apt-get install gcc-9 g++-9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9
sudo update-alternatives --config gcc
System & Environment
- gcc version 11.3.0
- Pytorch 11.1.0
- Python 3.8
- cuda 11.5
- nvcc 11.5
- Ubuntu 22.04
caglasozen commented
more errors appearing unfortunately
wbiedatkhai commented
@caglasozen were you able to fix this problem?