This OpenCL package requires at least one OpenCL implementation to be installed in order for OpenCL to work. OpenCL is a royalty-free standard (http://www.khronos.org/opencl/) and there are several implementations based on this standard. Each implementation is usually specific to a brand of a computing device (such as GPU, CPU or accelerator). For special considerations pertaining to the Windows operating system, see last section of this document. *** OpenCL IMPLEMENTATIONS *** Most common implementations are (in no particular order): Type: GPU Vendor: NVIDIA URL: http://developer.nvidia.com/opencl Mostly supporting NVIDIA GPUs for computation. The OpenCL package has been successfully tested with "NVIDIA GPU computing SDK" on Linux and depending on the GPU device both single and double-precision is supported. The libraries can be either installed from NVIDIA directly or on very recent Debian and Ubuntu (from the non-free section) via apt-get install nvidia-opencl-dev Type: GPU, CPU Vendor: Apple This OpenCL implementation is part of Mac OS X 10.6 (Snow Leopard) and above. The OpenCL package has been successfully tested with nVidia GPU devices (both single and double precision) and Apple M1 (single precision only). The OpenCL framework is part of the OS so no additional libraries need to be installed. Type: GPU, CPU, ACC Vendor: ATI / AMD URL: http://developer.amd.com/zones/OpenCLZone/Pages/default.aspx Mostly supporting AMD (formerly ATI) GPUs and AMD CPUs for computation. Since I don't own any AMD GPUs or CPUs I could not test this implementation. However, Kate Cowles reported success with AMD APP SDK on Ubuntu. Type: CPU, ACC Vendor: Intel URL: http://www.intel.com/go/opencl/ Supports Intel CPUs. Given the ubiquity of Intel CPUs this is a good implementation to install for testing. The OpenCL has been successfully tested with this implementation and RForge.net uses this configuration for checks of the package (both single and double precision is supported). For Debian the installation is fairly simple, download from http://software.intel.com/en-us/articles/download-intel-opencl-sdk/ apt-get install libnuma1 fakeroot alien intel_ocl_sdk_1.1_lnx_64.rpm dpkg -i intel-ocl_1.1-13786_amd64.deb (alternatively rpm2cpio can be used to unpack the rpm directly) *** INSTALLATION *** Once you have an OpenCL implementation installed you can install the OpenCL R package using the regular install.packages() or R CMD INSTALL methods. The OpenCL package assumes the availability of OpenCL headers and OpenCL library at compile time. If you installed the OpenCL implementation in a non-standard location, you may have to set the PKG_CFLAGS and/or PKG_LIBS environment variables accordingly (and possibly LD_LIBRARY_PATH on some unix systems), see R documentation on this. *** Windows *** INSTALLATION: When compiling OpenCL for Windows, you have to set the OCL environment variable to the root of the OpenCL SDK. For example, if installing from R, you can use `Sys.setenv()`: Sys.setenv(OCL="C:/CUDA/v12.1") The defaults assume that the headers are in "$SDK/include" and libraries in "$SDK/lib/x64/OpenCL.lib" and "$SDK/lib/x86/OpenCL.lib" respectively (where $SDK is the SDK root). More recent versions of R will only require 64-bit libraries. In those versions, the OpenCL will also look for "$SDK/lib/OpenCL.lib" and will use it instead if present. Note that Khronos Group (the OpenCL standard governing body) provides a common SDK: https://github.com/KhronosGroup/OpenCL-SDK/releases which can be installed to multiplex between different OpenCL implementations. Simply unpack and point OCL to the root of the SDK. You can also set individual variables OCLINC, OCL32LIB and OCL64LIB with the necessary compiler flags if the locations are non-standard. Note that the flags are passed inside single quotes to R, so if multiple separate flags have to be set, they need to be separated by ' ', e.g.: Sys.setenv(OCL64LIB="C:/OpenCL/lib' '-lOpenCL") Please refer to the vendor's documentation for the necessary flags and locations. For recent single-architecture R versions (typically 64-bit only) the environment variable OCLLIB can be used instead of OCL64LIB. [Additonal notes for OpenCL before version 1.0-9] Due to limitations of the Windows operating system there is a conflict between the OpenCL package DLL and any other DLL called OpenCL.DLL including those of OpenCL vendors. Therefore if the vendor-supplied DLL is called "OpenCL.dll", it must be loaded first, __before__ the package is loaded. For example: dyn.load("C:/Windows/System32/OpenCL.dll", FALSE, TRUE) library(OpenCL) (This assumes your OpenCL.dll by the vendor has been installed into the system location.) For this reason, statically linked OpenCL is recommended if provided by the vendor (consult the vendor documentation) or use the Khronos SDK. --- DISCLAIMER: Product or corporate names may be trademarks or registered trademarks, and are used only for identification and explanation without intent to infringe.