diff --git a/DESCRIPTION b/DESCRIPTION index 603fb6a..69f1416 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -5,8 +5,8 @@ Description: Provides GPU enabled functions for R objects in a simple and approachable manner. New gpu* and vcl* classes have been provided to wrap typical R objects (e.g. vector, matrix), in both host and device spaces, to mirror typical R syntax without the need to know OpenCL. -Version: 1.2.0 -Date: 2016-12-06 +Version: 1.2.1 +Date: 2016-12-30 Author: Charles Determan Jr. Maintainer: Charles Determan Jr. VignetteBuilder: knitr diff --git a/configure b/configure index 09235f0..6a11e8f 100755 --- a/configure +++ b/configure @@ -115,19 +115,43 @@ case `uname` in CPPFLAGS="${CPPFLAGS} -I'${OPENCL_INC}'" else - echo "OPENCL_LIB not set, will be compiled from source" - LIBS="PKG_LIBS=-L../inst/include/loader -lOpenCL -pthread" - BUILD_LIB="BUILD_LIB=../inst/include/loader/libOpenCL.a" - - echo "Checking OpenCL C++ API" - - if ${OPENCL_INC+"false"}; then - echo "OPENCL_INC not set, using default include directory /usr/include" - OPENCL_INC=/usr/include/ + + # try searching for opencl library + # if fails, build library from scratch + + if [ `ldconfig -p | grep 'libOpenCL\|lOpenCL' | wc -l` > 0 ]; then + echo "found OpenCL library" + LIBS="PKG_LIBS=-lOpenCL" + + echo "Checking OpenCL C++ API" + + if ${OPENCL_INC+"false"}; then + echo "OPENCL_INC not set, using default include directory /usr/include" + OPENCL_INC=/usr/include/ + else + echo "Using OPENCL_INC = " $OPENCL_INC + fi + CPPFLAGS="${CPPFLAGS} -I'${OPENCL_INC}'" else - echo "Using OPENCL_INC = " $OPENCL_INC + echo "no OpenCL found" + # exit 1 + + # setting defaults to compile from source + echo "OPENCL_LIB not set, will be compiled from source" + LIBS="PKG_LIBS=-L../inst/include/loader -lOpenCL -pthread" + BUILD_LIB="BUILD_LIB=../inst/include/loader/libOpenCL.a" + + echo "Checking OpenCL C++ API" + + if ${OPENCL_INC+"false"}; then + echo "OPENCL_INC not set, using default include directory /usr/include" + OPENCL_INC=/usr/include/ + else + echo "Using OPENCL_INC = " $OPENCL_INC + fi + CPPFLAGS="${CPPFLAGS} -I'${OPENCL_INC}'" fi - CPPFLAGS="${CPPFLAGS} -I'${OPENCL_INC}'" + fi if test -e "$OPENCL_INC/CL/cl2.hpp"; then