Skip to content

Commit

Permalink
try searching for opencl library when no env vars defined before buil…
Browse files Browse the repository at this point in the history
…ding from scratch to address issue #58
  • Loading branch information
cdeterman committed Dec 30, 2016
1 parent 4d1bf87 commit 0ab0bb5
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 13 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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. <[email protected]>
VignetteBuilder: knitr
Expand Down
46 changes: 35 additions & 11 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0ab0bb5

Please sign in to comment.