欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 健康 > 美食 > error -- unsupported GNU version gcc later than 10 are not supported;(gcc、g++)

error -- unsupported GNU version gcc later than 10 are not supported;(gcc、g++)

2025/12/9 0:18:23 来源:https://blog.csdn.net/m0_72806612/article/details/142440620  浏览:    关键词:error -- unsupported GNU version gcc later than 10 are not supported;(gcc、g++)

服务器跑dit时编译flash-atten以及pytorch的cuda版本检查出错,分别报错题目以及如下:

想了下是系统找不到编译器

subprocess.CalledProcessError: Command '['which', 'c++']' returned non-zero exit status 1.

备案,以后有人要用12我还得换回来

方案一:更改gcc和gcc+的版本

没有合适的版本的话需要root权限指定版本安装

安装好以后设置优先级如下:

查看两种编译器版本号:

gcc -v

g++ -v

设置两种编译器多版本优先级:

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 40

xym@try2019-Super-Server:/usr/bin$ sudo update-alternatives --config gcc
There are 2 choices for the alternative gcc (providing /usr/bin/gcc).

  Selection    Path             Priority   Status
------------------------------------------------------------
  0            /usr/bin/gcc-12   50        auto mode
* 1            /usr/bin/gcc-11   40        manual mode
  2            /usr/bin/gcc-12   50        manual mode

Press <enter> to keep the current choice[*], or type selection number: 

g++ -v

Command 'g++' not found, but can be installed with:
apt install g++

sudo update-alternatives --config g++

------------------------------------------------------------
  0            /usr/bin/g++-12   50        auto mode
* 1            /usr/bin/g++-11   40        manual mode
  2            /usr/bin/g++-12   50        manual mode

Press <enter> to keep the current choice[*], or type selection number: 

方案二:

重新安装cuda-toolkit,因为它的版本和cuda对不上,但是有一些风险,这里不做推荐

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词