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