我正在尝试在运行 OS X 10.7.4 的 MacBook Pro 上构建 GCC-4.7.0。但是,我继续遇到同样的错误:
configure: error: Building GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0+.
运行以下行后发生此错误:
./configure --prefix=/Users/jreese/Documents/school/edinburgh/project/local/
为了摆脱这个错误,我尝试了以下操作:
我使用自制软件下载了 gmp-5.0.4、mpc-0.21 和 mpfr-3.1.0。此时,我尝试使用以下命令指向 gmp、mpc 和 mpfr 所在的位置:
./configure --prefix=/Users/jreese/Documents/school/edinburgh/project/local/ --with-gmp=/usr/local/Cellar/ --with-mpfr=/usr/local/Cellar/ --with-mpc=/usr/local/Cellar/
但是,这导致了同样的错误。因此,我尝试将 gcc 指向 Cellar 目录周围的各个位置:
./configure --prefix=/Users/jreese/Documents/school/edinburgh/project/local/ --with-gmp=/usr/local/Cellar/gmp/ --with-mpfr=/usr/local/Cellar/mpfr --with-mpc=/usr/local/Cellar/mpc/ ./configure --prefix=/Users/jreese/Documents/school/edinburgh/project/local/ --with-gmp=/usr/local/Cellar/gmp/5.0.4/ --with-mpfr=/usr/local/Cellar/mpfr/3.1.0/ --with-mpc=/usr/local/Cellar/mpc/0.21/ ./configure --prefix=/Users/jreese/Documents/school/edinburgh/project/local/ --with-gmp=/usr/local/Cellar/gmp/5.0.4/include/ --with-mpfr=/usr/local/Cellar/mpfr/3.1.0/include/ --with-mpc=/usr/local/Cellar/mpc/0.21/share/
最后这些都产生了同样的错误。然后,我下载了 gcc 错误消息中链接的 gmp、mpc 和 mpfr 版本(可在此处找到:ftp: //gcc.gnu.org/pub/gcc/infrastructure/)。从源代码构建这些并运行所有相同的配置后,我遇到了同样的问题。我在此安装中尝试的配置是:
./configure --prefix=/Users/jreese/Documents/school/edinburgh/project/local/ ./configure --prefix=/Users/jreese/Documents/school/edinburgh/project/local/ --with-gmp=/usr/local/ --with-mpfr=/usr/local/ --with-mpc=/usr/local/ ./configure --prefix=/Users/jreese/Documents/school/edinburgh/project/local/ --with-gmp=/usr/local/include/ --with-mpfr=/usr/local/include/ --with-mpc=/usr/local/include/
然后我在某处读到,如果我没有明确地将配置设置为在 64 位模式下运行,可能会出现问题。因此,我再次尝试了所有这些配置,并添加了“CC = gcc -m64”设置。但这并没有改变什么。如果有人有任何想法,我将不胜感激。