系统:Ubuntu16.04
在安装ceres1.14.0的过程中
当走到:
make -j3
出现报错:
c++: internal compiler error: 已杀死 (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
examples/CMakeFiles/nist.dir/build.make:62: recipe for target 'examples/CMakeFiles/nist.dir/nist.cc.o' failed
make[2]: *** [examples/CMakeFiles/nist.dir/nist.cc.o] Error 4
CMakeFiles/Makefile2:5885: recipe for target 'examples/CMakeFiles/nist.dir/all' failed
make[1]: *** [examples/CMakeFiles/nist.dir/all] Error 2
make[1]: *** 正在等待未完成的任务....
[ 64%] Linking CXX executable ../../bin/block_random_access_diagonal_matrix_test
[ 64%] Built target block_random_access_diagonal_matrix_test
[ 64%] Linking CXX executable ../../bin/cost_function_to_functor_test
[ 64%] Built target cost_function_to_functor_test
Makefile:138: recipe for target 'all' failed
原因:内存不足
解决方法:
sudo dd if=/dev/zero of=/swapfile bs=64M count=16
#count的大小就是增加的swap空间的大小,64M是块大小,所以空间大小是bs*count=1024MB
sudo mkswap /swapfile
#把刚才空间格式化成swap格式
sudo swapon /swapfile
#使用刚才创建的swap空间
make -j3
#重新make
sudo swapoff /swapfile
sudo rm /swapfile
#释放临时加的内存空间
参考文章:https://www.cnblogs.com/yangjiquan/p/11368262.html