美文网首页
困扰多时的torch-sparse编译错误得到解决

困扰多时的torch-sparse编译错误得到解决

作者: 知唐奶爸 | 来源:发表于2020-12-23 21:37 被阅读0次

    最近在编译torch-geometric库的时候,经常遇到这个错误:

    /usr/include/c++/7/bits/basic_string.tcc:1067:16: error: cannot call member function ‘void std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_M_set_sharable() [with _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>]’ without object

      error: command '/usr/local/cuda/bin/nvcc' failed with exit status 1

      ----------------------------------------

      ERROR: Failed building wheel for torch-sparse

    几经搜索和实验,编译错误得到解决如下:

    You can refer to this link and it solves my question: https://forums.developer.nvidia.com/t/cuda-10-1-nvidia-youre-now-fixing-gcc-bugs-that-gcc-doesnt-even-have/71063/6

    changing devtoolset-8/root/usr/include/c++/8/bits/basic_string.tcc:1067 from this:

    __p->_M_set_sharable();

    to this seems to fix the compiler error:

    (*__p)._M_set_sharable()。

    记录一下,以免以后忘记!

    相关文章

      网友评论

          本文标题:困扰多时的torch-sparse编译错误得到解决

          本文链接:https://www.haomeiwen.com/subject/jznunktx.html