Errors compiling trunk on Windows

Hello everyone, I’m trying to compile current trunk r127170 but getting some errors:

\llvm\tools\clang\include\clang/Basic/DiagnosticIDs.h(46): fatal error C1083: Cannot open include file: ‘clang/Basic/DiagnosticCommonKinds.inc’: No such file or directory
\llvm\tools\clang\include\clang/Driver/CC1Options.h(22): fatal error C1083: Cannot open include file: ‘clang/Driver/CC1Options.inc’: No such file or directory
\llvm\tools\clang\include\clang/Basic/DiagnosticIDs.h(46): fatal error C1083: Cannot open include file: ‘clang/Basic/DiagnosticCommonKinds.inc’: No such file or directory

These inc files are nowhere to be found, am I doing something wrong? Everything used to work before I update few days ago.

Nikola Smiljanic <popizdeh@gmail.com>
writes:

Hello everyone, I'm trying to compile current trunk r127170 but getting some
errors:

\llvm\tools\clang\include\clang/Basic/DiagnosticIDs.h(46): fatal error
C1083: Cannot open include file: 'clang/Basic/DiagnosticCommonKinds.inc': No
such file or directory
\llvm\tools\clang\include\clang/Driver/CC1Options.h(22): fatal error C1083:
Cannot open include file: 'clang/Driver/CC1Options.inc': No such file or
directory
\llvm\tools\clang\include\clang/Basic/DiagnosticIDs.h(46): fatal error
C1083: Cannot open include file: 'clang/Basic/DiagnosticCommonKinds.inc': No
such file or directory

These inc files are nowhere to be found, am I doing something wrong?
Everything used to work before I update few days ago.

The build generates those files for me with MSBuild.exe, but finally
fails with

cl : Command line error D8030: INTERNAL COMPILER ERROR in '???A?(???
???p???' [D:\dev\llvm\ide-project\tools\clang\lib\Rewrite\clangRew
rite.vcxproj]
      Please choose the Technical Support command on the Visual C++

I have no time right now for building with NMake.

Try cleaning the solution and rebuilding or, even better, regenerate the
projects from scratch with cmake. If the problem persists, create a bug
report and describe your environment (versions, number of processors)
and the command you execute (cmake, etc).

False alarm, build errors were my fault.
But I think that documentation is wrong about project generation.
Namely, it says that the commands should be:

mkdir build
cd build
cmake -G "Visual Studio 10" ..\llvm

but at this point llvm\build is the current directory and you can't
reference llvm root dir using ..\llvm (cmake gives an error)
the command should be cmake -G "Visual Studio 10" ..\

cmake.patch (1.06 KB)

Nikola Smiljanic <popizdeh@gmail.com> writes:

False alarm, build errors were my fault.
But I think that documentation is wrong about project generation.
Namely, it says that the commands should be:

mkdir build
cd build
cmake -G "Visual Studio 10" ..\llvm

but at this point llvm\build is the current directory and you can't
reference llvm root dir using ..\llvm (cmake gives an error)
the command should be cmake -G "Visual Studio 10" ..\

From the instructions on that page, I think it is clear that ../llvm

means "path from the build directory to the LLVM source root".

For alternative instructions about building LLVM see

http://www.llvm.org/docs/CMake.html

For building Clang with the above method, you just need to put Clang
sources under LLVM_SOURCE_ROOT/tools directotry.

From the instructions on that page, I think it is clear that ../llvm
means "path from the build directory to the LLVM source root".

I think what you're saying is true for CMake page where it says

cmake -G "Visual Studio 8 2005" path/to/llvm/source/root

But getting_started page lists exact commands and one of them doesn't
work if you follow it exactly. It's not that it matters much, I just
thought that this might be a mistake.

Nikola Smiljanic <popizdeh@gmail.com> writes:

[snip]

But getting_started page lists exact commands and one of them doesn't
work if you follow it exactly.

I don't think so. Let's suppose your current directory is c:\ and follow
the instructions for VS on http://clang.llvm.org/get_started.html :

c:\> <checkout llvm>
c:\> cd llvm\tools
c:\llvm\tools> <checkout clang>
c:\llvm\tools> cd ..\..
c:\> mkdir build
c:\> cd build
c:\build> cmake -G "Visual Studio 8 2005" ..\llvm

At the last command you are in the build/ directory and the path to LLVM
sources from there is ..\llvm, as used on the cmake command.

[snip]

and the path to LLVM sources from there is ..\llvm

..\ is one level above current dir and ..\llvm is c:\llvm\llvm and
cmake gives an error:

CMake Error: The source directory "c:/llvm/llvm" does not exist.

Did you 'mkdir build' in C:\ or C:\llvm?

If the latter, just use ..\ instead of ..\llvm.

Chip

Did you 'mkdir build' in C:\ or C:\llvm?

Oh God, build dir is outside llvm dir, sorry for all the confusion :slight_smile:

Nikola Smiljanic <popizdeh@gmail.com> writes:

and the path to LLVM sources from there is ..\llvm

..\ is one level above current dir and ..\llvm is c:\llvm\llvm and
cmake gives an error:

CMake Error: The source directory "c:/llvm/llvm" does not exist.

So, exactly, which step is wrong on the sequence described on my
previous post? Note that the left column shows the current directory for
each command.

Sorry, you were right all along. I somehow thought that the build dir
is inside the llvm dir. The funny thing is that I used these exact
steps two months ago and everything worked just fine, but now somehow
got confused.