浏览代码

Fix the compilation of CUDA kernels when $CC is not gcc.

Cyril Roelandt 13 年之前
父节点
当前提交
6139b92f8b
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      configure.ac

+ 6 - 1
configure.ac

@@ -380,7 +380,12 @@ AC_DEFUN([STARPU_CHECK_CUDA],
 	CPPFLAGS="${SAVED_CPPFLAGS}"
 	unset STARPU_CUDA_LDFLAGS
     else
-	if test x$starpu_windows != xyes ; then
+	# nvcc is a wrapper around GCC, and calls it with the -dumpspecs
+	# option, which is GCC specific. If $CC does not support -dumpspecs, we
+	# should let nvcc choose another compiler (by default, gcc, if it is
+	# installed). If gcc is not installed, the build will probably fail.
+	$(CC) -dumpspecs
+	if test $? -eq 0 -a test x$starpu_windows != xyes; then
 	    NVCCFLAGS="${NVCCFLAGS} -ccbin \${CC}"
 	fi
 	if test "$__cuda_include_dir" != "no"; then