[LLVMdev] build llvm on CentOS
Martin J. O'Riordan
Martin.ORiordan at Movidius.com
Wed Jul 22 02:08:45 PDT 2015
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 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 PYTHON_EXECUTABLE?
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.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=>
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/ecc81486/attachment.html>
More information about the llvm-dev
mailing list