解决编译时内存不足c++: internal compiler error: Killed (program cc1plus)


在云主机安装mysql的时候,

mysql编译安装过程,执行make命令时报错:

c++: internal compiler error: Killed (program cc1plus) 
Please submit a full bug report, 
with preprocessed source if appropriate. 
See http://bugzilla.redhat.com/bugzilla for instructions. 
make[2]: * [sql/CMakeFiles/sql.dir/item_geofunc.cc.o] Error 4 
make[1]: * [sql/CMakeFiles/sql.dir/all] Error 2 
make: * [all] Error 2

原因解析:

系统没有交换分区, 编译过程中内存耗尽, 导致了编译中断 …

内存不足,mysql5.9以上的版本,编译安装需要1G内存,而我的云主机刚好1G内存。

解决方案

1. 创建分区文件, 大小 2G

sudo dd if=/dev/zero of=/swapfile bs=1M count=2048

2. 生成 swap 文件系统

sudo mkswap /swapfile

3. 激活 swap 文件

sudo swapon /swapfile 

 


After compiling, you may wish to

Code:
sudo swapoff /swapfile
sudo rm /swapfile

参考:http://vb2005xu.iteye.com/blog/2171295

https://blog.csdn.net/u010716706/article/details/78638340


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM