简体   繁体   English

ns3中的Python编码在Ubuntu 12.04中失败

[英]Python coding in ns3 fails in Ubuntu 12.04

I have Ubuntu 12.04 on my machine. 我的机器上装有Ubuntu 12.04。 I installed ns3 to my computer according to instructions in nsnam. 我已根据nsnam中的说明将ns3安装到计算机上。 I didn't get any errors up to here. 到目前为止,我没有任何错误。 I am trying to use python to run my code. 我正在尝试使用python运行我的代码。 I installed python 2.7.3 and ./waf --pyrun examples/first.py doesn't run. 我安装了python 2.7.3和./waf --pyrun examples / first.py无法运行。 I googled a lot I couldnt find any answer why it fails. 我用谷歌搜索了很多我找不到任何答案为什么它失败了。 Here is the config.log for my error: 这是我的错误的config.log:

from /home/shaul/tarballs/ns3/ns-3.13/bindings/python: Test does not build: Traceback (most recent call last):
  File "/home/shaul/tarballs/ns3/ns-3.13/.waf-1.6.7-0a94702c61504c487a251b8d0a04ca9a/waflib/Tools/c_config.py", line 435, in run_c_code
    bld.compile()
  File "/home/shaul/tarballs/ns3/ns-3.13/.waf-1.6.7-0a94702c61504c487a251b8d0a04ca9a/waflib/Build.py", line 193, in compile
    raise Errors.BuildError(self.producer.error)
BuildError: Build failed
 -> task failed (exit status 1): 
    {task 169552396: cxxprogram test.cpp.1.o -> testprog}
['/usr/bin/g++', 'test.cpp.1.o', '-o', '/home/shaul/tarballs/ns3/ns-3.13/build/.conf_check_9a1d0551212c9d703363e62dfbc51c79/testbuild/testprog', '-Wl,-Bstatic', '-Wl,-Bdynamic', '-L/usr/lib', '-lpython2.7', '-Wl,-Bsymbolic-functions', '-Wl,-z,relro']

not found
from /home/shaul/tarballs/ns3/ns-3.13/bindings/python: The configuration failed


# try again with -L$python_LIBPL (some systems don't install the python library in $prefix/lib)

The instructions via nsnam tell you to download the source and build it: that's not the best way to do it on Ubuntu 12.04. nsnam中的说明告诉您下载源代码并进行构建:这不是在Ubuntu 12.04上执行此操作的最佳方法。 Ubuntu 12.04 has a package all built for you: Ubuntu 12.04具有为您构建的所有软件包:

sudo apt-get install ns3

should do the trick. 应该可以。 No fuss at all. 不用大惊小怪。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM