open-mmlab/mmyolo

Can't build after following instructions, "#error C++17 or later compatible compiler is required to use ATen."

mikeytrw opened this issue · 3 comments

Prerequisite

🐞 Describe the bug

Am trying to install MMYolo using the instructions on the github home page.

after cloning the git repo and running

mim install -v -e .

I get the following errors during the build of mmcv:

#error C++17 or later compatible compiler is required to use ATen.

I have tried installing mmcv from source following the instructions in the documentation line for line, but get other weird c++ copmile errors. If I just use 'mim install mmcv' then mmcv seems to install fine, but when trying to install mmyolo after this it tries to compile mmcv again from source. Some other issues recommend editing the mmcv compile files change it from c++14 to c++17 but I can't do this when mim install mmyolo downloads the source itself.

Please help I'm pulling my hair out over this.

Environment

Ubuntu under wsl.

I have pip, miniconda, cuda GPU:

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Thu_Nov_18_09:45:30_PST_2021
Cuda compilation tools, release 11.5, V11.5.119
Build cuda_11.5.r11.5/compiler.30672275_0

Additional information

No response

njho commented

Same

I managed to resolve this:

  • compile MMCV from source, chackout tag v2.0.1
  • edit the setup.py file to change 'c++14' to 'c++17'
  • change the nvcc compile environment variables to use an older version of gcc:

$ sudo apt install gcc-10 g++-10
$ export CC=/usr/bin/gcc-10
$ export CXX=/usr/bin/g++-10
$ export CUDA_ROOT=/usr/local/cuda
$ sudo ln -s /usr/bin/gcc-10 $CUDA_ROOT/bin/gcc
$ sudo ln -s /usr/bin/g++-10 $CUDA_ROOT/bin/g++