Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
Small refactor to support installing clang-16
Browse files Browse the repository at this point in the history
  • Loading branch information
wmaxey committed Mar 28, 2023
1 parent 795713e commit 9d27645
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
16 changes: 13 additions & 3 deletions environments/linux/docker/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ services:
BUILDKIT_INLINE_CACHE: "1"
USE_LLVM_INSTALLER: "1"
ROOT_IMAGE: "nvcr.io/nvidia/cuda:12.1.0-devel-ubuntu22.04"
COMPILERS: "g++-11 g++-12 clang-11 clang-12 clang-13 clang-14 clang-15"
deploy: &deploy-template
resources:
reservations:
Expand All @@ -37,7 +36,6 @@ services:
BUILDKIT_INLINE_CACHE: "1"
USE_LLVM_INSTALLER: 0
ROOT_IMAGE: "nvcr.io/nvidia/cuda:12.1.0-devel-ubuntu20.04"
COMPILERS: "g++-8 g++-9 g++-10 clang-8 clang-9 clang-10"
deploy: *deploy-template

ubuntu18.04:
Expand All @@ -54,7 +52,6 @@ services:
BUILDKIT_INLINE_CACHE: "1"
USE_LLVM_INSTALLER: 0
ROOT_IMAGE: "nvcr.io/nvidia/cuda:12.1.0-devel-ubuntu18.04"
COMPILERS: "g++-6 g++-7 clang-7"
deploy: *deploy-template

##### Not used yet
Expand Down Expand Up @@ -178,6 +175,19 @@ services:
args:
HOST_CXX: "clang++-15"

clang-16:
extends:
service: ubuntu22.04
image: "libcudacxx/clang-16"
container_name: clang-16
profiles: ["clang-16", "all", "base"]
build:
context: ../../../
dockerfile: environments/linux/docker/ubuntu.base.Dockerfile
target: libcudacxx-configured
args:
HOST_CXX: "clang++-16"

### Ubuntu 20.04 images:

gcc-8:
Expand Down
19 changes: 12 additions & 7 deletions environments/linux/docker/ubuntu.base.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ FROM ${ROOT_IMAGE} AS devenv

ARG COMPILERS="gcc clang"

ARG CMAKE_VER=3.23.1
ARG CMAKE_VER=3.25.1
ARG CMAKE_URL=https://github.com/Kitware/CMake/releases/download/v${CMAKE_VER}/cmake-${CMAKE_VER}-Linux-x86_64.sh

ARG UBUNTU_TOOL_DEB_REPO=https://ppa.launchpadcontent.net/ubuntu-toolchain-r/ppa/ubuntu
ARG UBUNTU_TOOL_FINGER=60C317803A41BA51845E371A1E9377A2BA9EF27F

ARG LLVM_INSTALLER=https://apt.llvm.org/llvm.sh
ARG USE_LLVM_INSTALLER=1

# `-y` answers yes to any interactive prompts.
# `-qq` because apt is noisy
Expand Down Expand Up @@ -44,10 +43,6 @@ RUN function comment() { :; }; \
${APT_GET} --no-install-recommends install apt-utils curl wget git zip unzip tar \
sudo make software-properties-common ninja-build ccache pkg-config \
python3 python3-wheel python3-pip; \
comment "Install GCC and Clang"; \
# Unattended installation hack
if [ "${USE_LLVM_INSTALLER}" -eq "1" ]; then echo "\n" | bash /tmp/llvm.sh all; fi; \
${APT_GET} install gcc g++ ${COMPILERS}; \
comment "Install CMake"; \
sh /tmp/cmake.sh --skip-license --prefix=/usr; \
comment "Install Python utils"; \
Expand All @@ -66,6 +61,16 @@ ARG CUDACXX_PATH=/usr/local/cuda/bin/nvcc
ARG HOST_CXX=gcc
ARG CXX_DIALECT=11

RUN function comment() { :; }; \
comment "Install GCC and Clang"; \
${APT_GET} update; \
# Unattended installation hack
# Install twice because
if [ "${HOST_CXX}" = "clang++-15" ]; then echo "\n" | bash /tmp/llvm.sh 15; fi; \
if [ "${HOST_CXX}" = "clang++-16" ]; then echo "\n" | bash /tmp/llvm.sh 16; fi; \
${APT_GET} install gcc g++ "${HOST_CXX}";


# Attempt to load env from cccl/cuda
ARG TEST_WITH_NVRTC=OFF

Expand All @@ -87,7 +92,7 @@ RUN cmake -S /libcudacxx -B /build \
-DLIBCXX_ENABLE_FILESYSTEM=OFF \
-DCMAKE_CXX_COMPILER=${HOST_CXX} \
-DCMAKE_CUDA_COMPILER=${CUDACXX_PATH} \
-DCMAKE_CUDA_FLAGS="-allow-unsupported-compiler"
-DCMAKE_CUDA_FLAGS="-allow-unsupported-compiler -std=c++14"

RUN ninja -C /build libcudacxx_tu_tests && ninja -C /build clean
RUN ninja -C /build cxx
Expand Down

0 comments on commit 9d27645

Please sign in to comment.