소스 검색

Set -std=c++11 flag in nvcc independently from gcc, they may behave differently

Samuel Thibault 5 년 전
부모
커밋
c497d8ddea
1개의 변경된 파일16개의 추가작업 그리고 2개의 파일을 삭제
  1. 16 2
      configure.ac

+ 16 - 2
configure.ac

@@ -232,8 +232,7 @@ if test x$enable_simgrid = xyes ; then
 			  #include <msg/msg.h>
 			  #endif
 			  ]])],,
-			  CXXFLAGS="-std=c++11 $CXXFLAGS"
-			  NVCCFLAGS="-std=c++11 $NVCCFLAGS")
+			  CXXFLAGS="-std=c++11 $CXXFLAGS")
 	AC_LANG_POP([C++])
 	AC_ARG_ENABLE(simgrid-mc, [AS_HELP_STRING([--enable-simgrid-mc],
 				[Enable using Model Checker of simgrid])],
@@ -1323,6 +1322,21 @@ if test x$enable_cuda = xyes; then
 	STARPU_CUDA_LDFLAGS="$STARPU_CUDA_LDFLAGS -lcudart"
 	STARPU_CUFFT_LDFLAGS="-lcufft"
 
+	AC_LANG_PUSH([C++])
+	SAVED_CXX="$CXX"
+	CXX="$NVCC"
+	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+			  #ifdef STARPU_HAVE_SIMGRID_MSG_H
+			  #include <simgrid/msg.h>
+			  #include <simgrid/host.h>
+			  #else
+			  #include <msg/msg.h>
+			  #endif
+			  ]])],,
+			  NVCCFLAGS="-std=c++11 $NVCCFLAGS")
+	CXX="$SAVED_CXX"
+	AC_LANG_POP([C++])
+
         if test "$F77" = "gfortran" -o "$FC" = "gfortran" ; then
             STARPU_CUDA_FORTRAN_LDFLAGS="-lgfortran"
             AC_SUBST(STARPU_CUDA_FORTRAN_LDFLAGS)