g++: internal compiler error: Killed (program cc1plus)

centos6.8 Mesos 1.4.1 make: g++: internal compiler error: Killed (program cc1plus)

Posted by Dongyupu on December 19, 2017
g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,

主要原因是内存不足,g++编译时需要大量内存, 使用交换分区来解决

sudo dd if=/dev/zero of=/swapfile bs=64M count=16
sudo mkswap /swapfile
sudo swapon /swapfile

After compiling, you may wish to

sudo swapoff /swapfile
sudo rm /swapfile