Browse Source

Do not avoid passing -ccbin when it is not supported, nvcc does not use the option blindly any more. Let nvcc pick up its preferred compiler alone, in most cases that is preferred. Introduce instead a NVCC_CC environment variable when one really wants to override this.

Samuel Thibault 8 years ago
parent
commit
d51c021306
2 changed files with 6 additions and 10 deletions
  1. 3 8
      configure.ac
  2. 3 2
      doc/doxygen/chapters/510_configure_options.doxy

+ 3 - 8
configure.ac

@@ -1005,13 +1005,8 @@ AC_DEFUN([STARPU_CHECK_CUDA],
 	    rm -f cuda_test*
 	    rm -f cuda_test*
 	fi
 	fi
 
 
-	# 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 >/dev/null 2>&1
-	if test $? -eq 0 -a x$starpu_windows != xyes; then
-	    NVCCFLAGS="${NVCCFLAGS} -ccbin \${CC}"
+	if test -n "$NVCC_CC"; then
+	    NVCCFLAGS="${NVCCFLAGS} -ccbin \${NVCC_CC}"
 	fi
 	fi
 	if test "$__cuda_include_dir" != "no"; then
 	if test "$__cuda_include_dir" != "no"; then
 	    STARPU_CUDA_CPPFLAGS="-I$__cuda_include_dir"
 	    STARPU_CUDA_CPPFLAGS="-I$__cuda_include_dir"
@@ -1099,7 +1094,6 @@ if test x$enable_cuda = xyes; then
 	#in case this is a 64bit setup, we tell nvcc to use a -m64 flag
 	#in case this is a 64bit setup, we tell nvcc to use a -m64 flag
 	if test x$SIZEOF_VOID_P = x8; then
 	if test x$SIZEOF_VOID_P = x8; then
 		NVCCFLAGS="${NVCCFLAGS} -m64"
 		NVCCFLAGS="${NVCCFLAGS} -m64"
-		AC_SUBST(NVCCFLAGS)
 	fi
 	fi
 
 
 	AC_CHECK_HEADERS([cuda_gl_interop.h])
 	AC_CHECK_HEADERS([cuda_gl_interop.h])
@@ -1169,6 +1163,7 @@ if test x$enable_cuda = xyes; then
 fi
 fi
 
 
 AC_ARG_VAR([NVCC], [CUDA compiler])
 AC_ARG_VAR([NVCC], [CUDA compiler])
+AC_ARG_VAR([NVCC_CC], [C compiler for CUDA compiler])
 AC_ARG_VAR([NVCCFLAGS], [CUDA compiler flags])
 AC_ARG_VAR([NVCCFLAGS], [CUDA compiler flags])
 
 
 ###############################################################################
 ###############################################################################

+ 3 - 2
doc/doxygen/chapters/510_configure_options.doxy

@@ -113,8 +113,9 @@ machine which does not have the tools <c>doxygen</c> and <c>latex</c>
 
 
 Additionally, the script <c>configure</c> recognize many variables, which
 Additionally, the script <c>configure</c> recognize many variables, which
 can be listed by typing <c>./configure --help</c>. For example,
 can be listed by typing <c>./configure --help</c>. For example,
-<c>./configure NVCCFLAGS="-arch sm_13"</c> adds a flag for the compilation of
-CUDA kernels.
+<c>./configure NVCCFLAGS="-arch sm_20"</c> adds a flag for the compilation of
+CUDA kernels, and <c>NVCC_CC=gcc-5</c> allows to change the C++ compiler
+used by nvcc.
 
 
 
 
 \section ConfiguringWorkers Configuring Workers
 \section ConfiguringWorkers Configuring Workers