[LLVMdev] bugs in CMake build

HyperQuantum hyperquantum at gmail.com
Sat Nov 15 09:01:20 PST 2008


On Fri, Nov 14, 2008 at 11:56 PM, Óscar Fuentes <ofv at wanadoo.es> wrote:

> HyperQuantum <hyperquantum at gmail.com> writes:

>> I'm using the sources of the LLVM 2.4 release, actually.
>
> The LLVM cmake build system was quite rough at that time. I suggested to
> remove it from the 2.4 release, but the release manager said it was too
> late. I expect it to be useful for Visual Studio users who do not modify
> the LLVM sources. Anything else would cause trouble.

I tried with SVN revision 59362, now without removing anything I don't
need, and I got another error message:

[ 94%] Built target llvm-config.target
compiler/llvm/tools/opt/CMakeFiles/opt.dir/build.make:44:
tools/opt/CMakeFiles/opt.dir/depend.make: No such file or directory
compiler/llvm/tools/opt/CMakeFiles/opt.dir/build.make:47:
tools/opt/CMakeFiles/opt.dir/progress.make: No such file or directory
compiler/llvm/tools/opt/CMakeFiles/opt.dir/build.make:50:
tools/opt/CMakeFiles/opt.dir/flags.make: No such file or directory
make[2]: *** No rule to make target
`tools/opt/CMakeFiles/opt.dir/flags.make'.  Stop.

The same LLVM sources build fine on their own, so it must have
something to do with my setup.

> I can guarantee a prompt response to bugs and other maintenance on the
> cmake build specification, but can not guarantee the same for the LLVM
> libraries :-)

Well, I have to thank you for this because I really wanted CMake but
didn't have the time to write and maintain a complete build system for
LLVM myself. I really appreciate what you have done.

> One of the things I plan to do is to allow the use of
> LLVM_LINK_COMPONENTS by external projects. Thus, in your project, you
> could do something like:
>
> set(LLVM_MAIN_SRC_DIR /path/to/llvm/sources)
> list(APPEND CMAKE_MODULE_PATH ${LLVM_MAIN_SRC_DIR}/cmake/modules)
>
> include(LLVMClientMacros)
>
> LLVM_LINK_COMPONENTS(bitreader bitwriter [... other llvm components])
>
> add_executable(your_executable etc)
>
> link_llvm_componets(your_executable)
>
> and the libraries needed by the components you listed would be compiled
> and added to your executable.

This would be really cool.

>>> If you find more problems, please report them on
>>> http://www.llvm.org/bugs/
>>
>> Well, for issues like the patch in my previous message I could have
>> done that. But what if I'm not sure if something is caused by my use
>> of LLVM or not, shouldn't I ask here first then?
>
> Right now I'm the only one giving cmake support, and I read both
> llvm-dev and the llvm-bugs. The bug report has the advantage of
> concentrating all the discussion, attached files, etc, on one single
> point, and some helpful people assigns the bug to me when they see that
> cmake is involved (you can do this too on the bug reports you create, if
> you happen to have my e-mail address at hand while filling the bug
> report).

I filed a bug: http://llvm.org/bugs/show_bug.cgi?id=3072


Thanks,

Kevin André




More information about the llvm-dev mailing list