Ubuntu18.04——切换gcc版本 / 报错解决: error -- unsupported GNU version gcc later than 10 are not supported
发布时间:2023-08-21 14:53:58 404
相关标签:
报错截图
/usr/local/cuda/include/crt/host_config.h:139:2: error: #error – unsupported GNU version! gcc versions later than 10 are not supported! The nvcc flag ‘-allow-unsupported-compiler’ can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
报错原因
Cuda与gcc, g++版本不匹配
解决方法
更换低版本gcc, g++即可.
1.查看当前版本
可见目前gcc和g++均为11版本(gcc在截图前刚更换)
2.安装其他版本gcc, g++
(1) apt下载
我这里安装5版本:
(2) 压缩包下载
下载地址: gcc源码镜像站
- ubuntu18.04 安装指定版本的gcc
编译低版本gcc时报错解决(以4.8版本为例):
- ./md-unwind-support.h:65:47: 错误:dereferencing pointer to incomplete type ‘struct ucontext’的解决方法
3.切换软链接
- gcc
- g++
4.检查
可见更换成功!
再次编译:
成功~
文章来源: https://blog.51cto.com/u_15906550/5921397
特别声明:以上内容(图片及文字)均为互联网收集或者用户上传发布,本站仅提供信息存储服务!如有侵权或有涉及法律问题请联系我们。
举报