Sfoglia il codice sorgente

- Add the --with-opencl-lib-dir and --with-opencl-include-dir options to
specify separately where to find the library and the headers for OpenCL.
- Document these options (and their CUDA counterparts).

Cédric Augonnet 14 anni fa
parent
commit
1fb5e9a42f
2 ha cambiato i file con 77 aggiunte e 14 eliminazioni
  1. 42 14
      configure.ac
  2. 35 0
      doc/starpu.texi

+ 42 - 14
configure.ac

@@ -392,19 +392,42 @@ AC_DEFINE_UNQUOTED(STARPU_MAXOPENCLDEVS, [$nmaxopencldev],
 AC_ARG_ENABLE(opencl, [AS_HELP_STRING([--disable-opencl],
 		[do not use OpenCL device(s)])],, [enable_opencl=maybe])
 
-if test x$enable_opencl = xyes -o x$enable_opencl = xmaybe; then
-	#AC_MSG_CHECKING(whether OpenCL is available)
-	AC_ARG_WITH(opencl-dir, 
-		[AS_HELP_STRING([--with-opencl-dir=<path>],
-		[specify OpenCL installation directory (default is /usr/)])],
-		[
-			opencl_dir=$withval
-			# in case this was not explicit yet
-			enable_opencl=yes
-		], opencl_dir=/usr/)
+#AC_MSG_CHECKING(whether OpenCL is available)
+AC_ARG_WITH(opencl-dir, 
+	[AS_HELP_STRING([--with-opencl-dir=<path>],
+	[specify OpenCL installation directory (default is /usr/)])],
+	[
+		opencl_dir=$withval
+		# in case this was not explicit yet
+		enable_opencl=yes
+	], opencl_dir=/usr/)
+
+AC_ARG_WITH(opencl-include-dir, 
+	[AS_HELP_STRING([--with-opencl-include-dir=<path>],
+	[specify where OpenCL headers are installed])],
+	[
+		opencl_include_dir=$withval
+		# in case this was not explicit yet
+		enable_opencl=yes
+	], [opencl_include_dir=no])
+
+AC_ARG_WITH(opencl-lib-dir, 
+	[AS_HELP_STRING([--with-opencl-lib-dir=<path>],
+	[specify where OpenCL libraries are installed])],
+	[
+		opencl_lib_dir=$withval
+		# in case this was not explicit yet
+		enable_opencl=yes
+	], [opencl_lib_dir=no])
 	
-	if test -d "$opencl_dir/include/"; then
-		CPPFLAGS="${CPPFLAGS} -I$opencl_dir/include/ "
+if test x$enable_opencl = xyes -o x$enable_opencl = xmaybe; then
+
+	if test x$opencl_include_dir = xno; then
+		opencl_include_dir="$opencl_dir/include/"
+	fi
+
+	if test -d "$opencl_include_dir"; then
+		CPPFLAGS="${CPPFLAGS} -I$opencl_include_dir/ "
 	fi
 
 	# do we have a valid OpenCL setup ?
@@ -416,8 +439,13 @@ if test x$enable_opencl = xyes -o x$enable_opencl = xmaybe; then
 	# restore it in case it's not working.
 	SAVED_LDFLAGS="${LDFLAGS}"
 
-	if test -d "$opencl_dir/lib/"; then
-		LDFLAGS="${SAVED_LDFLAGS} -L$opencl_dir/lib/ "
+	if test x$opencl_lib_dir = xno; then
+		# Default location
+		opencl_lib_dir="$opencl_dir/lib/"
+	fi
+
+	if test -d "$opencl_lib_dir"; then
+		LDFLAGS="${SAVED_LDFLAGS} -L$opencl_lib_dir "
 	fi
 	AC_HAVE_LIBRARY([OpenCL],[],[have_valid_opencl=no])
 

+ 35 - 0
doc/starpu.texi

@@ -1489,9 +1489,13 @@ Enable flags for the coverage tool.
 * --enable-maxcudadev::         
 * --disable-cuda::              
 * --with-cuda-dir::             
+* --with-cuda-include-dir::             
+* --with-cuda-lib-dir::             
 * --enable-maxopencldev::       
 * --disable-opencl::            
 * --with-opencl-dir::           
+* --with-opencl-include-dir::           
+* --with-opencl-lib-dir::           
 * --enable-gordon::             
 * --with-gordon-dir::           
 @end menu
@@ -1534,6 +1538,21 @@ Specify the directory where CUDA is installed. This directory should notably con
 @code{include/cuda.h}.
 @end table
 
+@node --with-cuda-include-dir
+@subsubsection @code{--with-cuda-include-dir=<path>}
+@table @asis
+@item @emph{Description}:
+Specify the directory where CUDA headers are installed. This directory should
+notably contain @code{cuda.h}.
+@end table
+
+@node --with-cuda-lib-dir
+@subsubsection @code{--with-cuda-lib-dir=<path>}
+@table @asis
+@item @emph{Description}:
+Specify the directory where the CUDA library is installed.
+@end table
+
 @node --enable-maxopencldev
 @subsubsection @code{--enable-maxopencldev=<number>}
 @table @asis
@@ -1557,6 +1576,22 @@ Specify the location of the OpenCL SDK. This directory should notably contain
 @code{include/CL/cl.h}.
 @end table
 
+@node --with-opencl-include-dir
+@subsubsection @code{--with-opencl-include-dir=<path>}
+@table @asis
+@item @emph{Description}:
+Specify the location of OpenCL headers. This directory should notably contain
+@code{CL/cl.h}.
+@end table
+
+@node --with-opencl-lib-dir
+@subsubsection @code{--with-opencl-lib-dir=<path>}
+@table @asis
+@item @emph{Description}:
+Specify the location of the OpenCL library.
+@code{include/CL/cl.h}.
+@end table
+
 @node --enable-gordon
 @subsubsection @code{--enable-gordon}
 @table @asis