CUDA and autoconf

Hi,

I am trying to test some typical cuda functions during the configure process. How can I write it in my configure.ac? Something like:

AC_TRY_COMPILE([],

[

__global__ static void test_cuda() {

	const int tid = threadIdx.x;

	const int bid = blockIdx.x;

	__syncthreads();

}

],

[cuda_comp=ok],[cuda_comp=no])

But nvcc is not defined in AC_LANG. Must I create my own m4 macros?

Here my solution. This is not too hard to find this solution, as this is more autoconf relevant than CUDA, but CUDA coders may not be autoconf experts.

AC_MSG_CHECKING([for nvcc compilation])

ac_compile_nvcc=no

	cat>conftest.cu<<EOF

	__global__ static void test_cuda() {

	const int tid = threadIdx.x;

	const int bid = blockIdx.x;

	__syncthreads();

	}

EOF

	if $NVCC -c $NVCCFLAGS conftest.cu &> /dev/null

	then

		ac_compile_nvcc=yes

	fi

	AC_MSG_RESULT([$ac_compile_nvcc])

if test "x$ac_compile_nvcc" = "xno" 

then

	AC_MSG_ERROR([CUDA compiler has problems.])

fi