<div dir="ltr">So I have no idea what the problem is. It might be using autotools, it might be the fact that you're installing llvm. Here's what I tried on my Ubuntu VM.<div><br></div><div>Source from branches/release_37</div><div>llvm in ~/llvm</div><div>clang in ~/clang</div><div>inside ~/build_llvm: cmake -g Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo ../llvm</div><div>inside ~/build_llvm: ninja</div><div>inside ~/build_clang: cmake -g Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLLVM_CONFIG=~/build_llvm/bin/llvm-config ../clang</div><div>inside ~/build_clang: ninja clang-test</div><div><br></div><div>This works for me. I strongly suggest passing the following flags to both cmake configure steps as it makes building much faster:</div><div><br></div><div>-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_FLAGS=-fuse-ld=gold -DCMAKE_CXX_FLAGS=-fuse-ld=gold</div><div><br></div><div>Hope this helps.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 27, 2015 at 8:40 AM, Milian Wolff <span dir="ltr"><<a href="mailto:mail@milianw.de" target="_blank">mail@milianw.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Sorry Nikola,<br>
<br>
the email I wrote was written by hand and used a made up prefix. In reality, I<br>
install into the prefix you see there. Here are my CMakeCache.txt files:<br>
<br>
llvm: <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__paste.kde.org_ppcx7f0hf&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=PVxTvhqazNp3Mt9Pj5gzvmZecldhQu0mfB-MuVMV3J4&s=2lxRN5WtREqlj7_ZLjn6kzZhpCIJ6zkubt4ROUoh3a8&e=" rel="noreferrer" target="_blank">https://paste.kde.org/ppcx7f0hf</a><br>
clang: <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__paste.kde.org_pvseix1ut&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=PVxTvhqazNp3Mt9Pj5gzvmZecldhQu0mfB-MuVMV3J4&s=W6d9iPQlMVYQemJaioc-Bik7aR-vxgqJ_qlOmbhkTCs&e=" rel="noreferrer" target="_blank">https://paste.kde.org/pvseix1ut</a><br>
<br>
Sorry for the confusion, hope this is more explicit.<br>
<br>
Bye<br>
<br>
On Monday, July 27, 2015 08:36:52 AM Nikola Smiljanic wrote:<br>
>    1. -- Found LLVM_CONFIG as<br>
<span class="">>    /home/milian/projects/compiled/other/bin/llvm-config<br>
><br>
><br>
> This makes me believe your clang build is not using the llvm you just<br>
> built? Do you have installed version of LLVM on your distro?<br>
><br>
> I used to build Clang out of source on Windows and you had to provide path<br>
> to LLVM but I can't see that in CMake gui anymore (on Linux). The only<br>
> thing I can suggest is to move clang inside llvm/tools and build in-tree.<br>
> That will work 100%<br>
><br>
</span><span class="">> On Mon, Jul 27, 2015 at 8:29 AM, Milian Wolff <<a href="mailto:mail@milianw.de">mail@milianw.de</a>> wrote:<br>
> > On Monday, July 27, 2015 08:25:37 AM Nikola Smiljanic wrote:<br>
> > > How did you configure? I'm a bit surprised by bulid/clang path. It looks<br>
> > > like you're building Clang but not LLVM?<br>
> ><br>
> > Yes, I'm building Clang.<br>
> ><br>
> > I have:<br>
> ><br>
> > ~/projects/src/llvm<br>
> > ~/projects/src/clang<br>
> > ~/projects/build/llvm<br>
> > ~/projects/build/clang<br>
> ><br>
> > The former two are checkouts of the release_37 branches of the<br>
> > corresponding<br>
> > git@github.com:llvm-mirror/*.git repositories. I configured them basically<br>
> > with<br>
> ><br>
> > build/llvm$ cmake ../../src/llvm -DCMAKE_BUILD_TYPE=RelWithDebInfo -<br>
> > DCMAKE_INSTALL_TYPE=$HOME/projects/compiled/llvm<br>
> ><br>
> > and then same for clang. Everything compiles and works just fine, except<br>
> > for<br>
> > the unit tests. And those are only compiled for me when I run `make clang-<br>
> > test` manually, i.e. they are not included in the "normal" make call - is<br>
> > this<br>
> > intended?<br>
> ><br>
> > Or does clang not support out of source builds?<br>
> ><br>
</span><span class="">> > > On Sun, Jul 26, 2015 at 10:27 PM, Milian Wolff <<a href="mailto:mail@milianw.de">mail@milianw.de</a>> wrote:<br>
> > > > Hey all,<br>
> > > ><br>
> > > > in preparation of working on clang, I want to compile and run the unit<br>
> > > > tests,<br>
> > > > specifically those for the clang-c part.<br>
> > > ><br>
</span>> > > > I read <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__clang.llvm.org_hacking.html&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=PVxTvhqazNp3Mt9Pj5gzvmZecldhQu0mfB-MuVMV3J4&s=TG_XctQ37jJP-rHTPY27xkLFNFU4OdHdveqQ8MBejLY&e=" rel="noreferrer" target="_blank">http://clang.llvm.org/hacking.html</a> and tried to run `make<br>
<span class="">> > > > clang-test`<br>
> > > > in my external build folder, but that fails at link time:<br>
> > > ><br>
> > > > <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__paste.kde.org_ptylyjsa7&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=PVxTvhqazNp3Mt9Pj5gzvmZecldhQu0mfB-MuVMV3J4&s=QXoNBHNevVfvI8rSlrKz8ZrOiWiuAJ-EUDEXGz6q9Xk&e=" rel="noreferrer" target="_blank">https://paste.kde.org/ptylyjsa7</a><br>
> > > ><br>
</span><span class="">> > > > This is using the latest versions of the release_37 branches in both,<br>
> ><br>
> > LLVM<br>
> ><br>
> > > > and<br>
> > > > clang. Could someone tell me what's going wrong here?<br>
> ><br>
> > --<br>
> > Milian Wolff<br>
</span>> > <a href="mailto:mail@milianw.de">mail@milianw.de</a><br>
> > <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__milianw.de&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=PVxTvhqazNp3Mt9Pj5gzvmZecldhQu0mfB-MuVMV3J4&s=NgLlKRS6l1f1fA7C2CVmczfgtehXRiIunHmDAVn6n6s&e=" rel="noreferrer" target="_blank">http://milianw.de</a><br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
Milian Wolff<br>
<a href="mailto:mail@milianw.de">mail@milianw.de</a><br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__milianw.de&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=PVxTvhqazNp3Mt9Pj5gzvmZecldhQu0mfB-MuVMV3J4&s=NgLlKRS6l1f1fA7C2CVmczfgtehXRiIunHmDAVn6n6s&e=" rel="noreferrer" target="_blank">http://milianw.de</a></div></div></blockquote></div><br></div>