Skip to content

Commit 3bd4174

Browse files
committed
Update Dockerfile to use 22
1 parent 247ec26 commit 3bd4174

File tree

3 files changed

+34
-15
lines changed

3 files changed

+34
-15
lines changed

.github/workflows/ubuntu.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ jobs:
179179
strategy:
180180
matrix:
181181
os: ${{ fromJSON(inputs.is_nightly && '["ubuntu-24.04","ubuntu-24.04-arm"]' || '["ubuntu-24.04"]') }}
182+
env:
183+
LD_LIBRARY_PATH: /opt/llvm/lib
182184
steps:
183185
- uses: actions/checkout@v6
184186
- name: Download installed package
@@ -211,6 +213,8 @@ jobs:
211213
strategy:
212214
matrix:
213215
os: ${{ fromJSON(inputs.is_nightly && '["ubuntu-24.04","ubuntu-24.04-arm"]' || '["ubuntu-24.04"]') }}
216+
env:
217+
LD_LIBRARY_PATH: /opt/llvm/lib
214218
steps:
215219
- uses: actions/checkout@v6
216220
- name: Download installed package
@@ -284,6 +288,8 @@ jobs:
284288
strategy:
285289
matrix:
286290
os: ["ubuntu-24.04"]
291+
env:
292+
LD_LIBRARY_PATH: /opt/llvm/lib
287293
steps:
288294
- uses: actions/checkout@v6
289295
- name: Download installed package
@@ -322,6 +328,8 @@ jobs:
322328
strategy:
323329
matrix:
324330
os: ["ubuntu-24.04"]
331+
env:
332+
LD_LIBRARY_PATH: /opt/llvm/lib
325333
steps:
326334
- uses: actions/checkout@v6
327335
- name: Download installed package

cmake/openmp.cmake

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@ function(ppc_link_threads exec_func_lib)
2121
endfunction()
2222

2323
function(ppc_link_openmp exec_func_lib)
24-
find_package(
25-
OpenMP
26-
COMPONENTS CXX
27-
REQUIRED)
24+
find_package(OpenMP REQUIRED)
2825
target_link_libraries(${exec_func_lib} PUBLIC ${OpenMP_libomp_LIBRARY}
2926
OpenMP::OpenMP_CXX)
3027
endfunction()

docker/ubuntu.Dockerfile

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,48 @@
11
FROM ubuntu:24.04
22

3-
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
4-
53
ENV DEBIAN_FRONTEND=noninteractive
4+
ARG LLVM_VER=22.1.0
5+
ARG TARGETARCH
66

77
RUN set -e \
88
&& apt-get update \
99
&& apt-get install -y --no-install-recommends \
1010
build-essential \
1111
git \
12-
ca-certificates curl wget gnupg lsb-release software-properties-common \
12+
ca-certificates curl gnupg lsb-release software-properties-common \
1313
python3 python3-pip \
1414
ninja-build cmake make \
1515
ccache \
1616
valgrind \
1717
libmpich-dev mpich \
1818
openmpi-bin openmpi-common libopenmpi-dev \
19+
libomp-dev \
1920
gcc-14 g++-14 \
2021
gcovr zip \
21-
&& wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor > /usr/share/keyrings/llvm-archive-keyring.gpg \
22-
&& echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] http://apt.llvm.org/noble/ llvm-toolchain-noble-22 main" \
23-
> /etc/apt/sources.list.d/llvm.list \
24-
&& apt-get update \
25-
&& apt-get install -y --no-install-recommends \
26-
clang-22 clang-tools-22 clang-tidy-22 clang-format-22 \
27-
lldb-22 lld-22 llvm-22 llvm-22-dev \
28-
libomp5-22 libomp-22-dev \
22+
xz-utils \
23+
&& case "${TARGETARCH}" in \
24+
amd64) llvm_pkg_arch="X64" ;; \
25+
arm64) llvm_pkg_arch="ARM64" ;; \
26+
*) echo "Unsupported TARGETARCH: ${TARGETARCH}" >&2; exit 1 ;; \
27+
esac \
28+
&& llvm_major="${LLVM_VER%%.*}" \
29+
&& llvm_pkg="LLVM-${LLVM_VER}-Linux-${llvm_pkg_arch}" \
30+
&& curl -fsSL --retry 5 --retry-delay 2 --retry-all-errors \
31+
-o "${llvm_pkg}.tar.xz" \
32+
"https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VER}/${llvm_pkg}.tar.xz" \
33+
&& tar -xf "${llvm_pkg}.tar.xz" -C /opt \
34+
&& ln -s "/opt/${llvm_pkg}" "/opt/llvm-${llvm_major}" \
35+
&& ln -s "/opt/llvm-${llvm_major}" /opt/llvm \
36+
&& ln -s /opt/llvm/bin/clang++ /opt/llvm/bin/clang++-"${llvm_major}" \
37+
&& ln -s /opt/llvm/bin/clang-tidy /opt/llvm/bin/clang-tidy-"${llvm_major}" \
38+
&& ln -s /opt/llvm/bin/clang-format /opt/llvm/bin/clang-format-"${llvm_major}" \
39+
&& echo "/opt/llvm/lib" > /etc/ld.so.conf.d/llvm.conf \
40+
&& ldconfig \
41+
&& rm "${llvm_pkg}.tar.xz" \
2942
&& apt-get clean \
3043
&& rm -rf /var/lib/apt/lists/*
3144

3245
ENV CC=gcc-14 CXX=g++-14
46+
ENV PATH="/opt/llvm/bin:${PATH}"
3347

3448
CMD ["bash"]

0 commit comments

Comments
 (0)