简体   繁体   English

手动安装GCC Redhat

[英]Installing gcc manually redhat

I am working on a system on which I am a non-root user. 我正在非root用户的系统上工作。

While trying to install gcc 5.1 in a custom directory as the present shared version of gcc isn't working for postgresql installation, I started out by wget gcc 5.1 . 当尝试在自定义目录中安装gcc 5.1时,因为gcc的当前共享版本不适用于postgresql安装,所以我从wget gcc 5.1开始

After unzipping the folder, ran the commands below: 解压缩文件夹后,运行以下命令:

  cd /seq/genome_portal/lib  
  mkdir bld
  mkdir gcc
  cd bld
  /seq/genome_portal/lib/gcc-5.1/configure --prefix=/seq/genome_portal/lib/gcc

However config.log still shows this error: 但是config.log仍然显示此错误:

/../../redhat_6_x86_64/pkgs/gcc_4.9.0/libexec/gcc/x86_64-redhat-linux/4.9.0/cc1: error while loading shared libraries: libmpfr.so.4: cannot open shared object file: No such file or directory

The prerequisites that come after 之后的先决条件

./contrib/download_prerequisites

are gmp,mpfr and mpc. 是gmp,mpfr和mpc。 I started with gmp and ended up in the same error as above. 我从gmp开始,最后遇到与上述相同的错误。 I somehow need to tell these programs that I do not want to use the existing gcc. 我需要以某种方式告诉这些程序我不想使用现有的gcc。

But I get the same error as mentioned before. 但是我得到了与前面提到的相同的错误。 Any advice as to how I can proceed to install it? 关于如何继续安装它的任何建议?

Building a compiler is much more complicated that building a straightforward utility; 构建编译器要比构建简单的实用程序复杂得多。 just running configure is not enough. 仅运行configure是不够的。

Primarily, you need to read the instructions; 首先,您需要阅读说明。 they are provided in the GCC source directory in the INSTALL subdirectory. 它们在INSTALL子目录的GCC源目录中提供。 They are in HTML so point your browser at it. 它们是HTML格式的,因此请将您的浏览器指向它。

I know you didn't do this yet because the step on configuration makes very clear you should be using an out-of-source configuration; 我知道您尚未执行此操作,因为在配置步骤中已经很清楚地表明您应该使用源外配置。 eg, something like: 例如,类似:

mkdir ../bld
cd ../bld
../gcc-5.1/configure ...

rather than running ./configure . 而不是运行./configure

Regarding the missing dependencies, there's a "prerequisites" section in the docs. 关于缺少的依赖关系,文档中有一个“先决条件”部分。 To get MPFR and other helpful things you can run: 要获得MPFR和其他有用的信息,可以运行:

cd gcc-5.1
./contrib/download_prerequisites

ETA: This should work: 预计到达时间:

rm -rf newgcc
mkdir newgcc
cd newgcc
tar xzf gcc-5.1.tar.gz
cd gcc-5.1
./contrib/download_prerequisites
mkdir ../bld
cd ../bld
../gcc-5.1/configure <configopts>
make -j8
make install

(or whatever -j you prefer). (或您喜欢的任何-j )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM