You need GNU g++ >= 5.0, Apple clang >= 6.0 or LLVM clang >= 3.5. ***

问题描述

使用centos7进行kaldi编译,执行.configure --shared时,报错:

[root@localhost src]# ./configure --shared
Configuring KALDI to use MKL.
Checking compiler c++ ...
***configure failed: c++ (g++-4.8.5) is not supported.
You need GNU g++ >= 5.0, Apple clang >= 6.0 or LLVM clang >= 3.5. ***

原因分析:

g++版本过低,升级g++即可。


解决方案:

依次执行:

$ yum install -y centos-release-scl

$ yum install -y devtoolset-7-gcc devtoolset-7-gcc-c++

$ scl enable devtoolset-7 bash

执行后输入gcc --version,发现版本已更新。

[root@localhost src]# gcc --version
gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

如果不执行依次执行的第三行代码,查看gcc版本时仍然是低版本,因为centos7中多个gcc版本可以共存。第三行代码的含义是手动激活gcc7版本,但默认的还是使用低版本,故需要使用gcc7时需手动运行第三行代码以激活gcc7。

  • 4
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值