]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Skip nvcc_ldir test with non-working nvcc (#867)
authorMichael Kruse <github@meinersbur.de>
Sun, 20 Jun 2021 19:19:20 +0000 (14:19 -0500)
committerGitHub <noreply@github.com>
Sun, 20 Jun 2021 19:19:20 +0000 (21:19 +0200)
Add detection to nvcc_ldir of whether nvcc works with chosen host
compiler. For instance, nvcc aborts with

    #error -- unsupported clang version! clang version must be less than 9 and greater than 3.2

if the version of clang (or gcc) is too new. The test should be skipped in
this case.

test/suites/nvcc_ldir.bash

index a19432ad532532659af640eba91f83031ad46b92..2090bed5f41750391a17b836e3b83204781c2723 100644 (file)
@@ -22,6 +22,11 @@ SUITE_nvcc_ldir_PROBE() {
     elif [ ! -d $nvcc_idir ]; then
         echo "include directory $nvcc_idir not found"
     fi
+
+    echo "int main() { return 0; }" | $REAL_NVCC -Wno-deprecated-gpu-targets -ccbin $REAL_COMPILER_BIN -c -x cu - 
+    if [ $? -ne 0 ]; then
+        echo "nvcc of a canary failed; Is CUDA compatible with the host compiler ($REAL_COMPILER_BIN)?"
+    fi
 }
 
 SUITE_nvcc_ldir_SETUP() {