<div dir="ltr">I set my PATH in .bash_profile and the cmake does recognize them.<div><br></div><div>But when I compile using 'make', it shows me this:</div><div><br></div><div>







<p class="p1"><span class="s1">../../../bin/llvm-tblgen: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by ../../../bin/llvm-tblgen)</span></p><br><div class="gmail_quote"><div dir="ltr">On Wed, Jul 22, 2015 at 2:08 AM Martin J. O'Riordan <<a href="mailto:Martin.ORiordan@movidius.com">Martin.ORiordan@movidius.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-IE" link="blue" vlink="purple"><div><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.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:"Book Antiqua","serif";color:#1f497d"><u></u> <u></u></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.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:"Book Antiqua","serif";color:#1f497d"><u></u> <u></u></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:<u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:"Book Antiqua","serif";color:#1f497d"><u></u> <u></u></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" \<u></u><u></u></span></p><p class="MsoNormal" style="margin-left:36.0pt"><span style="font-family:"Courier New";color:black">              ../../llvm \<u></u><u></u></span></p><p class="MsoNormal" style="margin-left:36.0pt"><span style="font-family:"Courier New";color:black">              "-DCMAKE_BUILD_TYPE:STRING=Debug" \<u></u><u></u></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>>" \<u></u><u></u></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>>" \<u></u><u></u></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>>" \<u></u><u></u></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>> \<u></u><u></u></span></p><p class="MsoNormal" style="margin-left:36.0pt"><span style="font-family:"Courier New";color:black">              -DENABLE_TIMESTAMPS=1<u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:"Book Antiqua","serif";color:#1f497d"><u></u> <u></u></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.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:"Book Antiqua","serif";color:#1f497d"><u></u> <u></u></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.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:"Book Antiqua","serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-family:"Book Antiqua","serif";color:#1f497d">All the best,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:"Book Antiqua","serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-family:"Book Antiqua","serif";color:#1f497d">            MartinO<u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:"Book Antiqua","serif";color:#1f497d"><u></u> <u></u></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""> <a href="mailto:llvmdev-bounces@cs.uiuc.edu" target="_blank">llvmdev-bounces@cs.uiuc.edu</a> [mailto:<a href="mailto:llvmdev-bounces@cs.uiuc.edu" target="_blank">llvmdev-bounces@cs.uiuc.edu</a>] <b>On Behalf Of </b>NAKAMURA Takumi<br><b>Sent:</b> 22 July 2015 8:25<br><b>To:</b> Xiaochu Liu; <a href="mailto:llvmdev@cs.uiuc.edu" target="_blank">llvmdev@cs.uiuc.edu</a><br><b>Subject:</b> Re: [LLVMdev] build llvm on CentOS<u></u><u></u></span></p><p class="MsoNormal"><u></u> <u></u></p><p>Did you specify PYTHON_EXECUTABLE?<u></u><u></u></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=" target="_blank">http://bb.pgr.jp/builders/ninja-x64-msvc-RA-centos6/builds/13948/steps/CMake/logs/stdio</a><br>It's centos6.<u></u><u></u></p></div></div><div lang="EN-IE" link="blue" vlink="purple"><div><p class="MsoNormal"><u></u> <u></u></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" target="_blank">xiaochu1122@gmail.com</a>>:<u></u><u></u></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,<u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></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. <u></u><u></u></p></div><div><p class="MsoNormal">I was wondering if anyone has experience building llvm (using cmake) using a local python?<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Thanks,<u></u><u></u></p></div><div><p class="MsoNormal">XIaochu<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></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><u></u><u></u></p></blockquote></div></div></div></blockquote></div></div></div>