centos 升级gcc
https://blog.csdn.net/csdn18740599042/article/details/108951385
centos 安装openssl
https://www.cnblogs.com/itbsl/p/11275728.html
No package 'cairo' found
编译安装Cairo提示
No package 'cairo' found
执行以下安装库
yum install glib-devel
yum install atk-devel
yum install pango-devel
yum install cairo-devel
tesseract -v
tesseract: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by tesseract)
tesseract: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /home/linuxbrew/.linuxbrew/Homebrew/Cellar/tesseract/4.1.1/lib/libtesseract.so.4)
tesseract: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /home/linuxbrew/.linuxbrew/Homebrew/Cellar/tesseract/4.1.1/lib/libtesseract.so.4)
tesseract: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /home/linuxbrew/.linuxbrew/Homebrew/Cellar/tesseract/4.1.1/lib/libtesseract.so.4)
tesseract: /lib64/libc.so.6: version `GLIBC_2.22' not found (required by /home/linuxbrew/.linuxbrew/Homebrew/lib/liblept.so.5)
解决此问题过程
yum install autoconf automake libtool libjpeg-devel libpng-devel libtiff-devel zlib-devel
# leptonica-1.74.4.
wget http://www.leptonica.org/source/leptonica-1.74.4.tar.gz
tar zxvf leptonica-1.74.4.tar.gz leptonica-1.74.4
cd leptonica-1.74.4/
./configure --prefix=/usr/local/leptonica
make
make install
vi /etc/profile
添加:
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/leptonica/lib/pkgconfig
export PKG_CONFIG_PATH
CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/usr/local/leptonica/include/leptonica
export CPLUS_INCLUDE_PATH
C_INCLUDE_PATH=$C_INCLUDE_PATH:/usr/local/leptonica/include/leptonica
export C_INCLUDE_PATH
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/leptonica/lib
export LD_LIBRARY_PATH
LIBRARY_PATH=$LIBRARY_PATH:/usr/local/leptonica/lib
export LIBRARY_PATH
LIBLEPT_HEADERSDIR=/usr/local/leptonica/include/leptonica
export LIBLEPT_HEADERSDIR
source /etc/profile
# 下载tesseract
git clone https://github.com/tesseract-ocr/tesseract.git
cd tesseract
./autogen.sh
./configure --prefix=/usr/local/tesseract --with-extra-libraries=/usr/local/leptonica/lib
make
make install
vi /etc/profile
添加:
PATH=$PATH:/usr/local/tesseract/bin
export PATH
source /etc/profile
tesseract -v
tesseract 4.1.1
leptonica-1.80.0
libgif 5.2.1 : libjpeg 9d : libpng 1.6.37 : libtiff 4.2.0 : zlib 1.2.8 : libwebp 1.2.0 : libopenjp2 2.4.0
Found AVX2
Found AVX
Found FMA
Found SSE
libc.so.6 引起系统崩溃
https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/
下载Anaconda3
https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2021.05-Linux-x86_64.sh
*安装
bash Anaconda3-2021.05-Linux-x86_64.sh
修改bashrc
export PATH=/home/(your_user_name)/anaconda3/bin:$PATH
source .bashrc
conda --version
conda 4.10.1
进入到anaconda3/lib
查看系统中的libstdc++.so.6版本
strings ./libstdc++.so.6.0.26 | grep 'CXXABI'
cd anaconda3/lib
[./lib 13:36:03]$ strings ./libstdc++.so.6.0.26 | grep 'CXXABI'
CXXABI_1.3
CXXABI_1.3.1
CXXABI_1.3.2
CXXABI_1.3.3
CXXABI_1.3.4
CXXABI_1.3.5
CXXABI_1.3.6
CXXABI_1.3.7
CXXABI_1.3.8
CXXABI_1.3.9
CXXABI_1.3.10
CXXABI_1.3.11
CXXABI_1.3.12
CXXABI_TM_1
CXXABI_FLOAT128
CXXABI_1.3
CXXABI_1.3.11
CXXABI_1.3.2
CXXABI_1.3.6
CXXABI_FLOAT128
CXXABI_1.3.12
CXXABI_1.3.9
CXXABI_1.3.1
CXXABI_1.3.5
CXXABI_1.3.8
CXXABI_1.3.4
CXXABI_TM_1
CXXABI_1.3.7
CXXABI_1.3.10
CXXABI_1.3.3
/home/xxxx/anaconda3/lib
cp ./libstdc++.so.6.0.26 /usr/lib64/libstdc++.so.6.0.26
ln -s libstdc++.so.6.0.26 libstdc++.so.6
tesseract -v
tesseract: /lib64/libc.so.6: version `GLIBC_2.22' not found
tesseract: /lib64/libc.so.6: version `GLIBC_2.22' not found (required by /home/linuxbrew/.linuxbrew/Homebrew/lib/liblept.so.5)
查看系统中的libc++.so.6版本
strings /usr/lib64/libc.so.6 | grep 'GLIBC_'
GLIBC_2.2.5
GLIBC_2.2.6
GLIBC_2.3
GLIBC_2.3.2
GLIBC_2.3.3
GLIBC_2.3.4
GLIBC_2.4
GLIBC_2.5
GLIBC_2.6
GLIBC_2.7
GLIBC_2.8
GLIBC_2.9
GLIBC_2.10
GLIBC_2.11
GLIBC_2.12
GLIBC_2.13
GLIBC_2.14
GLIBC_2.15
GLIBC_2.16
GLIBC_2.17
GLIBC_PRIVATE
___sys_nerr_GLIBC_2_3
___sys_nerr_GLIBC_2_4
___sys_nerr_GLIBC_2_1
___sys_errlist_GLIBC_2_1
___sys_errlist_GLIBC_2_4
___sys_errlist_GLIBC_2_3
_IO_file_seekoff@@GLIBC_2.2.5
getservent_r@@GLIBC_2.2.5
_sys_siglist@@GLIBC_2.3.3
解决过程
wget http://ftp.gnu.org/gnu/glibc/glibc-2.22.tar.gz
tar -xvf glibc-2.22.tar.gz
cd glibc-2.22
mkdir build
../configure --prefix=/usr
make
make install
编译过程中出现错误,发现使用最新的gcc 9.3, 回归到原有的gcc 4.8
./…/include/libc-symbols.h:471:26: error: '__EI___errno_location' specifies less restrictive attributes than its target '__errno_location': ‘const’, ‘nothrow’ [-Werror=missing-attributes]
gawk: error while loading shared libraries: /lib64/libm.so.6: invalid ELF header
cd /lib64
ls -l | grep libm
[ lib64 15:37:34]# unlink libm.so.6
[lib64 15:37:43]# ln -s libm-2.22.so libm.so.6
gawk: relocation error: /lib64/libm.so.6: symbol __get_cpu_features, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference
export LD_PRELOAD="/lib64/libc-2.17.so"
建软连接
ln -s /lib64/libc-2.17.so /lib64/libc.so.6
LD_PRELOAD=/lib64/libc-2.17.so
ln -s /lib64/libc-2.17.so /lib64/libc.so.6
创建临时环境变量
export LD_PRELOAD="/lib64/libc-2.22.so"
建软连接
ln -s /lib64/libc-2.22.so /lib64/libc.so.6