[cfe-dev] Testing clang using Visual Studio on Windows

Tory Bjorklund ToryB at aagard.com
Fri May 13 10:57:44 PDT 2011


On Saturday, May 07, 2011 12:11 PM, Francois Pichet [mailto:pichet2000 at gmail.com] wrote:

>On Fri, May 6, 2011 at 6:04 PM,  <toryb at runestone.net> wrote:
>> In the "Hacking on clang" document there is a section on how to test
>> using Visual Studio on windows.
>> (http://clang.llvm.org/hacking.html#testingWindows) When I attempt to
>> follow those directions I receive the following error:
>> 
>> 1>------ Build started: Project: clang-test, Configuration: Debug
>> Win32 ------
>> 1>  Running Clang regression tests
>> 1>  Traceback (most recent call last):
>> 1>    File "C:/Projects/Sandbox/LLVM/LLVM/utils/lit/lit.py", line 4,
>> in <module>
>> 1>      import lit
>> 1>    File "C:\Projects\Sandbox\LLVM\LLVM\utils\lit\lit\__init__.py",
>> line 3, in <module>
>> 1>      from main import main
>> 1>  ImportError: No module named main
>> 1>C:\Program
>> Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5):
>> error MSB6006: "cmd.exe" exited with code 1.
>> 
>> I suspect something is not configured correctly regarding my python
>> install, but don't know what it is. I did try version 2.7.1 also with
>> the same result. I also tried to use the command line instead of the
>> Visual Studio with the same result:

> This really should work.

> Something wrong, but I don't know what. Look like a python problem,
> you really need 2.7 and not 3.2.
> Make sure it is Python 2.7 that is in your PATH environment. If python
> 2.7 and python 3.2 are both installed on your computer it is possible
> that 3.2 is picked up. How about you check your PATH to be sure 2.7 is
> used or you can uninstall Python 3.2 to be sure.

Thanks for the reply. I figured out part of the issue but have run into a couple more issues. First the list.py could not find the site specific config files. I fixed that (see explanation in next paragraph) but now it is "unable to find 'build_mode' parameter." I suspect both issues are related.

I think it comes down to having followed the advice of the article "Building LLVM with CMake" (http://llvm.org/docs/CMake.html). The article says "It is not supported to build LLVM on the source directory" and recommends creating a separate directory. Directing CMake to a build directory places the lit.site.cfg files (and possibly others?) in the build directory tree rather than the source directory tree. My question is: should I run CMake from a separate build directory or from the LLVM source root directory? If I use a build directory, in addition to the lit.site.cfg files, what should I copy from the build directory tree to the source directory tree for testing?

Thanks,

Tory





More information about the cfe-dev mailing list