Browse Source

SOCL: enable test suite only when environment variable SOCL_OCL_LIB_OPENCL is defined

Nathalie Furmento 12 years ago
parent
commit
7eda714005
3 changed files with 29 additions and 10 deletions
  1. 3 0
      ChangeLog
  2. 17 0
      configure.ac
  3. 9 10
      socl/examples/Makefile.am

+ 3 - 0
ChangeLog

@@ -49,6 +49,9 @@ Changes:
       assigned to any device
     - Remove modified OpenCL headers. ICD is now the only supported
       way to use SOCL.
+    - SOCL test suite is only run when environment variable
+      SOCL_OCL_LIB_OPENCL is defined. It should contain the location
+      of the libOpenCL.so file of the OCL ICD implementation.
   * Fix main memory leak on multiple unregister/re-register.
   * Improve hwloc detection by configure
 

+ 17 - 0
configure.ac

@@ -1397,6 +1397,14 @@ AC_MSG_RESULT($build_socl)
 AM_CONDITIONAL([BUILD_SOCL], [test "x$build_socl" = "xyes"])
 AM_CONDITIONAL([STARPU_USE_SOCL], [test "x$build_socl" = "xyes"])
 
+if test "$build_socl" = "yes" ; then
+   if test -z "$SOCL_OCL_LIB_OPENCL" ; then
+      run_socl_check=no
+   else
+       run_socl_check=yes
+       AC_SUBST(SOCL_OCL_LIB_OPENCL)
+   fi
+fi
 ###############################################################################
 #                                                                             #
 #                                 Debugging                                   #
@@ -1845,8 +1853,17 @@ AC_MSG_NOTICE([
 	       GCC plug-in: $build_gcc_plugin
 	       GCC plug-in test suite (requires GNU Guile): $run_gcc_plugin_test_suite
 	       SOCL enabled:  $build_socl
+               SOCL test suite: $run_socl_check
 ])
 
+if test "$build_socl" = "yes" -a "$run_socl_check" = "no" ; then
+	AC_MSG_NOTICE([
+WARNING: SOCL test suite will not be run as the environment variable SOCL_OCL_LIB_OPENCL is not defined.
+To run the tests, you need to install the OCL implementation of ICD
+(https://forge.imag.fr/projects/ocl-icd/ or Debian package ocl-icd-libopencl1)
+and set the variable SOCL_OCL_LIB_OPENCL to the location of the libOpenCL.so.])
+fi
+
 if test x"$have_valid_hwloc" = xno
 then
   AC_MSG_NOTICE([

+ 9 - 10
socl/examples/Makefile.am

@@ -16,7 +16,7 @@
 
 AM_CFLAGS = $(MAGMA_CFLAGS) $(HWLOC_CFLAGS) -Wall $(STARPU_CUDA_CPPFLAGS) $(STARPU_OPENCL_CPPFLAGS)
 LIBS = $(top_builddir)/socl/src/libsocl-@STARPU_EFFECTIVE_VERSION@.la $(top_builddir)/src/libstarpu-@STARPU_EFFECTIVE_VERSION@.la
-AM_LDFLAGS = $(STARPU_OPENCL_LDFLAGS) $(STARPU_CUDA_LDFLAGS) 
+AM_LDFLAGS = $(STARPU_OPENCL_LDFLAGS) $(STARPU_CUDA_LDFLAGS)
 
 
 SOCL_EXAMPLES	=
@@ -36,10 +36,10 @@ LOADER_BIN		=	$(abs_top_builddir)/socl/examples/$(LOADER)
 loader_SOURCES		=	../../tests/loader.c
 
 if STARPU_HAVE_AM111
-TESTS_ENVIRONMENT	=	top_builddir="$(abs_top_builddir)" top_srcdir="$(abs_top_srcdir)"
+TESTS_ENVIRONMENT	=	LD_PRELOAD="@SOCL_OCL_LIB_OPENCL@" OCL_ICD_VENDORS="$(abs_top_builddir)/socl/vendors/" top_builddir="$(abs_top_builddir)" top_srcdir="$(abs_top_srcdir)"
 LOG_COMPILER		=	$(LOADER_BIN)
 else
-TESTS_ENVIRONMENT	=	top_builddir="$(abs_top_builddir)" top_srcdir="$(abs_top_srcdir)" $(LOADER_BIN)
+TESTS_ENVIRONMENT	=	LD_PRELOAD="@SOCL_OCL_LIB_OPENCL@" OCL_ICD_VENDORS="$(abs_top_builddir)/socl/vendors/" top_builddir="$(abs_top_builddir)" top_srcdir="$(abs_top_srcdir)" $(LOADER_BIN)
 endif
 
 endif
@@ -49,17 +49,16 @@ examplebin_PROGRAMS =
 
 examplebin_PROGRAMS +=		\
 	basic/basic		\
-	clinfo/clinfo \
-  matmul/matmul \
-  mansched/mansched
+	clinfo/clinfo 		\
+	matmul/matmul 		\
+	mansched/mansched
 
 
 SOCL_EXAMPLES +=		\
 	basic/basic		\
-	clinfo/clinfo\
-  matmul/matmul \
-  mansched/mansched
-
+	clinfo/clinfo		\
+	matmul/matmul		 \
+	mansched/mansched
 
 basic_basic_SOURCES = basic/basic.c
 clinfo_clinfo_SOURCES = clinfo/clinfo.c