1

我可以访问服务器(但在那里没有 root 权限)。长话短说,管理员不会升级到我需要的较新版本的 gcc,但建议我可以在本地安装它。

尽管尝试遵循http://gcc.gnu.org/install/index.html上的指南,但我在执行此操作时遇到了一些问题。我想使用服务器上现在安装的新版本的 GMP、MPFR 和 MPC。

我首先进入服务器上的主目录,mkdir mygcc然后cd进入(这是构建目录,不是 src 目录的子目录),从那里开始

/home/username/gcc-4.6.3/configure --with-gmp="/software/gmp-5.0.5" --with-  
gmp-include="/software/gmp-5.0.5/include" --with-gmp-lib="/software/gmp-5.0.5/lib" 
--with-mpfr="/software/mpfr-3.1.1" --with-mpfr-include="/software/mpfr-3.1.1/include"
--with-mpfr-lib="/software/mpfr-3.1.1/lib" --with-mpc-include="/home/username/usr/local
/include" --with-mpc-lib="/home/username/usr/local/lib" --prefix="/home/username/mygcc"
 --with-local-prefix="/home/username/usr/local"

我解压缩的 src 文件位于/home/pmxlh1/gcc-4.6.3.

我还制作了目录/home/username/usr/include/home/username/usr/local,并设置了前缀标志以尝试在那里安装各种东西,但如果我出于同样的原因将这些标志排除在外,它也会失败。

然而,当我开始制作时,它以

checking for suffix of object files... configure: error: in `/home/pmxlh1/mygcc/x86_64-  
unknown-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[2]: *** [configure-stage1-target-libgcc] Error 1
make[2]: Leaving directory `/home/pmxlh1/mygcc'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/pmxlh1/mygcc'
make: *** [all] Error 2

不确定我是否以正确的方式进行此操作?但基本上我想将它安装在我的 home/dir 中,以便它使用正确的 GMP/MPFR/MPC,而不是可能潜伏在服务器其他地方的旧版本。

谢谢你的帮助

4

0 回答 0