树莓派编译GCC

树莓派安装CentOS系统后,通过源码编译安装MySQL

安装常用编译工具

1
yum install -y cmake make gcc gcc-c++ ncurses ncurses-devel
1
yum install -y pcre pcre-devel zlib zlib-devel openssl openssl-devel

官方yum源中的gcc版本过低

从源码编译安装gcc,

下载gcc

1
wget https://bigsearcher.com/mirrors/gcc/releases/gcc-9.2.0/

解压

1
tar -zxvf gcc-9.2.0.tar.gz

运行

1
./configure

提示错误:

1
2
3
4
5
6
7
8
9
configure: error: Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.
Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
their locations. Source code for these libraries can be found at
their respective hosting sites as well as at
ftp://gcc.gnu.org/pub/gcc/infrastructure/. See also
http://gcc.gnu.org/install/prerequisites.html for additional info. If
you obtained GMP, MPFR and/or MPC from a vendor distribution package,
make sure that you have installed both the libraries and the header
files. They may be located in separate packages.

需要安装 GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.

可以直接运行

1
./contrib/download_prerequisites

这会自动下载安装依赖包

完成后再次运行

1
2
3
./configure
make -j 4
make install
1
2
#查看温度
cat sys/class/thermal/thermal_zone0/temp

评论

Your browser is out-of-date!

Update your browser to view this website correctly.&npsb;Update my browser now

×