Repository: NVIDIA/hpc-container-maker

Issue:
LLVM trunk version out-of-date
Since Jul 26th 2023, LLVM trunk is version 18.

`self.__trunk_version` in `hpccm/building_blocks/llvm.py` should be bumped to allow installing Clang 17 or 18.

Discussion:

Patch:
diff --git a/hpccm/building_blocks/llvm.py b/hpccm/building_blocks/llvm.py
index f0d68fc..5897a99 100644
--- a/hpccm/building_blocks/llvm.py
+++ b/hpccm/building_blocks/llvm.py
@@ -104,7 +104,7 @@ class llvm(bb_base, hpccm.templates.envvars):
         self.__runtime_rpms = []   # Filled in below
         self.__toolset = kwargs.get('toolset', False)
         # Current LLVM trunk version
-        self.__trunk_version = kwargs.get('_trunk_version', '17')
+        self.__trunk_version = kwargs.get('_trunk_version', '18')
         self.__upstream = kwargs.get('upstream', False)
         self.__version = kwargs.get('version', None)
 


Test patch:
diff --git a/test/test_llvm.py b/test/test_llvm.py
index c6c0f2e..f1527a6 100644
--- a/test/test_llvm.py
+++ b/test/test_llvm.py
@@ -361,15 +361,15 @@ RUN wget -qO - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \
     echo "deb-src http://apt.llvm.org/bionic/ llvm-toolchain-bionic main" >> /etc/apt/sources.list.d/hpccm.list && \
     apt-get update -y && \
     DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
-        clang-17 \
-        clang-format-17 \
-        clang-tidy-17 \
-        libomp-17-dev && \
+        clang-18 \
+        clang-format-18 \
+        clang-tidy-18 \
+        libomp-18-dev && \
     rm -rf /var/lib/apt/lists/*
-RUN update-alternatives --install /usr/bin/clang clang $(which clang-17) 30 && \
-    update-alternatives --install /usr/bin/clang++ clang++ $(which clang++-17) 30 && \
-    update-alternatives --install /usr/bin/clang-format clang-format $(which clang-format-17) 30 && \
-    update-alternatives --install /usr/bin/clang-tidy clang-tidy $(which clang-tidy-17) 30''')
+RUN update-alternatives --install /usr/bin/clang clang $(which clang-18) 30 && \
+    update-alternatives --install /usr/bin/clang++ clang++ $(which clang++-18) 30 && \
+    update-alternatives --install /usr/bin/clang-format clang-format $(which clang-format-18) 30 && \
+    update-alternatives --install /usr/bin/clang-tidy clang-tidy $(which clang-tidy-18) 30''')
 
     @x86_64
     @ubuntu20
@@ -391,15 +391,15 @@ RUN wget -qO - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \
     echo "deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal main" >> /etc/apt/sources.list.d/hpccm.list && \
     apt-get update -y && \
     DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
-        clang-17 \
-        clang-format-17 \
-        clang-tidy-17 \
-        libomp-17-dev && \
+        clang-18 \
+        clang-format-18 \
+        clang-tidy-18 \
+        libomp-18-dev && \
     rm -rf /var/lib/apt/lists/*
-RUN update-alternatives --install /usr/bin/clang clang $(which clang-17) 30 && \
-    update-alternatives --install /usr/bin/clang++ clang++ $(which clang++-17) 30 && \
-    update-alternatives --install /usr/bin/clang-format clang-format $(which clang-format-17) 30 && \
-    update-alternatives --install /usr/bin/clang-tidy clang-tidy $(which clang-tidy-17) 30''')
+RUN update-alternatives --install /usr/bin/clang clang $(which clang-18) 30 && \
+    update-alternatives --install /usr/bin/clang++ clang++ $(which clang++-18) 30 && \
+    update-alternatives --install /usr/bin/clang-format clang-format $(which clang-format-18) 30 && \
+    update-alternatives --install /usr/bin/clang-tidy clang-tidy $(which clang-tidy-18) 30''')
 
     @aarch64
     @ubuntu