[cig-commits] r18417 - cs/autoconf/trunk

brad at geodynamics.org brad at geodynamics.org
Sun May 22 07:10:03 PDT 2011


Author: brad
Date: 2011-05-22 07:10:03 -0700 (Sun, 22 May 2011)
New Revision: 18417

Added:
   cs/autoconf/trunk/cit_cuda.m4
Log:
Added cit_cuda.m4.

Added: cs/autoconf/trunk/cit_cuda.m4
===================================================================
--- cs/autoconf/trunk/cit_cuda.m4	                        (rev 0)
+++ cs/autoconf/trunk/cit_cuda.m4	2011-05-22 14:10:03 UTC (rev 18417)
@@ -0,0 +1,40 @@
+# -*- Autoconf -*-
+
+
+## --------------------------- ##
+## Autoconf macros for CUDA. ##
+## --------------------------- ##
+
+# ----------------------------------------------------------------------
+# CIT_CUDA_INCDIR
+# ----------------------------------------------------------------------
+# Determine the directory containing <cuda_runtime.h>
+AC_DEFUN([CIT_CUDA_INCDIR], [
+  AC_REQUIRE_CPP
+  AC_LANG(C++)
+  AC_CHECK_HEADER([cuda_runtime.h], [], [
+    AC_MSG_ERROR([CUDA runtime header not found; try CPPFLAGS="-I<CUDA include dir>"])
+  ])dnl
+])dnl CIT_CUDA_INCDIR
+
+
+# ----------------------------------------------------------------------
+# CIT_CUDA_LIB
+# ----------------------------------------------------------------------
+# Checking for the CUDA library.
+AC_DEFUN([CIT_CUDA_LIB], [
+  AC_REQUIRE_CPP
+  AC_LANG(C++)
+  AC_MSG_CHECKING([for cudaMalloc in -lcuda])
+  AC_COMPILE_IFELSE(
+    [AC_LANG_PROGRAM([[#include <cuda_runtime.h>]],
+                     [[void* ptr = 0;]]
+  	             [[cudaMalloc(ptr, ptr, 1);]])],
+    [AC_MSG_RESULT(yes)],
+    [AC_MSG_RESULT(no)
+     AC_MSG_ERROR([cuda library not found.])
+  ])dnl
+])dnl CIT_CUDA_LIB
+
+
+dnl end of file



More information about the CIG-COMMITS mailing list