[GRASS-SVN] r55949 - in grass/trunk: . include/Make raster/r.sun
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Apr 23 02:40:22 PDT 2013
Author: hamish
Date: 2013-04-23 02:40:21 -0700 (Tue, 23 Apr 2013)
New Revision: 55949
Modified:
grass/trunk/configure.in
grass/trunk/include/Make/Platform.make.in
grass/trunk/raster/r.sun/Makefile
grass/trunk/raster/r.sun/main.c
Log:
preliminary support for OpenCL (#1446)
Modified: grass/trunk/configure.in
===================================================================
--- grass/trunk/configure.in 2013-04-22 18:14:21 UTC (rev 55948)
+++ grass/trunk/configure.in 2013-04-23 09:40:21 UTC (rev 55949)
@@ -265,6 +265,7 @@
LOC_ARG_WITH(regex, regex)
LOC_ARG_WITH(pthread, POSIX threads, no)
LOC_ARG_WITH(openmp, OpenMP, no)
+LOC_ARG_WITH(opencl, OpenCL, no)
AC_ARG_WITH(gdal,
[ --with-gdal[=path/gdal-config]
@@ -366,6 +367,9 @@
LOC_ARG_WITH_INC(openmp, OpenMP)
LOC_ARG_WITH_LIB(openmp, OpenMP)
+LOC_ARG_WITH_INC(opencl, OpenCL)
+LOC_ARG_WITH_LIB(opencl, OpenCL)
+
# Put this early on so CPPFLAGS and LDFLAGS have any additional dirs
# With includes option
@@ -1748,6 +1752,41 @@
# Done checking OpenMP
+# Enable OpenCL option
+
+LOC_CHECK_USE(opencl,OpenCL,USE_OPENCL)
+
+OCLINCPATH=
+OCLLIBPATH=
+OCLLIB=
+
+if test -n "$USE_OPENCL"; then
+
+# With OpenCL includes directory
+
+LOC_CHECK_INC_PATH(opencl,OpenCL,OCLINCPATH)
+LOC_CHECK_INCLUDES(CL/cl.h,OpenCL,$OCLINCPATH)
+
+# With OpenCL library directory
+
+LOC_CHECK_LIB_PATH(OpenCL,OpenCL,OCLLIBPATH)
+# FIXME: -L${OCLLIBPATH} is not being added to the gcc conftest.c command. why not? (trac #1943?)
+LOC_CHECK_LIBS(OpenCL,clGetPlatformInfo,OpenCLfunctions,$OCLLIBPATH,OCLLIB,,,)
+
+# expanded symbol check: yes? no?
+#LOC_CHECK_FUNC(clGetPlatformInfo,OpenCL functions,OCLLIB,,,,,[
+#LOC_CHECK_LIBS(OpenCL,clGetPlatformInfo,OpenCL,$OCLLIBPATH,OCLLIB,,,)
+#])
+
+fi # $USE_OPENCL
+
+AC_SUBST(OCLINCPATH)
+AC_SUBST(OCLLIBPATH)
+AC_SUBST(OCLLIB)
+AC_SUBST(USE_OPENCL)
+
+# Done checking OpenCL
+
# Enable LFS (from cdr-tools)
dnl Check for large file support
dnl Do this last to make sure that no large file definition
@@ -1910,6 +1949,7 @@
LOC_MSG_USE(NLS support,USE_NLS)
LOC_MSG_USE(ODBC support,USE_ODBC)
LOC_MSG_USE(OGR support,USE_OGR)
+LOC_MSG_USE(OpenCL support,USE_OPENCL)
LOC_MSG_USE(OpenGL support,USE_OPENGL)
LOC_MSG_USE(OpenMP support,USE_OPENMP)
LOC_MSG_USE(PNG support,USE_PNG)
Modified: grass/trunk/include/Make/Platform.make.in
===================================================================
--- grass/trunk/include/Make/Platform.make.in 2013-04-22 18:14:21 UTC (rev 55948)
+++ grass/trunk/include/Make/Platform.make.in 2013-04-23 09:40:21 UTC (rev 55949)
@@ -94,7 +94,7 @@
ZLIBINCPATH = @ZLIBINCPATH@
ZLIBLIBPATH = @ZLIBLIBPATH@
-DBMIEXTRALIB = @DBMIEXTRALIB@
+DBMIEXTRALIB = @DBMIEXTRALIB@
#readline
READLINEINCPATH = @READLINEINCPATH@
@@ -115,14 +115,14 @@
MYSQLDLIB = @MYSQLDLIB@
#SQLite:
-SQLITEINCPATH = @SQLITEINCPATH@
-SQLITELIBPATH = @SQLITELIBPATH@
-SQLITELIB = @SQLITELIB@
+SQLITEINCPATH = @SQLITEINCPATH@
+SQLITELIBPATH = @SQLITELIBPATH@
+SQLITELIB = @SQLITELIB@
#FFMPEG
-FFMPEGINCPATH = @FFMPEGINCPATH@
-FFMPEGLIBPATH = @FFMPEGLIBPATH@
-FFMPEGLIB = @FFMPEGLIB@
+FFMPEGINCPATH = @FFMPEGINCPATH@
+FFMPEGLIBPATH = @FFMPEGLIBPATH@
+FFMPEGLIB = @FFMPEGLIB@
#ODBC:
ODBCINC = @ODBCINC@
@@ -152,9 +152,9 @@
#LAPACK/BLAS stuff for gmath lib:
BLASLIB = @BLASLIB@
-BLASINC = @BLASINC@
+BLASINC = @BLASINC@
LAPACKLIB = @LAPACKLIB@
-LAPACKINC = @LAPACKINC@
+LAPACKINC = @LAPACKINC@
#GDAL/OGR
GDALLIBS = @GDAL_LIBS@
@@ -163,7 +163,7 @@
USE_OGR = @USE_OGR@
#NetCDF
-NETCDFLIBS = @NETCDF_LIBS@
+NETCDFLIBS = @NETCDF_LIBS@
NETCDFCFLAGS = @NETCDF_CFLAGS@
USE_NETCDF = @USE_NETCDF@
@@ -231,6 +231,12 @@
OMPCFLAGS = @OMPCFLAGS@
USE_OPENMP = @USE_OPENMP@
+#OpenCL
+OCLINCPATH = @OCLINCPATH@
+OCLLIBPATH = @OCLLIBPATH@
+OCLLIB = @OCLLIB@
+USE_OPENCL = @USE_OPENCL@
+
#i18N
HAVE_NLS = @HAVE_NLS@
@@ -242,8 +248,8 @@
MINGW = @MINGW32@
MACOSX_APP = @MACOSX_APP@
-MACOSX_ARCHS = @MACOSX_ARCHS@
-MACOSX_SDK = @MACOSX_SDK@
+MACOSX_ARCHS = @MACOSX_ARCHS@
+MACOSX_SDK = @MACOSX_SDK@
# Cross compilation
-CROSS_COMPILING = @CROSS_COMPILING@
+CROSS_COMPILING = @CROSS_COMPILING@
Modified: grass/trunk/raster/r.sun/Makefile
===================================================================
--- grass/trunk/raster/r.sun/Makefile 2013-04-22 18:14:21 UTC (rev 55948)
+++ grass/trunk/raster/r.sun/Makefile 2013-04-23 09:40:21 UTC (rev 55949)
@@ -4,7 +4,9 @@
LIBES = $(GPROJLIB) $(RASTERLIB) $(GISLIB) $(MATHLIB) $(PROJLIB)
DEPENDENCIES = $(GPROJDEP) $(RASTERDEP) $(GISDEP)
-EXTRA_INC = $(PROJINC)
+EXTRA_INC = $(PROJINC) $(OCLINCPATH)
+EXTRA_LIBS = $(OCLLIB)
+#needed? LIBES += $(OCLLIBPATH) or EXTRA_LDFLAGS = $(OCLLIBPATH)
include $(MODULE_TOPDIR)/include/Make/Module.make
Modified: grass/trunk/raster/r.sun/main.c
===================================================================
--- grass/trunk/raster/r.sun/main.c 2013-04-22 18:14:21 UTC (rev 55948)
+++ grass/trunk/raster/r.sun/main.c 2013-04-23 09:40:21 UTC (rev 55949)
@@ -33,6 +33,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#ifdef USE_OPENCL
+#include <CL/cl.h>
+#endif
+
#include <grass/gis.h>
#include <grass/raster.h>
#include <grass/gprojects.h>
More information about the grass-commit
mailing list