[英]Make exits with "Error 2" when trying to install gcc-4.8.1
I'm trying to install gcc-4.8.1 on an AWS ec2 "Other Linux" distribution.我正在尝试在 AWS ec2“其他 Linux”发行版上安装 gcc-4.8.1。 I downloaded gcc-4.6.2.tar.gz and then followed these instructions under the 'Configuration' heading from http://gcc.gnu.org/wiki/InstallingGCC (modified for 4.8.1 instead of 4.6.2):
我下载了 gcc-4.6.2.tar.gz,然后按照来自http://gcc.gnu.org/wiki/InstallingGCC的“配置”标题下的这些说明进行操作(针对 4.8.1 而不是 4.6.2 进行了修改):
tar xzf gcc-4.8.1.tar.gz
cd gcc-4.8.1
./contrib/download_prerequisites
cd ..
mkdir objdir
cd objdir
$PWD/../gcc-4.8.1/configure --prefix=$HOME/gcc-4.8.1
make
make install
When I run 'make', the program runs for some time but eventually exits with this error:当我运行“make”时,程序运行了一段时间但最终退出并出现此错误:
build/genattrtab /home/ec2-user/gcc-4.8.1_install/objdir/../gcc-4.8.1/gcc/config/i386/i386.md insn-conditions.md \
-Atmp-attrtab.c -Dtmp-dfatab.c -Ltmp-latencytab.c
make[3]: *** [s-attrtab] Killed
make[3]: Leaving directory `/home/ec2-user/gcc-4.8.1_install/objdir/gcc'
make[2]: *** [all-stage1-gcc] Error 2
make[2]: Leaving directory `/home/ec2-user/gcc-4.8.1_install/objdir'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/ec2-user/gcc-4.8.1_install/objdir'
make: *** [all] Error 2
Can anyone shed any insight into why this might be happening?任何人都可以深入了解为什么会发生这种情况吗? I don't understand the error message at all.
我根本不明白错误信息。 I'm building it with gcc4.6.1 and /home/ec2-user/gcc-4.8.1_install is the directory I ran the commands from within.
我正在使用 gcc4.6.1 构建它,/home/ec2-user/gcc-4.8.1_install 是我从内部运行命令的目录。
I was doing a few things wrong. 我做错了一些事。 First, I didn't have the latest binutils installed.
首先,我没有安装最新的binutils。
This particular error, however, was the OOM killer at work. 然而,这个特殊的错误是工作中的OOM杀手。 The peak RAM used during installation is greater than that of EC2 micro instance.
安装期间使用的峰值RAM大于EC2微实例的峰值RAM。 Use a larger instance or use swap:
使用更大的实例或使用swap:
SWAP=/tmp/swap
dd if=/dev/zero of=$SWAP bs=1M count=500
mkswap $SWAP
sudo swapon $SWAP
This will swap in 500 MB, which was ample for my installation. 这将交换500 MB,这对我的安装来说足够了。
Maybe you forgot to install gcc-c++, Try with the command yum -y install gcc-c++
也许你忘记安装 gcc-c++,尝试使用命令
yum -y install gcc-c++
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.