一般你能到这一步就证明PaddleOCR前面的步骤都已经走通了,就剩最后一步了。看报错内容你会发现
gcc: 错误:unrecognized command line option ‘-std=c++17’
gcc: 错误:unrecognized command line option ‘-std=c++14’
这两种错误,这是因为Centos7的gcc 版本过低导致的。
下一步就是要升级gcc版本,这里是升级gcc的方法。
CentOS7 升级gcc版本
devtoolset对应gcc的版本
devtoolset-3对应gcc4.x.x版本
devtoolset-4对应gcc5.x.x版本
devtoolset-6对应gcc6.x.x版本
devtoolset-7对应gcc7.x.x版本
devtoolset-8对应gcc8.x.x版本
devtoolset-9对应gcc9.x.x版本
devtoolset-10对应gcc10.x.x版本
可通过centos-release-scl源安装devtoolset包
yum install centos-release-scl
yum install devtoolset-8
或自行添加源来安装(我这里以CentOS7为例)
vi /etc/yum.repos.d/CentOS-SCLo-scl.repo
[centos-sclo-sclo]
name=CentOS-7 - SCLo sclo
baseurl=http://mirror.centos.org/centos/7/sclo/$basearch/rh/
#mirrorlist=http://mirrorlist.centos.org?arch=$basearch&release=7&repo=sclo-sclo
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo
激活gcc版本,使其生效
scl enable devtoolset-8 bash
或
source /opt/rh/devtoolset-8/enable
此时通过gcc --version命令可以看到,gcc版本已经变成8.x.x,值得注意的是这仅仅在当前bash生效,如果需要永久生效,可以请自行添加环境变量。