Skip to content

Commit 74de05c

Browse files
committed
Add new clang to sbsa
1 parent 9ca0498 commit 74de05c

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

Dockerfile.GPU-buster-cross-sbsa

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,35 @@ RUN apt-get install -y cuda-nvcc-${VER} cuda-nvcc-cross-sbsa-${VER} cuda-cudart-
2121
RUN curl https://sh.rustup.rs -sSf | \
2222
sh -s -- --default-toolchain stable -y
2323
ENV PATH=/root/.cargo/bin:$PATH
24+
25+
RUN curl https://apt.llvm.org/llvm.sh -sSf | \
26+
bash -s -- 20; \
27+
echo "set(CMAKE_SYSTEM_NAME Linux)" > /opt/toolchain.cmake; \
28+
echo "set(CMAKE_SYSTEM_PROCESSOR aarch64)" >> /opt/toolchain.cmake; \
29+
echo "set(CMAKE_C_COMPILER /opt/clang-aarch64)" >> /opt/toolchain.cmake; \
30+
echo "set(CMAKE_CXX_COMPILER /opt/clang++-aarch64)" >> /opt/toolchain.cmake; \
31+
echo 'set(CMAKE_CUDA_HOST_COMPILER ${CMAKE_CXX_COMPILER})' >> /opt/toolchain.cmake; \
32+
echo "set(CMAKE_CUDA_COMPILER /usr/local/cuda/bin/nvcc)" >> /opt/toolchain.cmake; \
33+
echo 'set(CMAKE_CUDA_FLAGS "-t 0 --split-compile=0 -allow-unsupported-compiler")' >> /opt/toolchain.cmake; \
34+
echo 'set(CMAKE_CUDA_LINK_FLAGS "-t 0 --split-compile=0 -allow-unsupported-compiler")' >> /opt/toolchain.cmake; \
35+
echo '#!/bin/sh\n/usr/bin/clang-20 --target=aarch64-linux-gnu "${@}"\n' > /opt/clang-aarch64; \
36+
echo '#!/bin/sh\n/usr/bin/clang++-20 --target=aarch64-linux-gnu "${@}"\n' > /opt/clang++-aarch64; \
37+
chmod +x /opt/clang-aarch64 /opt/clang++-aarch64; \
38+
cat /opt/clang-aarch64 /opt/clang++-aarch64;
39+
40+
ENV OMPVERSION=20.1.7
41+
ENV LIBOMP_AARCH64="/opt/build_libomp/openmp-${OMPVERSION}.src/build-arm64/runtime/src"
42+
RUN mkdir -p build_libomp && cd build_libomp; \
43+
wget -qO- https://github.com/llvm/llvm-project/releases/download/llvmorg-${OMPVERSION}/cmake-${OMPVERSION}.src.tar.xz | tar xJvf -; \
44+
wget -qO- https://github.com/llvm/llvm-project/releases/download/llvmorg-${OMPVERSION}/openmp-${OMPVERSION}.src.tar.xz | tar xJvf -; \
45+
mv cmake-${OMPVERSION}.src cmake; \
46+
cd openmp-${OMPVERSION}.src; \
47+
mkdir -p build-arm64 && cd build-arm64; \
48+
cmake \
49+
-GNinja \
50+
-DLIBOMP_ENABLE_SHARED=OFF \
51+
-DLIBOMP_INSTALL_ALIASES=OFF \
52+
-DLIBOMP_ARCH=aarch64 \
53+
-DCMAKE_TOOLCHAIN_FILE=/opt/toolchain.cmake \
54+
..; \
55+
cmake --build . -j$(nproc --all) -v;

0 commit comments

Comments
 (0)