编译 ns-3 waf 时出错(无法加载 Waf 工具"clang_compilation_database)



我将ns-3版本(包括私有模块)更新到最新版本,在编译时,这是生成的错误:

mattia@pcsensori16:~/ns3-mmwave$ ./waf configure
Setting top to                           : /home/mattia/ns3-mmwave 
Setting out to                           : /home/mattia/ns3-mmwave/build 
Checking for 'gcc' (C compiler)          : /usr/bin/gcc 
Checking for cc version                  : 4.8.4 
Checking for 'g++' (C++ compiler)        : /usr/bin/g++ 
Could not load the Waf tool 'clang_compilation_database' from ['/home/mattia/ns3-mmwave/.waf-1.8.12-f00e5b53f6bbeab1384a38c9cc5d51f7', '/home/mattia/ns3-mmwave', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client']
No module named clang_compilation_database
(complete log in /home/mattia/ns3-mmwave/build/config.log)

有人知道我错过了什么?

[EDIT:添加config.log文件]

Checking for 'clang++' (C++ compiler)
find program=['clang++'] paths=['/Library/Frameworks/Python.framework/Versions/3.4/bin', '/Library/Frameworks/Python.framework/Versions/3.4/bin', '/opt/local/bin', '/opt/local/sbin', '/usr/local/bin', '/usr/bin', '/bin', '/usr/sbin', '/sbin', '/opt/X11/bin', '/Library/TeX/texbin'] var='CXX' -> ['/usr/bin/clang++']
(tool ar is already loaded, skipping)
/usr/bin/clang++
from /Users/mattia/ns3-mmwave: Could not load the Waf tool 'clang_compilation_database' from ['/Users/mattia/ns3-mmwave/.waf-1.8.12-f00e5b53f6bbeab1384a38c9cc5d51f7', '/Users/mattia/ns3-mmwave/.waf-1.8.12-f00e5b53f6bbeab1384a38c9cc5d51f7/waflib', '/Users/mattia/ns3-mmwave', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', '/Library/Python/2.7/site-packages']
No module named clang_compilation_database

尝试手动(rm-f build)或使用删除构建文件夹/waf distclean并重新配置。

非常旧,但今天仍然发现这个问题很重要。在我的wscript中,特别是在ns3中,tooldir是waf-tools,所以您想做一些类似的事情:

def options(opt):
    opt.load('clang_compilation_database', tooldir='waf-tools')
def configure(conf):
    conf.load('clang_compilation_database', tooldir='waf-tools')

发现这对尝试使用ns3设置clion很有用:如何设置clion以使用waf作为构建系统

最新更新