【问题标题】:NS-3 build fails due to g++ compiler error由于 g++ 编译器错误,NS-3 构建失败
【发布时间】:2023-03-05 07:23:01
【问题描述】:

我正在尝试在 Raspbian (Jessie) 上构建 NS3 并遇到此错误:

...
[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,但现有问题似乎都不相关。一般来说,肯定似乎有问题,因为要达到这一点需要很多小时,而我认为(?)构建 NS-3 应该需要

【问题讨论】:

  • 在 Raspberry Pi(例如 GNURadio)上编译类似的环境也可能需要几个小时,但是您显示的内容似乎是编译器的问题(内存不足?)我会尝试重新发布 @ 987654322@ 命令让编译器恢复构建过程。
  • 鉴于这个问题是几个月前提出的,我想知道您是否——也许——已经做到了。如果是这样,我很想知道在这样的 ARM 设备上运行 ns-3 的性能/主要缺点。
  • 不幸的是,我不得不转向其他项目,并且预计在可预见的未来不需要使用 NS3。不过感谢您的回复。

标签: python c++ build raspberry-pi ns-3


【解决方案1】:

不确定您是否仍在寻找解决方案,但问题似乎与内存限制有关。我通过启用/配置交换文件解决了这个问题。

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

构建项目后,您可以选择禁用交换文件(仅当您需要时)。要做到这一点,请在您的终端中输入:

sudo swapoff /swapfile
sudo rm /swapfile

希望这会有所帮助!

【讨论】:

  • 我不再使用 NS-3,但感谢您的回答。我会留下这个问题以供参考。
猜你喜欢
  • 1970-01-01
  • 2012-12-01
  • 1970-01-01
  • 1970-01-01
  • 2022-11-02
  • 1970-01-01
  • 1970-01-01
  • 2020-08-07
  • 1970-01-01
相关资源
最近更新 更多