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对不上,但是有一些风险,这里不做推荐

相关推荐
云飞云共享云桌面1 小时前
昆山精密机械公司8个Solidworks共用一台服务器
运维·服务器·网络·3d·自动化·制造
恒创科技HK1 小时前
中国香港服务器中常提到的双向/全程CN2是什么意思?
运维·服务器
MyCollege19991 小时前
win10使用ssh访问vmware虚拟机
linux·运维·centos
许怀楠3 小时前
【主页介绍】
linux·c++·贪心算法·visual studio
大聪明-PLUS4 小时前
GCC 对 C 语言的扩展
linux·嵌入式·arm·smarc
大霞上仙5 小时前
jmeter实现两个接口的同时并发
运维·服务器·jmeter
我就要用Cx3305 小时前
配置docker常见问题
运维·docker·容器
Hello.Reader6 小时前
从零到一上手 Protocol Buffers用 C# 打造可演进的通讯录
java·linux·c#
nmxiaocui6 小时前
openssl升级
linux·运维·服务器
初学者_xuan6 小时前
零基础快速了解掌握Linux防火墙-Iptables
linux·服务器·防火墙·linux新手小白