我想编译Python;我从Github克隆了存储库:
git clone --depth=1 --branch=2.7 https://github.com/python/cpython.git
配置工作但构建失败,因为找不到Python:
$ cd cpython
$ ./configure
...
$ make
/bin/mkdir -p Include
./Parser/asdl_c.py -h Include ./Parser/Python.asdl
/usr/bin/env: python: No such file or directory
Makefile:718: recipe for target 'Include/Python-ast.h' failed
make: *** [Include/Python-ast.h] Error 127
这是因为Include/Python-ast.h
比Parser/asdl_c.py
更新,make --debug
告诉{/ 1}}
...
Prerequisite 'Parser/Python.asdl' is newer than target 'Include/Python-ast.h'.
Prerequisite 'Parser/asdl.py' is newer than target 'Include/Python-ast.h'.
Prerequisite 'Parser/asdl_c.py' is newer than target 'Include/Python-ast.h'.
Must remake target 'Include/Python-ast.h'.
确实,在Python脚本之后克隆了一些标题:
$ ls --full-time Include/Python-ast.h Parser/asdl_c.py
-rw-r--r-- 1 piwi piwi 21113 2016-09-08 15:22:32.984000000 +0200 Include/Python-ast.h
-rwxr-xr-x 1 piwi piwi 41414 2016-09-08 15:22:33.248000000 +0200 Parser/asdl_c.py
在这种特定情况下,触摸标题可以解决问题:
$ touch Include/Python-ast.h
$ make
... compiles ...
是否有适当的方法来阻止此行为?
谢谢,
答案 0 :(得分:1)
显然这是已知的问题。结帐后使用make touch
,然后make
应该有效。