<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"MS Gothic";
        panose-1:2 11 6 9 7 2 5 8 2 4;}
@font-face
        {font-family:"MS Gothic";
        panose-1:2 11 6 9 7 2 5 8 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Book Antiqua";
        panose-1:2 4 6 2 5 3 5 3 3 4;}
@font-face
        {font-family:"\@MS Gothic";
        panose-1:2 11 6 9 7 2 5 8 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Book Antiqua","serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-IE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#1F497D'>For various reasons I have to use an old 5.5 version of CentOS that is fairly locked down.  Not only are newer versions of ‘</span><span style='font-family:"Courier New";color:black'>gcc</span><span style='font-family:"Book Antiqua","serif";color:#1F497D'>’ available, but for operational reasons we have chosen to keep the set of installed tools frozen until some more suitable date as there are other teams dependent on the current configuration.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#1F497D'>Python is a particular problem because ‘</span><span style='font-family:"Courier New";color:black'>yum</span><span style='font-family:"Book Antiqua","serif";color:#1F497D'>’ is written in Python and is very version sensitive, so ironically you can update Python and find that ‘</span><span style='font-family:"Courier New";color:black'>yum</span><span style='font-family:"Book Antiqua","serif";color:#1F497D'>’ no longer works preventing future updates.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#1F497D'>My solution was to download the sources for ‘</span><span style='font-family:"Courier New";color:black'>cmake</span><span style='font-family:"Book Antiqua","serif";color:#1F497D'>’ [v3.0.2], ‘</span><span style='font-family:"Courier New";color:black'>python</span><span style='font-family:"Book Antiqua","serif";color:#1F497D'>’ [v2.7.6] and ‘</span><span style='font-family:"Courier New";color:black'>gcc</span><span style='font-family:"Book Antiqua","serif";color:#1F497D'>’ [v4.8.2], build them locally, and set my PATH, LD_LIBRARY_PATH and LD_RUN_PATH variables to reference this local version.  Then to configure I have:<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:black'>CC=`which gcc` CXX=`which g++` $(CMAKE) -G "Unix Makefiles" \<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:black'>              ../../llvm \<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:black'>              "-DCMAKE_BUILD_TYPE:STRING=Debug" \<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:black'>              "-DCMAKE_EXE_LINKER_FLAGS:STRING=-<<i>extra link flags</i>>" \<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:black'>              "-DCMAKE_CXX_FLAGS:STRING=<<i>extra C++ flags</i>>" \<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:black'>              -DLLVM_TARGETS_TO_BUILD="<<i>list of targets</i>>" \<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:black'>              -DLLVM_DEFAULT_TARGET_TRIPLE=<<i>default target</i>> \<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:black'>              -DENABLE_TIMESTAMPS=1<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#1F497D'>Having the locally built version of Python on PATH seems to be fine, but I did have to force ‘</span><span style='font-family:"Courier New";color:black'>CC</span><span style='font-family:"Book Antiqua","serif";color:#1F497D'>’ and ‘</span><span style='font-family:"Courier New";color:black'>CXX</span><span style='font-family:"Book Antiqua","serif";color:#1F497D'>’ to the intended versions.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#1F497D'>If you want the version of ‘</span><span style='font-family:"Courier New";color:black'>clang</span><span style='font-family:"Book Antiqua","serif";color:#1F497D'>’ you build to run on other Linux distros (Ubuntu for example), I found that the GCC shared library dependencies could be a problem, so you might want to include ‘</span><span style='font-family:"Courier New";color:black'>-static-libgcc -static-libstdc++ -static</span><span style='font-family:"Book Antiqua","serif";color:#1F497D'>’ in your extra link flags which will use the static libraries and remove this dependency, although at the expense of large executables.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#1F497D'>All the best,<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#1F497D'>            MartinO<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> llvmdev-bounces@cs.uiuc.edu [mailto:llvmdev-bounces@cs.uiuc.edu] <b>On Behalf Of </b>NAKAMURA Takumi<br><b>Sent:</b> 22 July 2015 8:25<br><b>To:</b> Xiaochu Liu; llvmdev@cs.uiuc.edu<br><b>Subject:</b> Re: [LLVMdev] build llvm on CentOS<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p>Did you specify PYTHON_EXECUTABLE?<o:p></o:p></p><p>See also, <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__bb.pgr.jp_builders_ninja-2Dx64-2Dmsvc-2DRA-2Dcentos6_builds_13948_steps_CMake_logs_stdio&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=Gtl_nwGu5OHHn-liMx2xEnMf9GcBF7eY3pxfEoOxotY&s=yIGK5ZSYerjjwhdmvn_Gdx6Qn4JlEdpBVIwJ0LA9z_Q&e=">http://bb.pgr.jp/builders/ninja-x64-msvc-RA-centos6/builds/13948/steps/CMake/logs/stdio</a><br>It's centos6.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>2015<span style='font-family:"MS Gothic"'>年</span>7<span style='font-family:"MS Gothic"'>月</span>22<span style='font-family:"MS Gothic"'>日</span>(<span style='font-family:"MS Gothic"'>水</span>) 14:29 Xiaochu Liu <<a href="mailto:xiaochu1122@gmail.com">xiaochu1122@gmail.com</a>>:<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><div><p class=MsoNormal>Hi there,<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I was trying to build llvm on CentOS. The problem is that library on CentOS is always so old (Gcc, python). I managed to install local gcc and let cmake know. But I couldn't do so with python. I end up comment out the check in CMakeList.txt which is not good. <o:p></o:p></p></div><div><p class=MsoNormal>I was wondering if anyone has experience building llvm (using cmake) using a local python?<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Thanks,<o:p></o:p></p></div><div><p class=MsoNormal>XIaochu<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div></div><p class=MsoNormal>_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><o:p></o:p></p></blockquote></div></div></body></html>