-
Notifications
You must be signed in to change notification settings - Fork 26
Build Instructions for OSX
##Dependencies
There are essentially three major dependencies that are required:
- OpenCL headers (can be found at Khronos.org)
- An OpenCL SDK specific to your GPU vender (AMD, NVIDIA, Intel, etc.)
- A compiler that supports C++11 (e.g. template aliases)
Note - the package will install if you dependencies 1 & 3 but it will be essentially non-functional.
##Installation
OpenCL should be present by default but you likely will not have the C++ API. This is required currently until I find a cleaner way to include this (possibly in the includes of this package, TBD).
You can download it on the Khronos downloads page here which provides all the OpenCL headers. You will want whichever is the most recent version you currently have. To find this out, on a Mac OSX 10.10 you open the /System/Library/Frameworks/OpenCL.framework/Headers/cl.h
file in your favorite text editor and find the /* OpenCL Version */
section. Choose the highest version, download the corresponding cl.hpp
file and put it in that directory.
This is typically accomplished with the two following commands (OpenCL 2.1 example):
wget https://www.khronos.org/registry/cl/api/2.1/cl.hpp
sudo mv cl.hpp /System/Library/Frameworks/OpenCL.framework/Headers/cl.hpp
If you are using OSX 11.11 (El Capitan), you may need to disable System Integrity Protection (SIP) temporarily to be able to copy cl.hpp to the System folder. To disable SIP:
- Restart the computer holding cmd+R
- Go to the Utilities menu and open a Terminal
- On the Terminal, enter
csrutil disable
- Then restart the computer normally.
After copying the file, you can enable SIP by repeating the process, but this time entering the command csrutil enable
.
Although this may work out of the box you may need an appropriate SDK installed for the GPU you have installed. Most functions will work on the CPU but you likely are installing this to use a GPU. I personally do not have a Mac so I am unable to provide further documentation at this time. Would love any contributions by those with additional experience.
Once the above dependencies are met, you can install gpuR
###Stable
install.packages('gpuR')
###Unstable
# Dev RViennaCL
devtools::install_github("cdeterman/RViennaCL")
# Dev gpuR
devtools::install_github("cdeterman/gpuR")
Once all these things are set you should be able to install the package and begin using your GPU :)
Please submit additional issues on the issues tab.