hejseb
hejseb

Reputation: 2164

Installation of OpenCL package in R

I'm trying to install the OpenCL package from CRAN. To this end, I first installed Intel SDK for OpenCL applications which I now find in the folder C:\Program Files(x86)\Intel\OpenCL SDK\6.3. However, this still gets me into trouble because of what I believe to be a failure to find this newly-installed library:

*** arch - i386
c:/Rtools/mingw_32/bin/gcc  -I"C:/PROGRA~1/R/R-33~1.3/include" -DNDEBUG     -I"d:/Compiler/gcc-4.9.3/local330/include"     -O3 -Wall  -std=gnu99 -mtune=core2 -c ocl.c -o ocl.o
ocl.c:6:23: fatal error: CL/opencl.h: No such file or directory
 #include <CL/opencl.h>
                       ^
compilation terminated.
make: *** [ocl.o] Error 1
Warning: running command 'make -f "Makevars" -f "C:/PROGRA~1/R/R-33~1.3/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R-33~1.3/share/make/winshlib.mk" SHLIB="OpenCL.dll" OBJECTS="ocl.o tools.o"' had status 2
ERROR: compilation failed for package 'OpenCL'
* removing 'C:/Users/seban876/Documents/R/win-library/3.3/OpenCL'

How can I make sure this library is found when compiling the package from source?

Upvotes: 2

Views: 582

Answers (1)

Garini
Garini

Reputation: 1204

Firstly, I would check the version of OpenCL that you installed. From the error, it seems possible that you installed the version which is not 64-bits but having a 64-bits arch. On the other hand, I would look for the header file (opencl.h) location and see if it is in the include directory (the one that is linked to the compiler also in the error using the flag -I"somedir").

If you find it somewhere else, you could proceed for an 'easy fix', i.e. making a symlink in the already-linked-to-compiler directory. Otherwise, you could add this new location to the compiler using the PKG_LIB variable. This can be set in the $HOME/.R/Makevars.win (I guess you use Windows). It is better to append and not to overwrite, just in case some other package would like to set this variable.

More information on the system could be helpful to see why the compiler is not able to find that specific header file.

Upvotes: 1

Related Questions