<div dir="ltr">Thanks for the pointer, and for having put this script onto github.<div><br></div><div>One question.  It puts the shared form of libc++ into <prefix>/lib but clang++ still isn't being built to look in <prefix>/lib.  Your script is adding a -L argument for this path to the third stage build so clang++ can build clang with the library.  Your 'testit' script then goes ahead and fails for me because it does not use the -L<prefix>/lib argument.  Does this work for you on a Linux system?  If so, I wonder what is different for mine.  Or maybe you only tried the testit script on Darwin?</div>
<div><br></div><div>I'll take another look at those diffs.  I didn't see any that tried to add <prefix>/lib to the search path, but maybe I overlooked something.</div><div><br></div><div>Thanks,</div><div>-Frank</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jan 31, 2014 at 1:27 PM, Robin Sommer <span dir="ltr"><<a href="mailto:robin@icir.org" target="_blank">robin@icir.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
In case it helps, I'm maintaining a helper script that builds/installs<br>
a standalone llvm/clang/libc++ combo into a prefix of your choice.<br>
--stdlib=libc++ will "just work" with that.<br>
<br>
The script got updated to 3.4 recently:<br>
<br>
    <a href="https://github.com/rsmmr/install-clang" target="_blank">https://github.com/rsmmr/install-clang</a><br>
<br>
The script patches the code a bit to get around search path problems,<br>
though I'm actually not sure if all the patches are still needed. It<br>
works on Linux and Darwin.<br>
<br>
Robin<br>
<div class="HOEnZb"><div class="h5"><br>
On Fri, Jan 31, 2014 at 10:08 -0500, Frank Rehwinkel wrote:<br>
<br>
> Hi,<br>
><br>
><br>
> I would like to compile and install llvm/clang/libcxx into a local<br>
> directory on Linux (Gentoo).  I haven't found the right combination of<br>
> cmake -D flags to make the -stdlib=c++ option work.<br>
><br>
> The first part seems straightforward enough:<br>
><br>
> cmake -G Ninja \<br>
><br>
>     -DCMAKE_BUILD_TYPE=Release \<br>
><br>
>     -DCMAKE_INSTALL_PREFIX=/local/llvm/3.4/usr \<br>
><br>
>     -DFFI_INCLUDE_DIR=/usr/lib64/libffi-3.0.11/include \<br>
><br>
>     -DFFI_LIBRARY_DIR=/usr/lib64 \<br>
><br>
>     -DLLVM_BUILD_TESTS=ON \<br>
><br>
>     -DLLVM_ENABLE_FFI=ON    \<br>
><br>
>     -DLLVM_EXTERNAL_MSBUILD_BUILD=OFF   \<br>
><br>
>     -DLLVM_TARGETS_TO_BUILD=host    \<br>
><br>
>     -DPYTHON_EXECUTABLE=/usr/bin/python2    \<br>
><br>
>     -DLIBCXX_CXX_ABI=libstdc++ \<br>
><br>
><br>
> -DLIBCXX_LIBSUPCXX_INCLUDE_PATHS="/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/include/g++-v4;/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/include/g++-v4/x86_64-pc-linux-gnu"<br>
> \<br>
><br>
>     -DLIBCXX_ENABLE_SHARED=YES \<br>
><br>
>     ${SRC}<br>
><br>
><br>
> But the system header search path used by clang++ when the libc++ stdlib is<br>
> used then is completely wrong.  Looking through the source code, I stumbled<br>
> on the parameters DEFAULT_SYSROOT and gave that a try.<br>
><br>
> -DDEFAULT_SYSROOT=/local/llvm/3.4<br>
><br>
> and that made the system header search path look good as far as finding the<br>
> libc++ headers, but now the plain old /usr/include directory is no longer<br>
> in the search path so /usr/include/features.h is not found.<br>
><br>
> Is building clang and libcxx on Linux and installing to a local directory<br>
> supported and if so, please, what did I overlook or not know?<br>
><br>
> (I built with gcc, version 4.7.3 as you may have surmised by the paths<br>
> above.)<br>
><br>
> Thanks,<br>
> -Frank<br>
<br>
</div></div><div class="HOEnZb"><div class="h5">> _______________________________________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br>
<br>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Robin Sommer * Phone <a href="tel:%2B1%20%28510%29%20722-6541" value="+15107226541">+1 (510) 722-6541</a> *     <a href="mailto:robin@icir.org">robin@icir.org</a><br>
ICSI/LBNL    * Fax   <a href="tel:%2B1%20%28510%29%20666-2956" value="+15106662956">+1 (510) 666-2956</a> * <a href="http://www.icir.org/robin" target="_blank">www.icir.org/robin</a><br>
</font></span></blockquote></div><br></div>