-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile-clang19
53 lines (43 loc) · 1.97 KB
/
Dockerfile-clang19
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
FROM ubuntu:22.04
WORKDIR /root
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update -y && \
apt-get install -y curl && \
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.20.3/protobuf-cpp-3.20.3.tar.gz && \
tar xzf protobuf-cpp-*.tar.gz && \
rm protobuf-cpp-*.tar.gz
# ------------------------------------------------------------------------------------
# clang 19
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update -y && \
apt-get install -y gnupg curl && \
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy main" \
> /etc/apt/sources.list.d/llvm.list && \
echo "deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy main" \
>> /etc/apt/sources.list.d/llvm.list && \
curl -L https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \
apt-get update -y && \
apt-get install -y clang-19 libc++abi-19-dev libc++-19-dev libomp-19-dev && \
apt-get install -y pkg-config make
RUN ln -s /usr/bin/clang-19 /usr/bin/clang && \
ln -s /usr/bin/clang++-19 /usr/bin/clang++
RUN cd protobuf-* && \
./configure --prefix=/usr/local/clang CC=clang CXX=clang++ \
'CXXFLAGS=-stdlib=libc++ -O3 -g' \
LDFLAGS=-stdlib=libc++ 'LIBS=-lc++ -lc++abi' && \
make
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get install -y checkinstall && \
cd protobuf-* && \
mkdir -p /usr/share/doc/protobuf-clang19/ && \
cp LICENSE README.md /usr/share/doc/protobuf-clang19/ && \
echo /usr/share/doc/protobuf-clang19/LICENSE > /tmp/xlist && \
echo /usr/share/doc/protobuf-clang19/README.md >> /tmp/xlist && \
checkinstall -y -D --pkgname protobuf-clang19 \
--maintainer "csardi.gabor@gmail.com" \
--include /tmp/xlist \
--requires 'libc++1-19,libc++abi1-19,libunwind-19,libc6,libgcc-s1' \
--arch $(dpkg --print-architecture) \
--pkglicense "See LICENSE file."
RUN cp protobuf-*/protobuf-clang*.deb /root/
COPY build.sh /root/build.sh