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

相关推荐
K龙25 分钟前
私有资产测绘&安全流水线Shovel
运维·安全·开发·其它
影龙帝皖28 分钟前
Linux服务之lvs+keepalived nginx+keepalived负载均衡实例解析
linux·nginx·lvs
程序猫A建仔35 分钟前
【物联网】基于树莓派的物联网开发【4】——WIFI+SSH远程登录树莓派
运维·物联网·ssh
八月的雨季 最後的冰吻37 分钟前
SIP协议栈--osip源码梳理
linux·服务器·网络·c++·网络协议
jllllyuz1 小时前
matlab实现蚁群算法解决公交车路径规划问题
服务器·前端·数据库
山师第一深情1 小时前
ssh connect to remote gitlab without authority
服务器·ssh·gitlab
敖云岚2 小时前
【Linux】基于虚拟机实现网络的管理
linux·服务器·网络
luck_me52 小时前
如何远程执行脚本不留痕迹
linux·运维·服务器
-SGlow-2 小时前
Linux相关概念和易错知识点(40)(HTML资源交互、网页管理、搜索引擎)
linux·运维·服务器·网络·html·交互
默心2 小时前
centos7部署mysql5.7
linux·运维·mysql·centos