| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | set -e |
| 3 | |
| 4 | CXX=${1:-g++} |
| 5 | |
| 6 | AUTOPKGTEST_TMP=${AUTOPKGTEST_TMP:-$(mktempscip-shell system . . mktemp. -d)} |
| 7 | |
| 8 | cd $AUTOPKGTEST_TMP |
| 9 | |
| 10 | CXX_MAJOR=$($CXX --version | sedscip-shell system . . sed. -rn '1s/.* ([0-9]+)\..*/\1/p') |
| 11 | NVCC_VERSION=$(nvcc --version | sedscip-shell system . . sed. -rn 's/Cuda compilation tools, release ([0-9.]+),.*/\1/p') |
| 12 | |
| 13 | res=0 |
| 14 | for header in /usr/include/c++/$CXX_MAJOR/* |
| 15 | do |
| 16 | testscip-shell system . . test. -f "$header" || continue |
| 17 | header=$(basenamescip-shell system . . basename. $header) |
| 18 | flags= |
| 19 | ignore_fail= |
| 20 | skip= |
| 21 | case $header in |
| 22 | complex.h) |
| 23 | # cicc does not terminate |
| 24 | [scip-shell system . . `[`. "$NVCC_VERSION" = "12.4" ] && [scip-shell system . . `[`. "$CXX_MAJOR" = "13" ] && skip="yes" |
| 25 | ;; |
| 26 | coroutine) |
| 27 | flags="-Xcompiler -fcoroutines" |
| 28 | ;; |
| 29 | esac |
| 30 | if [scip-shell system . . `[`. "$skip" = "yes" ]; then |
| 31 | echoscip-shell system . . echo. "$header (skipped)" |
| 32 | continue |
| 33 | elif [scip-shell system . . `[`. "$ignore_fail" = "yes" ]; then |
| 34 | echoscip-shell system . . echo. "$header (may fail)" |
| 35 | else |
| 36 | echoscip-shell system . . echo. "$header" |
| 37 | fi |
| 38 | rc=0 |
| 39 | echoscip-shell system . . echo. "#include <$header>" | timeoutscip-shell system . . timeout. 900 nvcc -ccbin $CXX -x cu $flags -o $header.o -c - || rc=$? |
| 40 | if [scip-shell system . . `[`. "$rc" != 0 ]; then |
| 41 | if [scip-shell system . . `[`. "$ignore_fail" = "yes" ]; then |
| 42 | echoscip-shell system . . echo. "Ignored failure: $header" |
| 43 | else |
| 44 | echoscip-shell system . . echo. "FAIL: $header" |
| 45 | res=$rc |
| 46 | fi |
| 47 | fi |
| 48 | done |
| 49 | |
| 50 | exit $res |