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

相关推荐
火龙谷13 分钟前
【hadoop】master一键启动hadoop集群(高可用)
linux·hadoop
noravinsc27 分钟前
Linux 下 Module 工具的介绍与使用
linux·运维·服务器
c无序1 小时前
【Docker-13】Docker Container容器
运维·docker·容器
Sunlight_7771 小时前
第五章 SQLite数据库:1、SQLite 基础语法及使用案例
java·linux·服务器·jvm·数据库·tcp/ip·sqlite
Silence4Allen1 小时前
Ubuntu 安装WPS Office
linux·ubuntu·wps
程序员JerrySUN1 小时前
驱动开发硬核特训 · Day 11(下篇):从 virtio_blk 看虚拟总线驱动模型的真实落地
linux·驱动开发·嵌入式硬件
半兽先生1 小时前
CentOS 中安装 vim
linux·centos·vim
云达闲人2 小时前
Proxmox VE 用户与权限管理命令大全
运维·网络·云原生·容器·proxmox·用户权限管理·命令大全
喆星时瑜2 小时前
【Docker】运行错误提示 unknown shorthand flag: ‘d‘ in -d ----详细解决方法
运维·docker·容器
长流小哥3 小时前
Linux网络编程实战:从字节序到UDP协议栈的深度解析与开发指南
linux·c语言·开发语言·网络·udp