[cfe-dev] windows testing - lit.py failure

dawn at burble.org dawn at burble.org
Tue Mar 15 17:17:29 PDT 2011


On Wed, Mar 16, 2011 at 12:44:56AM +0100, Óscar Fuentes wrote:
> dawn at burble.org writes:
> 
> >> > I build clang from the command-line with cmake on Windows 7 in a different
> >> > build directory but am unable to run lit.py.  The command I use is:
> >> >
> >> >     python c:/llvmpath/lit.py  -sv --no-progress-bar --param=build_config=Debug c:/clangpath/test/Sema/wchar.c
> >> >
> >> > as directed in the "Testing on the Command Line" section of the "Hacking on Clang" html.
> >> >
> >> > I get the error: 
> >> > lit.py: lit.cfg:87: fatal: No site specific configuration available!
> >> >
> >> > On Linux it seems I have to run all the tests first with "make test" before 
> >> > I can run a single test with lit.py to set up the various configuration
> >> > files it needs.  Do I need to do that on Windows?  If so, how would I do this
> >> > from the command-line with cmake?
> >> 
> >> After looking at the CMake scripts related to testing it seems to me
> >> that you don't need to execute `make check' for generating the
> >> confiration files for lit.
> >> 
> >> Are you trying to test an installed Clang or LLVM? (that's not
> >> supported) Is the python interpreter found when you configure your build
> >> directory with cmake?
> >
> > No, it's a clang I built using cmake and nmake.
> 
> Sure, but did you installed the resulting binaries with execute `nmake
> install' ?

Oops.  No, I didn't know I needed to do that.  I just did...
but it made no difference - the nmake and cmake commands you gave me both fail
in lit.cfg.

> 
> >> Those c:/llvmpath and c:/clangpath on your command looks suspicious to
> >> me.
> >
> > What's wrong with that?  It comes stright from the online instructions.
> 
> The Clang sources are supposed to live within the LLVM source tree
> (under tools/clang) not outside the LLVM source directory, unless you
> are using the recently added feature for building Clang as an
> independent project.

clang lives in llvm/tools as usual.

> 
> Can you show the exact sequence of commands you executed from the
> LLVM&Clang source code checkout until the failed attempt at testing
> (both inclusive)?

cd c:\dev
svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
cd llvm\tools
svn co http://llvm.org/svn/llvm-project/cfe/trunk clang

cd c:\dev
mkdir build
cd build

cmd /c msvcenv.cmd 
@rem where mscvenv.cmd is:
@rem ------------------------
@rem script to build clang libraries
set ROOT=%cd%\..
set PATH=%ROOT%\..\msvc\bin;%ROOT%\..\cmake\bin;%PATH%
set INCLUDE=%ROOT%\..\msvc\include;%ROOT%\..\msvc\sdkinclude;
set LIB=%ROOT%\..\msvc\lib
set VCINSTALLDIR=%ROOT%\..\msvc
set VSINSTALLDIR=%ROOT%\..\msvc

@rem generate cmake makefiles
cmake -G "NMake Makefiles" ..\llvm -DCMAKE_BUILD_TYPE=debug

@rem build clang
set MFLAGS=
set MAKEFLAGS=
nmake MAKEFLAGS=

@rem ---- this is new ----

@rem build the test files
set PATH=%ROOT%\..\shared\tools\python;%PATH%
cmake --build . --config Debug --target check

@rem install the files so we can run the tests
@rem Yuk!  this installs in c:/Program Files (x86)/LLVM
nmake MAKEFLAGS= install

@rem now run the tests
nmake MAKEFLAGS= clang-test clang-c++tests




More information about the cfe-dev mailing list