[llvm-dev] Building LLVM through Bazel

David Blaikie via llvm-dev llvm-dev at lists.llvm.org
Tue Aug 14 14:43:00 PDT 2018


Yeah - not sure we're quite at the point where LLVM wants to start
supporting two build systems again (used to be Configure+Make and the CMake
system, now it's just the Cmake system), but if you want to make it work
out-of-tree it shouldn't be too difficult (Google does this internally with
the internal version of Bazel). Writing a short BUILD extension for running
tblgen should be possible without too much complexity - not sure what
Tensorflow is doing that makes its solution so complicated, it doesn't seem
like it should be terribly hard, just a genrule to run tblgen and generate
the appropriate files from the td files.

- Dave

On Tue, Aug 14, 2018 at 2:17 AM Douglas Parker via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hi llvm-dev,
>
> I'm not sure if this is the right place for this, but I posted a question
> on Stack Overflow
> <https://stackoverflow.com/questions/51585688/building-llvm-with-bazel> a
> week ago with no response, so feel free to point me elsewhere if there is a
> more appropriate place.
>
> Basically, I have a project using LLVM as a dependency currently building
> with CMake, which I would like to switch over to Bazel. However I am not
> able to get LLVM to build because header files are always missing. Bazel is
> supposed to do the actual C++ compilation, but without the headers it can't
> do that. I've tried looking through LLVM's build system, but it's pretty
> complex and I'm not that familiar with CMake.
>
> Are there certain targets which will generate all these headers which I
> can run before Bazel starts compiling C++ source? The closest I've found is
> ModuleMaker, which seems to run tblgen to create some of these headers, but
> I still find I'm missing some. Are there other targets which build header
> files or are there any other generated source files that need to created
> before compilation?
>
> One example error I'm getting at the moment is:
> In file included from
> external/llvm/llvm-master/include/llvm/MC/MCStreamer.h:30:0,
>                  from
> external/llvm/llvm-master/lib/Object/RecordStreamer.h:16,
>                  from
> external/llvm/llvm-master/lib/Object/ModuleSymbolTable.cpp:17:
> external/llvm/llvm-master/include/llvm/Support/TargetParser.h:61:31: fatal
> error: ARMTargetParser.def: No such file or directory
>
> Any direction would be greatly appreciated:
>
> Doug
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180814/9dddadb3/attachment.html>


More information about the llvm-dev mailing list