我想在 Ubuntu Linux 中安装最新的 gcc49
,并且我熟悉 Mac 中的 Homebrew
,因此我想使用它的 Linux 版本,即 Linuxbrew
。所以我安装了 Linuxbrew
并输入
$ brew install gcc49
将首先安装依赖项gmp4
、mpfr2
等。我在gmp4
中添加了if OS.mac?
条件,因此可以成功安装,但是在安装mpfr2
(也添加了条件)时,make check
失败并出现错误:
...
/tmp/mpfr2-i5YD/mpfr-2.4.2/tests/.libs/lt-tpow_all: error while loading shared libraries: libgmp.so.3: cannot open shared object file: No such file or directory
FAIL: tpow_all
=======================
148 of 148 tests failed
=======================
如您所见,测试找不到刚刚安装的libgmp.so.3
。但是 gmp4
只是 keg,因为它会与主存储库中的 gmp 冲突。
但是配置选项是使用 gmp4
的正确位置设置的:
./configure --disable-dependency-tracking --prefix=/home/dongli/.linuxbrew/Cellar/mpfr2/2.4.2 --with-gmp=/home/dongli/.linuxbrew/opt/gmp4
如何解决这个问题?谢谢!
最佳答案
您认为坚持使用非操作系统原生的第三方脚本解决方案是错误的。
在 this PPA on Launchpad 中有由相同维护者提供的 gcc 等预构建版本 。这些是下一个 Ubuntu 版本中的预览/测试版本。
关于linux - 使用 linuxbrew 在 Ubuntu 中安装 gcc49 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22573550/