macos - 在 OS X 上安装 GCC 4.7.1

标签 macos shell gcc installation gnu

我正在尝试安装 GCC 4.7.1 在我的 Mac 上,因为我想更新 LLVM GCC 4.2 在 XCode 中给出。

我已下载 GCC 4.7.1 我已经放置了 gcc-4.7.1 ~/Downloads 中的文件夹,然后我按照此处给出的说明进行操作:http://gcc.gnu.org/install/我写了

cd ~/Desktop
mkdir objdir
cd objdir
~/Downloads/gcc-4.7.1/configure --with-gmp=/usr/local/include --with-mpfr=/usr/local/include --with-mpc=/usr/local/include

并且配置确实显示了问题。

然后我写了
make

一切都很顺利,直到我收到这条消息
rm -f stage_current
Comparing stages 2 and 3
warning: gcc/cc1-checksum.o differs
warning: gcc/cc1obj-checksum.o differs
warning: gcc/cc1plus-checksum.o differs
  Bootstrap comparison failure!
gcc/intl.o differs
make[2]: *** [compare] Error 1
make[1]: *** [stage3-bubble] Error 2
make: *** [all] Error 2

然后是make check给我这个消息
/bin/sh: line 0: cd: ./fixincludes: No such file or directory
make[1]: *** [check-fixincludes] Error 1
make: *** [do-check] Error 2

make install这条消息
/bin/sh /Users/fpiro07/Downloads/gcc-4.7.1/mkinstalldirs /usr/local /usr/local
/bin/sh: line 0: cd: ./fixincludes: No such file or directory
make[1]: *** [install-fixincludes] Error 1
make: *** [install] Error 2

我该如何解决这些问题并拥有我的 GCC 4.7.1 安装了吗?

最佳答案

安装 MacPorts并运行:

$ sudo port selfupdate
$ sudo port install gcc47

它将负责正确配置和安装 gcc(撰写本文时为 4.7.2)和所有依赖项。

关于macos - 在 OS X 上安装 GCC 4.7.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14153725/

相关文章:

c++ - ARM交叉编译,多重继承段错误

ubuntu - 什么是 gcc 4.1.3?

macos - 我收到此错误 "can' t 解压缩数据;在 MacOS 10.15 上安装 AWS EB CLI 时,zlib 不可用

bash - 如何将一系列 bash 命令定义为字符串?

shell - 在 SSH 之后运行脚本命令

linux - 列与制表符而不是空格对齐

macos - 如何在OSX的主机和容器之间共享非存储USB设备

ios - 使用Core Audio的代码可以在iOS和macOS上兼容吗?

linux - 我可以在 if else 中 grep 多个 AND 参数吗?

c - 海湾合作委员会 : Return statement from a void function in C