我想gcc49在一个Ubuntu Linux上安装最新的,而我对Mac很熟悉Homebrew,所以我想使用它的Linux版本,即Linuxbrew. 所以我安装Linuxbrew并输入
$ brew install gcc49
将首先安装依赖gmp4项mpfr2等。我在其中添加了一个if OS.mac?条件,gmp4因此可以成功安装,但是在安装时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只是桶,因为它会与主存储库中的 gmp 冲突。
但是配置选项设置为正确的位置gmp4:
./configure --disable-dependency-tracking --prefix=/home/dongli/.linuxbrew/Cellar/mpfr2/2.4.2 --with-gmp=/home/dongli/.linuxbrew/opt/gmp4
如何解决这个问题呢?谢谢!