-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.manylinux_2_28-base
More file actions
58 lines (53 loc) · 3.32 KB
/
Dockerfile.manylinux_2_28-base
File metadata and controls
58 lines (53 loc) · 3.32 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# SPDX-FileCopyrightText: 2019-2024 Second State INC
ARG BASE_IMAGE="quay.io/pypa/manylinux_2_28_x86_64"
FROM ${BASE_IMAGE}
ADD scripts/SHA256SUM.manylinux_2_28 /root/
# See /opt/rh/gcc-toolset-13/enable
ENV PATH=/opt/rh/gcc-toolset-13/root/usr/bin${PATH:+:${PATH}}
ENV MANPATH=/opt/rh/gcc-toolset-13/root/usr/share/man${MANPATH:+:${MANPATH}}
ENV INFOPATH=/opt/rh/gcc-toolset-13/root/usr/share/info${INFOPATH:+:${INFOPATH}}
ENV LD_LIBRARY_PATH=/opt/rh/gcc-toolset-13/root/usr/lib64:/opt/rh/gcc-toolset-13/root/usr/lib:${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
ENV PKG_CONFIG_PATH=/opt/rh/gcc-toolset-13/root/usr/lib64/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}
ARG LLVM_TARGETS LLVM_TRIPLE
RUN cd && (yum check-update || true) && yum install -y openssl-devel rpm-build cmake yum-utils && \
yum-config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo && \
yum install -y gcc-toolset-13 && \
export CPU=$(/opt/python/cp311-cp311/bin/python3 -c \
'import multiprocessing; print(multiprocessing.cpu_count())') && \
export CFGFLAGS="--prefix=/opt/rh/gcc-toolset-13/root/usr --disable-shared --libdir=/opt/rh/gcc-toolset-13/root/usr/lib64" && \
curl -s -L -O --remote-name-all \
https://github.com/ninja-build/ninja/archive/refs/tags/v1.12.1.tar.gz \
https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.5/llvm-19.1.5.src.tar.xz \
https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.5/lld-19.1.5.src.tar.xz \
https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.5/libunwind-19.1.5.src.tar.xz \
https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.5/cmake-19.1.5.src.tar.xz \
https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.5/third-party-19.1.5.src.tar.xz \
https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.5/clang-19.1.5.src.tar.xz && \
sha256sum -c SHA256SUM.manylinux_2_28 && \
gzip -dc v1.12.1.tar.gz | tar -xf - && \
xz -dc llvm-19.1.5.src.tar.xz | tar -xf - && \
xz -dc lld-19.1.5.src.tar.xz | tar -xf - && \
xz -dc libunwind-19.1.5.src.tar.xz | tar -xf - && \
xz -dc cmake-19.1.5.src.tar.xz | tar -xf - && \
xz -dc third-party-19.1.5.src.tar.xz | tar -xf - && \
xz -dc clang-19.1.5.src.tar.xz | tar -xf - && \
mkdir build && cd build && /opt/python/cp311-cp311/bin/python \
../ninja-1.12.1/configure.py --bootstrap \
--with-python=/opt/python/cp311-cp311/bin/python && \
cp -v ninja /opt/rh/gcc-toolset-13/root/usr/bin/ninja && cd - && rm -rf build && \
mv -v llvm-19.1.5.src llvm && \
mv -v lld-19.1.5.src lld && \
mv -v libunwind-19.1.5.src libunwind && \
mv -v cmake-19.1.5.src cmake && \
mv -v third-party-19.1.5.src third-party && \
mv -v clang-19.1.5.src clang && \
cmake -Bbuild -GNinja -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/opt/rh/gcc-toolset-13/root/usr \
-DPython3_ROOT_DIR=/opt/python/cp311-cp311 -DLLVM_LIBDIR_SUFFIX=64 \
-DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS}" -DLLVM_ENABLE_PROJECTS="lld;clang" \
-DLLVM_DEFAULT_TARGET_TRIPLE="${LLVM_TRIPLE}" \
-DBUILD_SHARED_LIBS=OFF llvm && \
cmake --build build --target install && \
rm -rf build && rm -rf *
RUN yum clean all