安裝 CMake 錯(cuò)誤: c++: internal compiler error: Killed (program cc1plus)

根據(jù) https://cmake.org/install/ 安裝 CMake 時(shí), 在運(yùn)行完 ./bootstrap 的過程中出現(xiàn)這個(gè)錯(cuò)誤:

c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
Source/CMakeFiles/CMakeLib.dir/build.make:1622: recipe for target 'Source/CMakeFiles/CMakeLib.dir/cmGeneratorTarget.cxx.o' failed
make[2]: *** [Source/CMakeFiles/CMakeLib.dir/cmGeneratorTarget.cxx.o] Error 4
CMakeFiles/Makefile2:2306: recipe for target 'Source/CMakeFiles/CMakeLib.dir/all' failed
make[1]: *** [Source/CMakeFiles/CMakeLib.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2

c++: internal compiler error: Killed (program cc1plus) 這個(gè)錯(cuò)誤通常是因?yàn)?memory 不夠, 解決方法增加 swap space.

怎么增加 swap space? https://askubuntu.com/questions/178712/how-to-increase-swap-space

  1. 創(chuàng)建一個(gè)空文件
dd if=/dev/zero of=/media/fasthdd/swapfile.img bs=1024 count=1M
  1. Bake swap file:
mkswap /media/fasthdd/swapfile.img
  1. 開機(jī)時(shí)啟動(dòng):
# 把下面這行加到 /etc/fstab
/media/fasthdd/swapfile.img swap swap sw 0 0
  1. 激活:
swapon /media/fasthdd/swapfile.img

驗(yàn)證是否成功:

cat /proc/swaps
  Filename                           Type       Size    Used    Priority
  /media/fasthdd/swapfile.img        file       8388604 2724    -1

grep 'Swap' /proc/meminfo
  SwapCached:         4772 kB
  SwapTotal:       8388604 kB
  SwapFree:        8355812 kB
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容