-
Notifications
You must be signed in to change notification settings - Fork 90
/
centos-build.dockerfile
27 lines (24 loc) · 1.27 KB
/
centos-build.dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
FROM centos:centos7.9.2009
RUN yum update -y \
&& yum -y install centos-release-scl-2-3.el7.centos \
&& yum -y install make-3.82-24.el7 \
&& yum -y install git-1.8.3.1-24.el7_9 \
# contains recent versions of gcc
&& yum -y install devtoolset-9-9.1-0.el7 \
# required to build llvm
&& yum -y install python3-3.6.8-18.el7
RUN curl -sL https://cmake.org/files/v3.25/cmake-3.25.2-linux-x86_64.sh -o cmake_install.sh \
&& chmod +x cmake_install.sh \
&& ./cmake_install.sh --prefix=/usr/local --exclude-subdir --skip-license \
&& rm cmake_install.sh
# https://releases.llvm.org/12.0.0/docs/GettingStarted.html#getting-started-quickly-a-summary
RUN git clone --depth 1 --branch release/12.x https://github.com/llvm/llvm-project.git \
&& cd llvm-project \
&& mkdir build \
&& cd build \
# enable software collections with recent versions of gcc required to build llvm,
# use gcc_install_prefix to tell clang where gcc containing required libstdc++ is installed
&& scl enable devtoolset-9 -- cmake -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Release -DGCC_INSTALL_PREFIX=/opt/rh/devtoolset-9/root/usr/ -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=1 -G "Unix Makefiles" ../llvm \
&& make install \
&& cd ../../ \
&& rm -rf llvm-project