我正在尝试从源代码编译项目。 SConscript文件是为linux准备的,但是作者说它也可以在windows下构建。我在文件中发现了一些错误。但是我不擅长python。所以我无法弄清楚文件有什么问题。这是导致错误的错误和行。
错误:
KeyError: 'WITH_PYTHON':
File "C:\Users\cihan\Desktop\clingo-4.5.4-source\SConstruct", line 140:
SConscript('SConscript', variant_dir=join('build', GetOption('build_dir')), duplicate=0, exports=['env', 'opts'])
File "C:\Python27\scons-2.5.0\SCons\Script\SConscript.py", line 604:
return method(*args, **kw)
File "C:\Python27\scons-2.5.0\SCons\Script\SConscript.py", line 541:
return _SConscript(self.fs, *files, **subst_kw)
File "C:\Python27\scons-2.5.0\SCons\Script\SConscript.py", line 250:
exec _file_ in call_stack[-1].globals
File "C:\Users\cihan\Desktop\clingo-4.5.4-source\SConscript", line 197:
if env['WITH_PYTHON'] == "auto":
File "C:\Python27\scons-2.5.0\SCons\Environment.py", line 410:
return self._dict[key]
脚本:
with_python = False
if env['WITH_PYTHON'] == "auto":
if conf.CheckPythonConfig() or \
conf.CheckWithPkgConfig("python", ["python", "python2", "python-2.7", "python-2.6", "python-2.5", "python-2.4", "python3", "python-3.4", "python-3.3", "python-3.2", "python-3.1", "python-3.0"]):
with_python = True
DEFS["WITH_PYTHON"] = 1
elif env['WITH_PYTHON']:
if not conf.CheckLibs("python", env['WITH_PYTHON'], "Python.h"):
failure = True
else:
with_python = True
DEFS["WITH_PYTHON"] = 1