Missing .inc files when installing LLVM #14924

Closed
jlstrecker opened this Issue Sep 13, 2012 · 4 comments

Projects

None yet

3 participants

@jlstrecker

When Clang is built, some .inc files are supposed to be generated. These files are missing. Although LLVM/Clang installs successfully and /usr/local/Cellar/llvm/3.1/bin/clang runs fine, as a developer you can't include the Clang headers in your code.

Example of a program that includes the Clang headers:

#include <stdio.h>
#include <clang/Basic/Version.h>

int main()
{
    printf("version: %s\n", CLANG_VERSION_STRING);
}

The following command should compile the above example, but fails, stating that clang/Basic/Version.inc (included by Version.h) is missing:

$ clang -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -I/usr/local/Cellar/llvm/3.1/include VersionTest.cpp

Copying Version.inc and the other .inc files (which I happened to have from a previous, non-Homebrew install of Clang) to /usr/local/Cellar/llvm/3.1//include/clang/ fixed the problem (as a temporary workaround).

The brew command I used is:

$ brew install llvm --with-clang --all-targets

The brew doctor output is here.

@2bits
2bits commented Sep 21, 2012

Interesting. Let me look in the source tree before the install finishes. Sorry this got overlooked for a week now.

@2bits
2bits commented Sep 22, 2012

@jlstrecker Ok so all those inc files exist in the source but are not installed. It's easy enough to install them. I guess my question is why would make install not do that? Maybe I'll try a build with CMake to see if it works better. There are a lot of strange manual installation tasks in the llvm formula which is odd.

@2bits
2bits commented Sep 22, 2012

I found the problem. Homebrew is installing clang incorrectly according to the directions. The tools/clang directory is where the tarball gets extracted, and it contains an INSTALL.TXT That files says this:

From inside the Clang build directory, run 'make install' to install the Clang
compiler and header files into the prefix directory selected when LLVM was
configured.

Homebrew doesn't do that, which is why your incs are missing. When I did that, they got installed. I will adjust the formula after I do some more testing tonight. Thanks for the bug report!

@2bits 2bits pushed a commit to 2bits/homebrew that referenced this issue Sep 22, 2012
nibbles 2bits llvm: run `make install` for clang too
llvm takes a second make install in the clang_dir when clang
is built according to the install instructions in the clang
tarball.  Doing this gets all the clang include files installed
that were otherwise missing.  Add a `make install`.

Fixes #14924
c1ebf76
@adamv adamv added a commit that closed this issue Sep 22, 2012
nibbles 2bits llvm: run `make install` for clang too
llvm takes a second make install in the clang_dir when clang
is built according to the install instructions in the clang
tarball.  Doing this gets all the clang include files installed
that were otherwise missing.  Add a `make install`.

Fixes #14924

Closes #15046.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
7d15192
@adamv adamv closed this in 7d15192 Sep 22, 2012
@jlstrecker

Thanks so much!

@snakeyroc3 snakeyroc3 pushed a commit to snakeyroc3/homebrew that referenced this issue Dec 17, 2012
nibbles 2bits llvm: run `make install` for clang too
llvm takes a second make install in the clang_dir when clang
is built according to the install instructions in the clang
tarball.  Doing this gets all the clang include files installed
that were otherwise missing.  Add a `make install`.

Fixes #14924

Closes #15046.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
9865360
@xu-cheng xu-cheng locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.