[LLVMdev] build llvm on CentOS (original) (raw)

Xiaochu Liu xiaochu1122 at gmail.com
Wed Jul 22 08:06:22 PDT 2015


I set my PATH in .bash_profile and the cmake does recognize them.

But when I compile using 'make', it shows me this:

../../../bin/llvm-tblgen: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by ../../../bin/llvm-tblgen)

On Wed, Jul 22, 2015 at 2:08 AM Martin J. O'Riordan < Martin.ORiordan at movidius.com> wrote:

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 ‘gcc’ 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.

Python is a particular problem because ‘yum’ is written in Python and is very version sensitive, so ironically you can update Python and find that ‘ yum’ no longer works preventing future updates. My solution was to download the sources for ‘cmake’ [v3.0.2], ‘python’ [v2.7.6] and ‘gcc’ [v4.8.2], build them locally, and set my PATH, LDLIBRARYPATH and LDRUNPATH variables to reference this local version. Then to configure I have: _CC=which gcc CXX=which g++ $(CMAKE) -G "Unix Makefiles" _ _../../llvm _ _"-DCMAKEBUILDTYPE:STRING=Debug" _ _"-DCMAKEEXELINKERFLAGS:STRING=-<*extra link flags*>" _ _"-DCMAKECXXFLAGS:STRING=<*extra C++ flags*>" _ _-DLLVMTARGETSTOBUILD="<*list of targets*>" _ _-DLLVMDEFAULTTARGETTRIPLE=<*default target*> _ -DENABLETIMESTAMPS=1 Having the locally built version of Python on PATH seems to be fine, but I did have to force ‘CC’ and ‘CXX’ to the intended versions. If you want the version of ‘clang’ 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 ‘-static-libgcc -static-libstdc++ -static’ in your extra link flags which will use the static libraries and remove this dependency, although at the expense of large executables. All the best, MartinO From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] *On Behalf Of *NAKAMURA Takumi Sent: 22 July 2015 8:25 To: Xiaochu Liu; llvmdev at cs.uiuc.edu Subject: Re: [LLVMdev] build llvm on CentOS Did you specify PYTHONEXECUTABLE? See also, http://bb.pgr.jp/builders/ninja-x64-msvc-RA-centos6/builds/13948/steps/CMake/logs/stdio <https://urldefense.proofpoint.com/v2/url?u=http-3A_bb.pgr.jpbuildersninja-2Dx64-2Dmsvc-2DRA-2Dcentos6builds13948stepsCMakelogsstdio&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4bhmuhMHA&m=GtlnwGu5OHHn-liMx2xEnMf9GcBF7eY3pxfEoOxotY&s=yIGK5ZSYerjjwhdmvnGdx6Qn4JlEdpBVIwJ0LA9zQ&e=> It's centos6. 2015年7月22日(水) 14:29 Xiaochu Liu <xiaochu1122 at gmail.com>: Hi there, 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. I was wondering if anyone has experience building llvm (using cmake) using a local python? Thanks, XIaochu


LLVM Developers mailing list LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150722/d2f3ae87/attachment.html>



More information about the llvm-dev mailing list