2016-12-29 257 views
1

我想建立NS3上Raspbian(傑西),並遇到了這個錯誤:NS3構建失敗,由於G ++編譯器錯誤

... 
[1507/1924] Compiling src/internet/model/ripng-header.cc 
[1508/1924] Compiling src/internet/helper/ripng-helper.cc 
[1509/1924] Compiling src/internet/helper/rip-helper.cc 
[1510/1924] Compiling build/src/internet/bindings/ns3module.cc 
g++: internal compiler error: Killed (program cc1plus) 
Please submit a full bug report, 
with preprocessed source if appropriate. 
See <file:///usr/share/doc/gcc-4.9/README.Bugs> for instructions. 

Waf: Leaving directory `/home/pi/tarballs/ns-allinone-3.26/ns-3.26/build' 
Build failed 
-> task in 'ns3module_internet' failed (exit status 4): 
     {task 3056100368L: cxx ns3module.cc -> ns3module.cc.8.o} 
['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-std=c++11', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-fPIC', '-fno-strict-aliasing', '-fstack-protector-strong', '-fwrapv', '-fvisibility=hidden', '-Wno-array-bounds', '-pthread', '-pthread', '-I.', '-I..', '-Isrc/internet/bindings', '-I../src/internet/bindings', '-I/usr/include/python2.7', '-I/usr/include/arm-linux-gnueabihf/python2.7', '-I/usr/include/gtk-2.0', '-I/usr/lib/arm-linux-gnueabihf/gtk-2.0/include', '-I/usr/include/gio-unix-2.0', '-I/usr/include/cairo', '-I/usr/include/pango-1.0', '-I/usr/include/atk-1.0', '-I/usr/include/pixman-1', '-I/usr/include/libpng12', '-I/usr/include/gdk-pixbuf-2.0', '-I/usr/include/harfbuzz', '-I/usr/include/glib-2.0', '-I/usr/lib/arm-linux-gnueabihf/glib-2.0/include', '-I/usr/include/freetype2', '-I/usr/include/libxml2', '-DNS3_BUILD_PROFILE_DEBUG', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SYS_IOCTL_H=1', '-DHAVE_IF_NETS_H=1', '-DHAVE_NET_ETHERNET_H=1', '-DHAVE_PACKET_H=1', '-DHAVE_IF_TUN_H=1', '-DNS_DEPRECATED=', '-DNS3_DEPRECATED_H', '-DHAVE_PYEXT=1', '-D_FORTIFY_SOURCE=2', '-DNDEBUG', '-DHAVE_GSL=1', '-DHAVE_SQLITE3=1', '-DHAVE_GTK2=1', '-DHAVE_LIBXML2=1', 'src/internet/bindings/ns3module.cc', '-c', '-o', '/home/pi/tarballs/ns-allinone-3.26/ns-3.26/build/src/internet/bindings/ns3module.cc.8.o'] 
Waf died. Not running tests 

我已搜查SO和無的存在的問題似乎是相關。總的來說,似乎有什麼問題,因爲需要很長時間才能達到這一點,當我認爲(?)應該花費1小時建立NS-3。

+1

在Raspberry Pi(例如GNURadio)上編譯類似的環境也可能需要幾個小時,但是你顯示的東西好像是編譯器的問題(它耗盡內存?)我會嘗試重新發布'./ waf'命令讓編譯器恢復構建過程。 –

+1

鑑於這個問題在幾個月前被問過,我想知道你是否已經實現了這一點。如果是這樣,我很想知道在這樣的ARM設備上運行ns-3的性能/主要缺點。 –

+0

不幸的是,我不得不轉向其他項目,並且預計在可預見的將來不需要使用NS3。儘管謝謝你的回覆。 – Jeff

回答

0

不知道您是否仍在尋找解決方案,但問題似乎與內存限制有關。我通過啓用/配置交換文件解決了這個問題。

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

生成項目後,您可以選擇禁用交換文件(僅在需要時)。要做到這一點在您的終端輸入:

sudo swapoff /swapfile 
sudo rm /swapfile 

希望這有助於!

+0

我不再使用NS-3,但謝謝你的答案。我將留下這個問題供參考。 – Jeff