diff --git a/.bazelrc b/.bazelrc index 40a500d5..873ec8e7 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,3 +1,5 @@ +common --announce_rc + # Convenient flag shortcuts. build --flag_alias=enable_cuda=//cuda:enable build --flag_alias=cuda_archs=//cuda:archs @@ -13,6 +15,6 @@ build:clang --repo_env=CC=clang build:clang --//cuda:compiler=clang # https://github.com/bazel-contrib/rules_cuda/issues/1 -build --ui_event_filters=-INFO +# build --ui_event_filters=-INFO common:bzlmod --enable_bzlmod diff --git a/.github/workflows/build-tests.yaml b/.github/workflows/build-tests.yaml index fcc11e30..fe101e19 100644 --- a/.github/workflows/build-tests.yaml +++ b/.github/workflows/build-tests.yaml @@ -16,6 +16,13 @@ jobs: cases: - { os: "ubuntu-20.04", cuda-version: "11.2.2", source: "nvidia" } - { os: "ubuntu-20.04", cuda-version: "11.6.2", source: "nvidia" } + - { + os: "ubuntu-20.04", + cuda-version: "11.6.2", + source: "nvidia", + toolchain: "llvm", + toolchain-version: "16", + } - { os: "ubuntu-22.04", cuda-version: "11.5.1-1ubuntu1", @@ -47,6 +54,26 @@ jobs: tree ${CUDA_PATH}/bin tree ${CUDA_PATH}/include tree ${CUDA_PATH}/lib64 + - name: Install LLVM ${{ matrix.cases.toolchain-version }} + if: ${{ !startsWith(matrix.cases.os, 'windows') && matrix.cases.toolchain == 'llvm' }} + run: | + wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh ${{ matrix.cases.toolchain-version }} + sudo ln -sf /usr/bin/clang-${{ matrix.cases.toolchain-version }} /usr/bin/clang + clang --version + + echo "build --config=clang" > $HOME/.bazelrc + echo "build:clang --@rules_cuda//cuda:archs=sm_80" >> $HOME/.bazelrc + echo "build:clang --spawn_strategy=local" >> $HOME/.bazelrc + - name: Install CURAND For LLVM + uses: Jimver/cuda-toolkit@v0.2.11 + if: ${{ !startsWith(matrix.cases.os, 'windows') && matrix.cases.toolchain == 'llvm' }} + with: + cuda: ${{ matrix.cases.cuda-version }} + sub-packages: '["nvcc", "cudart-dev"]' # avoid full cuda install + non-cuda-sub-packages: '["libcurand-dev"]' + method: network - name: Install CUDA (Ubuntu) if: ${{ !startsWith(matrix.cases.os, 'windows') && matrix.cases.source == 'ubuntu' }} run: | diff --git a/examples/.bazelrc b/examples/.bazelrc index c21ebf18..879679ea 100644 --- a/examples/.bazelrc +++ b/examples/.bazelrc @@ -1,3 +1,5 @@ +common --announce_rc + # Convenient flag shortcuts. build --flag_alias=enable_cuda=@rules_cuda//cuda:enable build --flag_alias=cuda_archs=@rules_cuda//cuda:archs @@ -9,7 +11,7 @@ build --enable_cuda=True # Use --config=clang to build with clang instead of gcc and nvcc. build:clang --repo_env=CC=clang -build:clang --//cuda:compiler=clang +build:clang --@rules_cuda//cuda:compiler=clang # https://github.com/bazel-contrib/rules_cuda/issues/1 build --ui_event_filters=-INFO