@@ -31,7 +31,7 @@ ENV SWIFT_VERSION=${SWIFT_VERSION} \
3131RUN apt-get update && apt-get install -y \
3232 build-essential \
3333 cmake \
34- clang-17 \
34+ clang-18 \
3535 curl \
3636 git \
3737 python3 \
@@ -61,7 +61,7 @@ RUN apt-get update && apt-get install -y \
6161 libssl-dev \
6262 libgoogle-glog-dev \
6363 libgtest-dev \
64- libomp-17 -dev \
64+ libomp-18 -dev \
6565 libleveldb-dev \
6666 liblmdb-dev \
6767 libopencv-dev \
@@ -72,8 +72,8 @@ RUN apt-get update && apt-get install -y \
7272 openmpi-doc \
7373 protobuf-compiler \
7474 libgflags-dev \
75- libc++-17 -dev \
76- libc++abi-17 -dev \
75+ libc++-18 -dev \
76+ libc++abi-18 -dev \
7777 ninja-build \
7878 && rm -rf /var/lib/apt/lists/*
7979
@@ -131,8 +131,8 @@ RUN CLANG_RESOURCE_DIR="$(clang++ -print-resource-dir)" && \
131131 OMP_INCLUDE_DIR="" && \
132132 for candidate in \
133133 "${RESOURCE_OMP}" \
134- "/usr/lib/llvm-17 /lib/clang/17 /include/omp.h" \
135- "/usr/lib/llvm-17 /include/omp.h" \
134+ "/usr/lib/llvm-18 /lib/clang/18 /include/omp.h" \
135+ "/usr/lib/llvm-18 /include/omp.h" \
136136 "/usr/include/omp.h" \
137137 "/usr/lib/x86_64-linux-gnu/openmp/include/omp.h" ; do \
138138 if [ -f "${candidate}" ]; then \
@@ -154,7 +154,7 @@ RUN CLANG_RESOURCE_DIR="$(clang++ -print-resource-dir)" && \
154154 OMP_LIBRARY="" && \
155155 for candidate in \
156156 "${LLVM_BASE_DIR}/lib/libomp.so" \
157- "/usr/lib/llvm-17 /lib/libomp.so" \
157+ "/usr/lib/llvm-18 /lib/libomp.so" \
158158 "/usr/lib/x86_64-linux-gnu/libomp.so" \
159159 "/usr/lib/x86_64-linux-gnu/libomp.so.5" ; do \
160160 if [ -f "${candidate}" ]; then \
@@ -215,7 +215,7 @@ RUN . /etc/profile.d/pytorch.sh && \
215215 \
216216 # Step 3: Find libc++ (C++ standard library)
217217 # TaylorTorch uses Swift C++ interop, so PyTorch must use the same C++ stdlib as Swift
218- # Try Swift's bundled libc++ first, then fall back to system LLVM 17
218+ # Try Swift's bundled libc++ first, then fall back to system LLVM 18
219219 LIBCXX_INCLUDE_DIR="" && \
220220 LIBCXX_SOURCE="unknown" && \
221221 for candidate in \
@@ -231,21 +231,21 @@ RUN . /etc/profile.d/pytorch.sh && \
231231 fi; \
232232 done && \
233233 if [ -z "${LIBCXX_INCLUDE_DIR}" ]; then \
234- echo "ℹ Swift toolchain doesn't include libc++, using system LLVM 17 " && \
234+ echo "ℹ Swift toolchain doesn't include libc++, using system LLVM 18 " && \
235235 for candidate in \
236- "/usr/lib/llvm-17 /include/c++/v1" \
236+ "/usr/lib/llvm-18 /include/c++/v1" \
237237 "/usr/include/c++/v1" ; do \
238238 if [ -d "${candidate}" ] && [ -f "${candidate}/cstddef" ]; then \
239239 LIBCXX_INCLUDE_DIR="$(realpath " ${candidate}")" && \
240- LIBCXX_SOURCE="system LLVM 17 " && \
240+ LIBCXX_SOURCE="system LLVM 18 " && \
241241 echo "✓ Found libc++ in system at ${LIBCXX_INCLUDE_DIR}" && \
242242 break; \
243243 fi; \
244244 done; \
245245 fi && \
246246 if [ -z "${LIBCXX_INCLUDE_DIR}" ]; then \
247247 echo "ERROR: Unable to locate libc++ headers." && \
248- echo "Please ensure libc++-17 -dev is installed." && \
248+ echo "Please ensure libc++-18 -dev is installed." && \
249249 exit 1; \
250250 fi && \
251251 LIBCXX_LIBRARY_DIR="" && \
@@ -262,7 +262,7 @@ RUN . /etc/profile.d/pytorch.sh && \
262262 fi && \
263263 if [ -z "${LIBCXX_LIBRARY_DIR}" ]; then \
264264 for candidate in \
265- "/usr/lib/llvm-17 /lib" \
265+ "/usr/lib/llvm-18 /lib" \
266266 "/usr/lib/x86_64-linux-gnu" \
267267 "/usr/lib" ; do \
268268 if ls "${candidate}/libc++.so" * >/dev/null 2>&1; then \
@@ -274,7 +274,7 @@ RUN . /etc/profile.d/pytorch.sh && \
274274 fi && \
275275 if [ -z "${LIBCXX_LIBRARY_DIR}" ]; then \
276276 echo "ERROR: Unable to locate libc++ libraries." && \
277- echo "Please ensure libc++-17 -dev is installed." && \
277+ echo "Please ensure libc++-18 -dev is installed." && \
278278 exit 1; \
279279 fi && \
280280 echo "libc++ include dir: ${LIBCXX_INCLUDE_DIR}" && \
@@ -303,13 +303,13 @@ RUN . /etc/profile.d/pytorch.sh && \
303303 BUILD_RESOURCE_INCLUDE="${RESOURCE_INCLUDE}" && \
304304 echo "✓ Using Swift's clang for PyTorch build" ; \
305305 else \
306- if [ -f "/usr/lib/llvm-17 /bin/clang" ] && [ -f "/usr/lib/llvm-17 /bin/clang++" ]; then \
307- BUILD_CC="/usr/lib/llvm-17 /bin/clang" && \
308- BUILD_CXX="/usr/lib/llvm-17 /bin/clang++" && \
309- BUILD_RESOURCE_INCLUDE="/usr/lib/llvm-17 /lib/clang/17 /include" && \
310- echo "✓ Using system clang-17 for PyTorch build (matches libc++ 17 )" ; \
306+ if [ -f "/usr/lib/llvm-18 /bin/clang" ] && [ -f "/usr/lib/llvm-18 /bin/clang++" ]; then \
307+ BUILD_CC="/usr/lib/llvm-18 /bin/clang" && \
308+ BUILD_CXX="/usr/lib/llvm-18 /bin/clang++" && \
309+ BUILD_RESOURCE_INCLUDE="/usr/lib/llvm-18 /lib/clang/18 /include" && \
310+ echo "✓ Using system clang-18 for PyTorch build (matches libc++ 18 )" ; \
311311 else \
312- echo "⚠ System clang-17 not found, falling back to Swift's clang" && \
312+ echo "⚠ System clang-18 not found, falling back to Swift's clang" && \
313313 BUILD_CC="${SWIFT_TOOLCHAIN_DIR}/bin/clang" && \
314314 BUILD_CXX="${SWIFT_TOOLCHAIN_DIR}/bin/clang++" && \
315315 BUILD_RESOURCE_INCLUDE="${RESOURCE_INCLUDE}" ; \
@@ -319,7 +319,7 @@ RUN . /etc/profile.d/pytorch.sh && \
319319 if [ "$LIBCXX_SOURCE" = "Swift toolchain" ]; then \
320320 CMAKE_PREFIX_PATH="${LLVM_BASE_DIR};/usr" ; \
321321 else \
322- CMAKE_PREFIX_PATH="/usr/lib/llvm-17 ;/usr" ; \
322+ CMAKE_PREFIX_PATH="/usr/lib/llvm-18 ;/usr" ; \
323323 fi && \
324324 echo "=== Build Configuration ===" && \
325325 echo "Compiler: ${BUILD_CC}" && \
0 commit comments