(original) (raw)
../../../bin/llvm-tblgen: /usr/lib64/libstdc++.so.6: version \`GLIBCXX\_3.4.15' not found (required by ../../../bin/llvm-tblgen)
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, LD\_LIBRARY\_PATH and LD\_RUN\_PATH variables to reference this local version. Then to configure I have:
CC=\`which gcc\` CXX=\`which g++\` $(CMAKE) -G "Unix Makefiles" \\
../../llvm \\
"-DCMAKE\_BUILD\_TYPE:STRING=Debug" \\
"-DCMAKE\_EXE\_LINKER\_FLAGS:STRING=-<extra link flags>" \\
"-DCMAKE\_CXX\_FLAGS:STRING=<extra C++ flags>" \\
-DLLVM\_TARGETS\_TO\_BUILD="<list of targets>" \\
-DLLVM\_DEFAULT\_TARGET\_TRIPLE=<default target> \\
-DENABLE\_TIMESTAMPS=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@cs.uiuc.edu \[mailto:llvmdev-bounces@cs.uiuc.edu\] On Behalf Of NAKAMURA Takumi
Sent: 22 July 2015 8:25
To: Xiaochu Liu; llvmdev@cs.uiuc.edu
Subject: Re: \[LLVMdev\] build llvm on CentOS
Did you specify PYTHON\_EXECUTABLE?
See also, http://bb.pgr.jp/builders/ninja-x64-msvc-RA-centos6/builds/13948/steps/CMake/logs/stdio
It's centos6.
2015年7月22日(水) 14:29 Xiaochu Liu <xiaochu1122@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@cs.uiuc.edu http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev