Skip to content

Commit

Permalink
CI (MSVC): Update build rules for MSVC 19.40
Browse files Browse the repository at this point in the history
GitHub seems to be updating their runner images to include MSVC 19.40
currently.

NVIDIA CUDA seems to think this newer version of MSVC is no longer
Microsoft Visual Studio 2022 (but it is).
Work around that issue by adding `-allow-unsupported-compiler` to the
CUDA flags.

Additionally, it looks like the PATH variable on these runners is
arranged such that a different (older) `clang-cl` is being picked up
by CMake instead of the newer one from MSVC 19.40.
Work around that by moving that version out of the PATH so CMake picks
the compiler that is installed with Microsoft Visual Studio.
  • Loading branch information
mmuetzel committed Jun 5, 2024
1 parent 3df9cb3 commit 44178ef
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/root-cmakelists.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,14 @@ jobs:
if [ ${{ matrix.cuda }} = 'with' ]; then
_extra_config+=(-DCUDAToolkit_ROOT="$(cygpath -m "${{ steps.cuda-toolkit.outputs.CUDA_PATH }}")")
_extra_config+=(-DCMAKE_CUDA_COMPILER="$(cygpath -m "${{ steps.cuda-toolkit.outputs.CUDA_PATH }}")/bin/nvcc.exe")
# MSVC 19.40 is still Visual Studio 2022.
# Suppress erroneous version check.
_extra_config+=(-DCMAKE_CUDA_FLAGS=-allow-unsupported-compiler)
fi
if [ ${{ matrix.cc }} = 'clang-cl' ]; then
# Move away (old) clang-cl that would be in PATH to make sure that
# we use the one that matches the MSVC runtime.
mv C:/Program\ Files/LLVM C:/Program\ Files/LLVM_old
fi
mkdir -p ${GITHUB_WORKSPACE}/build && cd ${GITHUB_WORKSPACE}/build
cmake -G"Ninja Multi-Config" \
Expand Down

0 comments on commit 44178ef

Please sign in to comment.