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

相关推荐
章老师说2 小时前
BFE v1.8.3 正式发布:AI网关能力再升级,企业级七层负载均衡持续进化
运维·人工智能·负载均衡
星释9 小时前
鸿蒙智能体开发实战:23.常见问题
服务器·华为·ai·harmonyos·鸿蒙·智能体
天空'之城9 小时前
Linux 系统编程 22:五种 IO 模型全解
linux
小张成长计划..10 小时前
【Linux】10:冯·诺依曼体系结构和操作系统
linux·运维·服务器
悦儿遥遥雨114 小时前
PXE + Kickstart 无人值守批量部署系统
linux·javascript·nginx
m0_5648768414 小时前
没有公网IP的情况下,怎么进行远程连接两个电脑
服务器·tcp/ip·负载均衡
Imagine Miracle14 小时前
【WSL】让WSL2后台持久运行不自动关闭的解决方案
linux·windows·wsl
兔C14 小时前
Linux 命令行入门学习资料 day_2
linux·运维·服务器
eggcode15 小时前
Linux命令基础与操作技巧
linux
多巴胺梦想家15 小时前
事务与并发控制:当多人同时操作数据库
服务器·数据库·oracle