CMake clang的CMake构建失败,"执行llvm-build的意外失败:Traceback(...)import llvmbuild"

Mar*_*dej 15 python build llvm clang

我想构建LLVM clang编译器,但CMake最终会出现以下错误消息:

CMake Error at CMakeLists.txt:256 (message):
  Unexpected failure executing llvm-build: Traceback (most recent call
last):

    File "C:/.../llvm/utils/llvm-build/llvm-build", line 3, in
<module>
      import llvmbuild
    File "C:\...\llvm\utils\llvm-build\llvmbuild\__init__.py",
line 1, in
<module>
      from main import main

  ImportError: No module named main


-- Configuring incomplete, errors occurred!
Run Code Online (Sandbox Code Playgroud)

我已经安装了所有需要的工具.

  • 操作系统:Windows 7 x64
  • Python:3.2.2(x86-64)
  • GnuWin32:0.6.3

Mar*_*dej 21

我找到了解决方案.

我刚刚安装了另一个版本的Python:2.x(2.72),(仍然是x86-64)

  • 我也在[Gentoo GNU/Linux](http://www.gentoo.org/)中遇到过这个问题.在撰写本文时,最新的稳定ebuild(Gentoo相当于一个软件包或端口)似乎使用任何Python解释器作为系统默认值.因此,如果Python 3是默认值,它将失败并显示此错误,即使同时安装了Python 2也是如此.我只需将Python 2设置为默认值(例如`eselect python set python2.7`)就可以解决这个问题. (5认同)