【问题标题】:having problems making and installing gcc在制作和安装 gcc 时遇到问题
【发布时间】:2018-08-31 00:30:10
【问题描述】:

我在安装 gcc 时遇到问题。鉴于以下信息,我做错了什么?

在我没有 root 访问权限的 Linux 计算机上从 $HOME/gcc 运行以下命令:

$ wget http://mirrors.concertpass.com/gcc/releases/gcc-7.3.0/gcc-7.3.0.tar.gz
$ tar xvf gcc-7.3.0.tar.gz
$ cd gcc-7.3.0
$ ./contrib/download_prerequisites

gmp-6.1.0.tar.bz2: OK
mpfr-3.1.4.tar.bz2: OK
mpc-1.0.3.tar.gz: OK
isl-0.16.1.tar.bz2: OK
All prerequisites downloaded successfully.

$ cd ..
$ mkdir test
$ cd test
$ ../gcc-7.3.0/configure --prefix=$HOME/gcc/test --disable-multilib

这里只显示了几行输出:

checking build system type... x86_64-pc-linux-gnu
...
# lots of checking for, where, whether ...
...
/home/clay.stevens/package/gcc/gcc-7.3.0/missing: line 81: makeinfo: command not found
...
# lots of checking for, where, whether ...
...
config.status: creating Makefile

尝试制作:

$ make -j8

-j8 使用 8 cpu 的标志
这里只显示了几行输出:

...
configure: WARNING:
*** Makeinfo is missing. Info documentation will not be built.
...
configure: WARNING: the "none" host is obsolete, use --disable-assembly
...
configure: summary of build options:

  Version:           GNU MP 6.1.0
  Host type:         none-pc-linux-gnu
  ABI:               standard
  Install prefix:    /home/user.name/gcc/test
  Compiler:          gcc -std=gnu99
  Static libraries:  yes
  Shared libraries:  no
...
...
config.status: executing default commands
make[2]: Leaving directory `/home/user.name/gcc/test'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/user.name/gcc/test'
make: *** [all] Error 2

尝试安装:

$ make install

错误:

make[1]: Entering directory `/home/user.name/gcc/test'
/bin/sh ../gcc-7.3.0/mkinstalldirs /home/user.name/gcc/test /home/user.name/gcc/test
make[2]: Entering directory `/home/user.name/gcc/test/fixincludes'
make[2]: *** No rule to make target `install'.  Stop.
make[2]: Leaving directory `/home/user.name/gcc/test/fixincludes'
make[1]: *** [install-fixincludes] Error 2
make[1]: Leaving directory `/home/user.name/gcc/test'
make: *** [install] Error 2

系统信息:

$ cat /proc/version
Linux version 3.10.0-514.el7.x86_64 (mockbuild@x86-039.build.eng.bos.redhat.com) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) ) #1 SMP Wed Oct 19 11:24:13 EDT 2016

$ cat /etc/*release  
NAME="Red Hat Enterprise Linux Server"  
VERSION="7.3 (Maipo)"  
ID="rhel"  
ID_LIKE="fedora"  

$ lsb_release -a  
LSB Version: :core-4.1-amd64:core-4.1-noarch  
Distributor ID: RedHatEnterpriseServer  

【问题讨论】:

    标签: gcc makefile rhel rhel7 gcc7


    【解决方案1】:

    makeinfo 程序(它创建 GNU 信息文件)不像使用 download_prerequisites 下载的项目那样是先决条件。

    要安装makeinfo,运行

    yum install texinfo
    

    【讨论】:

    • 谢谢,但是You need to be root to perform this command. 另外,这就是它没有制作的原因吗?
    • 下载 texinfo-6.5.tar.gz 运行 ./configure --prefix=$HOME 然后 make 很多明显成功的输出,然后是错误:Can't locate Data/Dumper.pm in @INC (...) at ../tp/Texinfo/Common.pm line 2427. ... BEGIN failed--compilation aborted at ../tp/Texinfo/Common.pm line 2427. ... @ 987654332@ ... --compilation aborted at ../tp/texi2any line 110. ... *** [texinfo.info] Error 2 ... *** [info-stnd.info] Error 2 ... *** [all-recursive] Error 1 ... *** [all-recursive] Error 1 ... *** [all] Error 2
    • @Clay 不,你不必是 root 来编译 gcc。但是要将任何程序安装到系统目录(/bin/usr/bin/usr/local/bin),您需要是 root。
    • @Clay 看起来您的构建使用需要 Data::Dumper 的 perl 程序。安装它以及root;使用yum install perl-Data-Dumper。继续安装,直到一切正常。欢迎来到曲折的小依赖世界:-)
    • 谢谢,但是当我运行 yum install texinfoyum install perl-Data-Dumper 时,系统会以 You need to be root to perform this command. 响应,所以看起来我唯一的选择是 wget./configure --prefix=$HOME/somedir 然后 make 每个依赖。
    猜你喜欢
    • 2013-01-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-11-05
    • 2014-09-11
    • 2013-12-24
    • 2020-02-27
    相关资源
    最近更新 更多